Moved and reorganized wxPython directories
Now builds into an intermediate wxPython package directory before installing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2
wxPython/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.emacs.desktop
|
||||||
|
build.local
|
||||||
177
wxPython/BUILD.txt
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
Build Instructions
|
||||||
|
------------------
|
||||||
|
I used SWIG (http://www.swig.org) to create the source code for the
|
||||||
|
extension module. This enabled me to only have to deal with a small
|
||||||
|
amount of code and only have to bother with the exceptional issues.
|
||||||
|
SWIG takes care of the rest and generates all the repetative code for
|
||||||
|
me. You don't need SWIG to build the extension module as all the
|
||||||
|
generated C++ code is included under the src directory.
|
||||||
|
|
||||||
|
I added a few minor features to SWIG to control some of the code
|
||||||
|
generation. If you want to play around with this you will need to get
|
||||||
|
a recent version of SWIG from their CVS or from a daily build. See
|
||||||
|
http://www.swig.org/ for details.
|
||||||
|
|
||||||
|
wxPython is organized as a Python package. This means that the
|
||||||
|
directory containing the results of the build process should be a
|
||||||
|
subdirectory of a directory on the PYTHONPATH. (And preferably should
|
||||||
|
be named wxPython.) You can control where the build process will dump
|
||||||
|
wxPython by setting the TARGETDIR variable for the build utility, (see
|
||||||
|
below.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1. Build and install wxWindows as described in its BuildCVS.txt or
|
||||||
|
INSTALL.txt file.
|
||||||
|
|
||||||
|
1a. Building wxWindows on Unix/Linux/Etc.
|
||||||
|
|
||||||
|
For *nix systems I run configure with these flags:
|
||||||
|
|
||||||
|
--with-gtk
|
||||||
|
--with-libjpeg
|
||||||
|
--with-opengl
|
||||||
|
--without-odbc
|
||||||
|
--enable-unicode=no
|
||||||
|
--enable-threads=yes
|
||||||
|
--enable-socket=yes
|
||||||
|
--enable-static=no
|
||||||
|
--enable-shared=yes
|
||||||
|
--disable-std_iostreams
|
||||||
|
--enable-newgrid
|
||||||
|
|
||||||
|
You can use whatever flags you want, but these work for me. If you
|
||||||
|
want debug libraries, then you should add the "--enable-debug
|
||||||
|
--enable-mem_tracing" flags. I reccommend creating an empty build
|
||||||
|
directory, and then running make and configure from there. This
|
||||||
|
makes it easy to experiment with different configure options
|
||||||
|
without losing old builds.
|
||||||
|
|
||||||
|
Be sure to run "make install" to install the wxWindows headers and
|
||||||
|
shared library. You can check where the wxPython build will expect
|
||||||
|
to find them by running "wx-config --cflags" and "wx-config --libs"
|
||||||
|
|
||||||
|
If you want the optional OGL (Object Graphics Library) and STC
|
||||||
|
(Styled Text Control) then you need to go to contrib/src/ogl and
|
||||||
|
contrib/src/stc and run "make install" in each of those
|
||||||
|
directories.
|
||||||
|
|
||||||
|
|
||||||
|
1b. Building wxWindows on Win32.
|
||||||
|
|
||||||
|
For Win32 systems I use Visual C++ 6.0, but 5.0 should work. The
|
||||||
|
wxPython build utility currently does not support any other win32
|
||||||
|
compilers. Be sure to copy include/wx/msw/setup0.h to
|
||||||
|
include/wx/msw/setup.h and edit it for the options you want. At a
|
||||||
|
minimum you should set the following:
|
||||||
|
|
||||||
|
wxUSE_NEW_GRID 1
|
||||||
|
wxUSE_GLOBAL_MEMORY_OPERATORS 0
|
||||||
|
wxUSE_LIBTIFF 1
|
||||||
|
|
||||||
|
I also change these:
|
||||||
|
|
||||||
|
wxUSE_DIALUP_MANAGER 0
|
||||||
|
wxUSE_SOCKETS 0
|
||||||
|
wxUSE_FS_INET 0
|
||||||
|
|
||||||
|
There are probably other flags that can be disabled to remove
|
||||||
|
things not being used in wxPython, but I havn't investigated all
|
||||||
|
the potential configurations yet.
|
||||||
|
|
||||||
|
I find it easiest to build wxWindows using the makefiles, that way
|
||||||
|
I don't have to worry about what the IDE might be doing behind the
|
||||||
|
scenes that might screw things up. Simply go to the src/msw
|
||||||
|
directory and run:
|
||||||
|
|
||||||
|
nmake -f makefile.vc CRTFLAG=/MD EXTRAFLAGS=-D__NO_VC_CRTDBG__ dll pch
|
||||||
|
|
||||||
|
If you want to make a release build, add FINAL=1 to the nmake
|
||||||
|
command, as well as to build.local for wxPython, (see below.)
|
||||||
|
|
||||||
|
If you want the optional OGL (Object Graphics Library) and/or STC
|
||||||
|
(Styled Text Control) then you need to go to contrib/src/ogl and
|
||||||
|
contrib/src/stc and build those libraries. The command to use is:
|
||||||
|
|
||||||
|
nmake -f makefile.vc WXUSINGDLL=1 CRTFLAG=/MD EXTRAFLAGS=-D__NO_VC_CRTDBG__
|
||||||
|
|
||||||
|
|
||||||
|
2. For either platform, you should be sure to set an environment
|
||||||
|
variable named WXWIN to be the path to the top of the wxWindows
|
||||||
|
tree.
|
||||||
|
|
||||||
|
|
||||||
|
3. If you are working from a copy of the code retrieved from CVS, then
|
||||||
|
you will find wxPython in $WXWIN/utils/wxPython. If you are
|
||||||
|
working from the tar.gz or .zip files then you will probably want
|
||||||
|
to unpack wxPython in the $WXWIN/utils directory and rename the new
|
||||||
|
directory to wxPython (or use a symlink.) If you want to keep it
|
||||||
|
in a separate directory then you can change where the build.py tool
|
||||||
|
expects to find it by creating a file named build.local (see step 7
|
||||||
|
for more examples about build.local,) containing something like
|
||||||
|
this:
|
||||||
|
|
||||||
|
WXPSRCDIR = "~/MyStuff/wxPython-2.1.15/src"
|
||||||
|
|
||||||
|
|
||||||
|
4. At this point you may want to make an alias, symlink, script,
|
||||||
|
batch file, or whatever on the PATH that invokes
|
||||||
|
$WXWIN/utils/wxPython/distrib/build.py to help simplify matters
|
||||||
|
somewhat. For example, on my win32 system I have a file named
|
||||||
|
build.bat in a directory on the PATH that contains:
|
||||||
|
|
||||||
|
python %WXWIN%/utils/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6
|
||||||
|
|
||||||
|
|
||||||
|
5. Change into the $(WXWIN)/utils/wxPython/src directory.
|
||||||
|
|
||||||
|
|
||||||
|
6. If you don't use SWIG, or don't have a new enough version
|
||||||
|
installed, you may have to update the timestamps of the files it
|
||||||
|
generates so the make utility won't think they are out of date and
|
||||||
|
try to run SWIG to update them. The standard touch utility can do
|
||||||
|
this for you:
|
||||||
|
|
||||||
|
touch gtk/*.cpp gtk/*.py
|
||||||
|
or
|
||||||
|
touch msw\*.cpp msw\*.py
|
||||||
|
|
||||||
|
|
||||||
|
7. Type "build -b" to build wxPython and "build -i" to install it.
|
||||||
|
|
||||||
|
The build.py script actually generates a Makefile based on what it
|
||||||
|
finds on your system and information found in the build.cfg file.
|
||||||
|
If you have troubles building or you want it built or installed in
|
||||||
|
a different way, take a look at the doc-string in build.py. You may
|
||||||
|
be able to override configuration options in a file named
|
||||||
|
build.local. For example, you can set a new TARGETDIR (the
|
||||||
|
installation directory) just by creating a file named build.local
|
||||||
|
in your wxPython source directory and assign a value to it, like
|
||||||
|
this:
|
||||||
|
|
||||||
|
TARGETDIR = "/usr/local/lib/python1.5/site-packages/wxPython"
|
||||||
|
|
||||||
|
The build.local file is executed as Python code so you can do very
|
||||||
|
creative things there if you need to.
|
||||||
|
|
||||||
|
|
||||||
|
8. To build and install the add-on modules, change to the appropriate
|
||||||
|
directory under $WXWIN/utils/wxPython/modules and run the build
|
||||||
|
utility again.
|
||||||
|
|
||||||
|
|
||||||
|
9. Change to the $WXWIN/utils/wxPython/demo directory.
|
||||||
|
|
||||||
|
|
||||||
|
10. Try executing the demo program. For example:
|
||||||
|
|
||||||
|
python demo.py
|
||||||
|
|
||||||
|
To run it without requiring a console on win32, you can use the
|
||||||
|
pythonw.exe version of Python either from the command line or from
|
||||||
|
a shortcut.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
624
wxPython/CHANGES.txt
Normal file
@@ -0,0 +1,624 @@
|
|||||||
|
CHANGES.txt for wxPython
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
New in 2.1.??
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Added an attribute named labelDelta to the generic buttons that
|
||||||
|
specifies how far to offset the label when the button is in the
|
||||||
|
depressed state.
|
||||||
|
|
||||||
|
Added wxTipProvider and friends. See the demo for an example.
|
||||||
|
|
||||||
|
wxGrid can now change the cell highlight colour.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
New in 2.1.15
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Fixed wxTreeCtrl.HitTest to return both the tree item as well as the
|
||||||
|
flags that clairify where the click was in relation to the item.
|
||||||
|
|
||||||
|
Fixed thread state problem in wxTreeCtrl.GetBoundingBox and
|
||||||
|
GetSelections.
|
||||||
|
|
||||||
|
Fixed some problems in OGL. Also wxShape.SetClientData and
|
||||||
|
.GetClientData can now deal with Python objects.
|
||||||
|
|
||||||
|
Added wxListCtrl.SortItems and changed the demo to show how to use it.
|
||||||
|
|
||||||
|
Plugged a memory leak.
|
||||||
|
|
||||||
|
Wrapped the new wxGrid and friends. The old wxGrid class is no longer
|
||||||
|
available. There are some incompatibilities, and unfortunately the
|
||||||
|
new classes are not documented yet, (however the methods are more
|
||||||
|
consistent with each other now so you may be able to guess pretty
|
||||||
|
good...)
|
||||||
|
|
||||||
|
Updated filebrowsebutton.py and calendar.py with changes from their
|
||||||
|
authors. There is now a FileBrowseButtonWithhistory class (what a
|
||||||
|
mouthful!) and wxCalendar has printing support.
|
||||||
|
|
||||||
|
Added ActiveXWrapper to the library, and some good demos of it too.
|
||||||
|
It works great for embedding a COM (a.k.a OCX, a.k.a Activex) control
|
||||||
|
in a window and calling its methods. It actually creates a new class
|
||||||
|
on the fly that derives from wxWindow, the COM CoClass and others
|
||||||
|
needed to make it all work. The resulting class can be instantiated
|
||||||
|
just like wxWindow, used in sizers, etc. It also responds to all COM
|
||||||
|
method calls, properties, etc., and if the class or a mix-in has
|
||||||
|
matching method names, then the COM events will be propogated back to
|
||||||
|
them.
|
||||||
|
|
||||||
|
Created a typemap that allows a string to be used for parameters
|
||||||
|
expecting a wxColour type. The string is either a colour name as
|
||||||
|
defined in the wxColourDatabase, or a colour spec of the form
|
||||||
|
"#RRGGBB". See the wxStyledTextCtrl demo for an example.
|
||||||
|
|
||||||
|
I almost forgot to mention the wxStyledTextCtrl! Yes, the
|
||||||
|
wxStyledTextCtrl is finally in wxPython!! (And the crowd goes
|
||||||
|
wild...) There's no documentaTion yet (the crowd boos and hisses...)
|
||||||
|
but I've included a very readable source file in the
|
||||||
|
wxPython/demo/data directory, a couple fairly good examples, and you
|
||||||
|
can also refer to the Scintilla documentaion at
|
||||||
|
http://www.scintilla.org/ScintillaDoc.html to help fill in the gaps
|
||||||
|
until the docs are done. (The croud murmers contentedly as the tool
|
||||||
|
provider smiles convincingly and removes his flame-proof suit.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1.13
|
||||||
|
--------------------
|
||||||
|
Skipped a version number to match what has been released for wxGTK.
|
||||||
|
|
||||||
|
Updated wxMVCTree and added a demo for it, also fixed layout on GTK
|
||||||
|
and some flicker problems.
|
||||||
|
|
||||||
|
Added a wrapper class for the Visualization ToolKit (or VTK) in the
|
||||||
|
wxPython.lib.vtk module. (http://www.kitware.com/)
|
||||||
|
|
||||||
|
Fixed wxTreeCtrl.SetItemImage and GetItemImage to recognise the new
|
||||||
|
"which" parameter.
|
||||||
|
|
||||||
|
Added wxPython.lib.spashscreen from Mike Fletcher.
|
||||||
|
|
||||||
|
Added wxPython.lib.filebrowsebutton also from Mike Fletcher.
|
||||||
|
|
||||||
|
Renamed wxTreeCtrl.GetParent to GetItemParent to avoid a name clash
|
||||||
|
with wxWindow.GetParent.
|
||||||
|
|
||||||
|
Added wxIntersectRect to compute the intersection of two wxRect's.
|
||||||
|
It is used like this:
|
||||||
|
|
||||||
|
intersect = wxIntersectRect(rect1, rect2)
|
||||||
|
|
||||||
|
If r1 and r2 don't intersect then None is returned, otherwise the
|
||||||
|
rectangle representing the intersection is returned.
|
||||||
|
|
||||||
|
Some bug fixes for Clipboard and Drag-n-Drop.
|
||||||
|
|
||||||
|
Rotated text!!! WooHoo! (See wxDC.DrawRotatedText())
|
||||||
|
|
||||||
|
Added a set of Generic Buttons to the library. These are simple
|
||||||
|
window classes that look and act like native buttons, but you can have
|
||||||
|
a bit more control over them. The bezel width can be set in addition
|
||||||
|
to colours, fonts, etc. There is a ToggleButton as well as Bitmap
|
||||||
|
versions too. They should also serve as a good example of how to
|
||||||
|
create your own classes derived from wxControl.
|
||||||
|
|
||||||
|
The C++ wxToolBar classes have been redone, and so have the wxPython
|
||||||
|
wrappers. There have been slight modifications to some of the methods
|
||||||
|
but shouldn't impact anybody too much. I took the opportunity to add
|
||||||
|
support for setting user data on each toolbar tool. The new AddTool
|
||||||
|
methods look like this:
|
||||||
|
|
||||||
|
def AddTool(ID,
|
||||||
|
bitmap,
|
||||||
|
pushedBitmap = wxNullBitmap,
|
||||||
|
toggle = FALSE,
|
||||||
|
clientData = NULL,
|
||||||
|
shortHelpString = "",
|
||||||
|
longHelpString = "")
|
||||||
|
|
||||||
|
def AddSimpleTool(ID,
|
||||||
|
bitmap,
|
||||||
|
shortHelpString = "",
|
||||||
|
longHelpString = "",
|
||||||
|
toggle=FALSE)
|
||||||
|
|
||||||
|
|
||||||
|
There are also coresponding InsertTool and InsertSimpleTool methods
|
||||||
|
that additionally take an integer position as the first parameter.
|
||||||
|
|
||||||
|
Added a wrapper for the new PCX and TIFF ImageHandlers.
|
||||||
|
|
||||||
|
wxRect now simulates attributes named left, right, top and bottom.
|
||||||
|
|
||||||
|
Removed all non wx stuff from the glcanvas module since DA's PyOpenGL
|
||||||
|
is better and compatible with the wxGLCanvas. You can get it at
|
||||||
|
http://starship.python.net:9673/crew/da/Code/PyOpenGL.
|
||||||
|
|
||||||
|
Added some missing EVT_ functions.
|
||||||
|
|
||||||
|
Added Dirk Holtwic's editor classes to the wxPython.lib.editor
|
||||||
|
package.
|
||||||
|
|
||||||
|
Changed all the "LIST" parameter names to "choices" to match the docs.
|
||||||
|
|
||||||
|
More fixes for the wxFloatBar, and it now works on wxGTK even better
|
||||||
|
than wxMSW! (The feat is accomplished by using the wxTB_DOCKABLE
|
||||||
|
style flag instead of trying to float it ourselves.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1.11
|
||||||
|
--------------------
|
||||||
|
Skipped a few version numbers so wxMSW, wxGTK and wxPython are all
|
||||||
|
syncronized.
|
||||||
|
|
||||||
|
wxImage.SetData now makes a copy of the image data before giving it to
|
||||||
|
wxImage. I mistakenly thought that wxImage would copy the data
|
||||||
|
itself.
|
||||||
|
|
||||||
|
Fixed wxMSW's notebook so the pages get their size set as they are
|
||||||
|
being added. This should remove the need for our
|
||||||
|
wxNotebook.ResizeChildren hack.
|
||||||
|
|
||||||
|
wxPanels now support AutoLayout, and wxNotebooks and wxSplitterWindows
|
||||||
|
no longer tell their children to Layout() themselves. This will
|
||||||
|
probably only effect you if you have a wxWindow with AutoLayout inside
|
||||||
|
a notebook or splitter. If so, either change it to a wxPanel or add
|
||||||
|
an EVT_SIZE handler that calls Layout().
|
||||||
|
|
||||||
|
Fixed deadlock problem that happened when using threads.
|
||||||
|
|
||||||
|
Added new HTML printing classes.
|
||||||
|
|
||||||
|
Added wxWindow.GetHandle
|
||||||
|
|
||||||
|
Apparently wxMouseEvent.Position has been depreciated in wxWindows as
|
||||||
|
it is no longer available by default. You can use GetPositionTuple
|
||||||
|
(returning a tuple with x,y) instead, or GetPosition (returning a
|
||||||
|
wxPoint.)
|
||||||
|
|
||||||
|
Added wxPostEvent function that allows events to be posted and then
|
||||||
|
processed later. This is a thread-safe way to interact with the GUI
|
||||||
|
thread from other threads.
|
||||||
|
|
||||||
|
Added Clipboard and Drag-and-Drop classes.
|
||||||
|
|
||||||
|
Added wxFontEnumerator.
|
||||||
|
|
||||||
|
Many updates to wxMenu, wxMenuBar.
|
||||||
|
|
||||||
|
wxPyEvent and wxPyCommandEvent derived classes now give you the actual
|
||||||
|
Python object in the event handler instead of a new shadow.
|
||||||
|
|
||||||
|
Added a Calendar widget from Lorne White to the library.
|
||||||
|
|
||||||
|
Made some fixes to the wxFloatbar. It still has some troubles on
|
||||||
|
wxGTK...
|
||||||
|
|
||||||
|
Added an MVC tree control from Bryn Keller to the library.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1.5
|
||||||
|
-------------------
|
||||||
|
This is a quick bug-fix release to take care of a few nasties that
|
||||||
|
crept in at the last minute before 2.1.4 was called done. No new
|
||||||
|
major features.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1.4
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
This release is NOT syncronized with a snapshot release of wxGTK or
|
||||||
|
wxMSW. For MSW this isn't much of a problem since you can get the
|
||||||
|
binaries from the web site. For other platforms you'll have to build
|
||||||
|
wxGTK from CVS. (See http://web.ukonline.co.uk/julian.smart/wxwin/cvs.htm)
|
||||||
|
To get the same set of sources from CVS that I used, checkout using
|
||||||
|
the wxPy-2-1-4 tag.
|
||||||
|
|
||||||
|
Now back to what's new...
|
||||||
|
|
||||||
|
Much more support for event-less callbacks and add-on modules.
|
||||||
|
|
||||||
|
Created add-on module with wxOGL classes.
|
||||||
|
|
||||||
|
Added wxWindow.GetChildren(). Be careful of this. It returns a *copy*
|
||||||
|
of the list of the window's children. While you are using the list if
|
||||||
|
anything changes in the real list (a child is deleted, etc.) then the
|
||||||
|
list you are holding will suddenly have window references to garbage
|
||||||
|
memory and your app will likely crash. But if you are careful it works
|
||||||
|
great!
|
||||||
|
|
||||||
|
Added a bunch of new and missing methods to wxTreeCrtl. The
|
||||||
|
SortChildren method is now supported, but currently only for the
|
||||||
|
default sort order.
|
||||||
|
|
||||||
|
Added typemaps for wxSize, wxPoint, wxRealPoint, and wxRect that allow
|
||||||
|
either the actual objects or Python sequence values to be used. For
|
||||||
|
example, the following are equivallent:
|
||||||
|
|
||||||
|
win = wxWindow(parent, size = wxSize(100, 100))
|
||||||
|
win = wxWindow(parent, size = (100, 100))
|
||||||
|
|
||||||
|
Super-charged the wxHtml module. You can now create your own tag
|
||||||
|
handlers and also have access to the parser and cell classes. There
|
||||||
|
is a tag handler in the library at wxPython.lib.wxpTag that
|
||||||
|
understands the WXP tag and is able to place wxPython windows on HTML
|
||||||
|
pages. See the demo for an example.
|
||||||
|
|
||||||
|
A bunch of the methods of wxMenuBar were previously ifdef'd out for
|
||||||
|
wxGTK. Added them back in since the methods exist now.
|
||||||
|
|
||||||
|
Wrapped the wxHtmlHelpController and related classes.
|
||||||
|
|
||||||
|
Wrapped the C++ versions of wxSizer and friends. The Python-only
|
||||||
|
versions are still in the library, but depreciated. (You will get a
|
||||||
|
warning message if you try to use them, but the warning can be
|
||||||
|
disabled.) The usage of the C++ versions is slightly different, and
|
||||||
|
the functionality of wxBorderSizer is now part of wxBoxSizer. I have
|
||||||
|
added a few methods to wxSizer to try and make the transition as
|
||||||
|
smooth as possible, I combined all Add methods into a single method
|
||||||
|
that handles all cases, added an AddMany method, etc. One step I did
|
||||||
|
not take was to make the default value of flag in the Add method be
|
||||||
|
wxGROW. This would have made it more backward compatible, but less
|
||||||
|
portable to and from wxWin C++ code. Please see the docs and demo for
|
||||||
|
further details.
|
||||||
|
|
||||||
|
Added wxPyEvent and wxPyCommandEvent classes, derived from wxEvent and
|
||||||
|
wxCommandEvent. Each of them has SetPyData and GetPyData methods that
|
||||||
|
accept or return a single Python object. You can use these classes
|
||||||
|
directly or derive from them to create your own types of event objects
|
||||||
|
that can pass through the wxWindows event system without loosing their
|
||||||
|
Python parts (as long as they are stored with SetPyData.) Stay tuned
|
||||||
|
for more info and examples in future releases.
|
||||||
|
|
||||||
|
Added wxPython.lib.grids as an example of how to derive a new sizer
|
||||||
|
from the C++ sizers. In this module you will find wxGridSizer and
|
||||||
|
wxFlexGridSizer. wxGridSizer arrainges its items in a grid in which
|
||||||
|
all the widths and heights are the same. wxFlexgridSizer allows
|
||||||
|
different widths and heights, and you can also specify rows and/or
|
||||||
|
columns that are growable. See the demo for a couple examples for how
|
||||||
|
to use them.
|
||||||
|
|
||||||
|
Added the wxValidator class, and created a class named wxPyValidator
|
||||||
|
that should be used for the base class of any Python validators. See
|
||||||
|
the demo for an example. Please note that you MUST implement a Clone
|
||||||
|
method in your validator classes because of the way some things work
|
||||||
|
in the underlying C++ library. I did not add wxTextValidator because
|
||||||
|
of some issues of how it transfers data to and from a wxString, which
|
||||||
|
in wxPython is automatically translated to and from Python strings, so
|
||||||
|
there would never be a concrete wxString that would hang around long
|
||||||
|
enough for the validator to do its job. On the other hand, it should
|
||||||
|
be real easy to duplicate the functionality of wxTextValidator in a
|
||||||
|
pure Python class derived from wxPyValidator.
|
||||||
|
|
||||||
|
I've finally added a feature that has been on my list for close to two
|
||||||
|
years! Ever wondered what that zero is for when you create your app
|
||||||
|
object? Well now you can leave it out or explicitly set it to a true
|
||||||
|
value. This value now controls what is to be done with sys.stdout and
|
||||||
|
sys.stderr. A false value leaves them alone, and a true value sets
|
||||||
|
them to an instance of wxPyOnDemandOutputWindow. (On windows the
|
||||||
|
default is true, on unix platforms the default is false.) This class
|
||||||
|
creates a frame containing a wxTextCtrl as soon as anything is written
|
||||||
|
to sys.stdout or sys.stderr. If you close the window it will come
|
||||||
|
back again the next time something is written. (You can call
|
||||||
|
app.RestoreStdio to turn this off.) If you would rather that the stdio be
|
||||||
|
redirected to a file, you can provide a second parameter to your app
|
||||||
|
object's constructor that is a filename. If you want to use your own
|
||||||
|
class instead of wxPyOnDemandOutputWindow you can either implement
|
||||||
|
RedirectStdio() in you app class or change the value of
|
||||||
|
wxApp.outputWindowClass like this:
|
||||||
|
|
||||||
|
class MyApp(wxApp):
|
||||||
|
outputWindowClass = MyClass
|
||||||
|
|
||||||
|
def OnInit(self):
|
||||||
|
frame = MyFrame()
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
return true
|
||||||
|
|
||||||
|
Please see the implementation of wxPyOnDemandOutputWindow and wxApp in
|
||||||
|
wx.py for more details. A few words of caution: if you are running
|
||||||
|
your app in a debugger, changing sys.stdout and sys.stderr is likely
|
||||||
|
to really screw things up.
|
||||||
|
|
||||||
|
Added wxCaret. Unfortunately it's author has still not documented it
|
||||||
|
in the wxWindows docs...
|
||||||
|
|
||||||
|
Some new 3rd party contributions in wxPython.lib. PyShell, in
|
||||||
|
shell.py is an interesting implementaion of an interactive Python
|
||||||
|
shell in wxWindows. floatbar.py has a class derived from wxToolBar
|
||||||
|
that can sense mouse drags and then reparent itself into another
|
||||||
|
frame. Moving the new frame close to where it came from puts the tool
|
||||||
|
bar back into the original parent. (Unfortunately there is currently
|
||||||
|
a bug in wxGTK's wxFrame.SetToolBar so the FloatBar has some
|
||||||
|
problems...)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1b3
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
This release is syncronized with release 2.1 snapshot 9 of wxWindows.
|
||||||
|
|
||||||
|
Switched to using SWIG from CVS (see http://swig.cs.uchicago.edu/cvs.html)
|
||||||
|
for some of the new features and such. Also they have encorporated my
|
||||||
|
patches so there is really no reason to stick with the current (very
|
||||||
|
old) release... This version of SWIG gives the following new
|
||||||
|
features:
|
||||||
|
|
||||||
|
1. Keyword arguments. You no longer have to specify all the
|
||||||
|
parameters with defaults to a method just to specify a
|
||||||
|
non-default value on the end. You can now do this instead:
|
||||||
|
|
||||||
|
win = wxWindow(parent, -1, style = mystyle)
|
||||||
|
|
||||||
|
2. There is now an an equivalence between Python's None and C++'s
|
||||||
|
NULL. This means that any methods that might return NULL will
|
||||||
|
now return None and you can use none where wxWindows might be
|
||||||
|
expecting NULL. This makes things much more snake-ish.
|
||||||
|
|
||||||
|
|
||||||
|
There is a new build system based on a new Python program instead of
|
||||||
|
raw makefiles. Now wxPython builds are virtually the same on MSW or
|
||||||
|
Unix systems. See the end of this file for new build instructions and
|
||||||
|
see distrib/build.py for more details.
|
||||||
|
|
||||||
|
wxDC.Bilt now includes the useMask parameter, and has been split into
|
||||||
|
two different versions. wxDC.BlitXY is like what was there before and
|
||||||
|
takes raw coordinants and sizes, and the new wxDC.Blit is for the new
|
||||||
|
interface using wxPoints and a wxSize.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1b2
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Added the missing wxWindow.GetUpdateRegion() method.
|
||||||
|
|
||||||
|
Made a new change in SWIG (update your patches everybody) that
|
||||||
|
provides a fix for global shadow objects that get an exception in
|
||||||
|
their __del__ when their extension module has already been deleted.
|
||||||
|
It was only a 1 line change in .../SWIG/Modules/pycpp.cxx at about
|
||||||
|
line 496 if you want to do it by hand.
|
||||||
|
|
||||||
|
It is now possible to run through MainLoop more than once in any one
|
||||||
|
process. The cleanup that used to happen as MainLoop completed (and
|
||||||
|
prevented it from running again) has been delayed until the wxc module
|
||||||
|
is being unloaded by Python.
|
||||||
|
|
||||||
|
I fixed a bunch of stuff in the C++ version of wxGrid so it wouldn't
|
||||||
|
make wxPython look bad.
|
||||||
|
|
||||||
|
wxWindow.PopupMenu() now takes a wxPoint instead of x,y. Added
|
||||||
|
wxWindow.PopupMenuXY to be consistent with some other methods.
|
||||||
|
|
||||||
|
Added wxGrid.SetEditInPlace and wxGrid.GetEditInPlace.
|
||||||
|
|
||||||
|
You can now provide your own app.MainLoop method. See
|
||||||
|
wxPython/demo/demoMainLoop.py for an example and some explaination.
|
||||||
|
|
||||||
|
Got the in-place-edit for the wxTreeCtrl fixed and added some demo
|
||||||
|
code to show how to use it.
|
||||||
|
|
||||||
|
Put the wxIcon constructor back in for GTK as it now has one that
|
||||||
|
matches MSW's.
|
||||||
|
|
||||||
|
Added wxGrid.GetCells
|
||||||
|
|
||||||
|
Added wxSystemSettings static methods as functions with names like
|
||||||
|
wxSystemSettings_GetSystemColour.
|
||||||
|
|
||||||
|
Removed wxPyMenu since using menu callbacks have been depreciated in
|
||||||
|
wxWindows. Use wxMenu and events instead.
|
||||||
|
|
||||||
|
Added alternate wxBitmap constructor (for MSW only) as
|
||||||
|
wxBitmapFromData(data, type, width, height, depth = 1)
|
||||||
|
|
||||||
|
Added a helper function named wxPyTypeCast that can convert shadow
|
||||||
|
objects of one type into shadow objects of another type. (Like doing
|
||||||
|
a down-cast.) See the implementation in wx.py for some docs.
|
||||||
|
|
||||||
|
Fixed wxImage GetData and SetData to properly use String objects for
|
||||||
|
data transfer.
|
||||||
|
|
||||||
|
Added access methods to wxGridEvent.
|
||||||
|
|
||||||
|
New Makefile/Setup files supporting multiple dynamic extension modules
|
||||||
|
for unix systems.
|
||||||
|
|
||||||
|
Fixes for the wxGLCanvas demo to work around a strange bug in gtk.
|
||||||
|
|
||||||
|
SWIG support routines now compiled separately instead of being bundled
|
||||||
|
in wx.cpp.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.1b1
|
||||||
|
--------------------
|
||||||
|
Fixed wxComboBox.SetSelection so that it actually sets the selected
|
||||||
|
item. (Actually just removed it from wxPython and let it default to
|
||||||
|
wxChoice.SetSelection which was already doing the right thing.)
|
||||||
|
|
||||||
|
Added the Printing Framework.
|
||||||
|
|
||||||
|
Switched back to using the wxWindows DLL for the pre-built Win32
|
||||||
|
version. The problem was needing to reinitialize static class info
|
||||||
|
data after loading each extension module.
|
||||||
|
|
||||||
|
Lots of little tweaks and additions to reflect changes to various
|
||||||
|
wxWindows classes.
|
||||||
|
|
||||||
|
Fixed a bug with attaching objects to tree items. Actually was a
|
||||||
|
symptom of a larger problem with not obtaining the interpreter lock
|
||||||
|
when doing any Py_DECREFs.
|
||||||
|
|
||||||
|
wxSizer and friends. Sizers are layout tools that manage a colection
|
||||||
|
of windows and sizers. Different types of sizers apply different
|
||||||
|
types of layout algorithms. You saw it here first! These classes are
|
||||||
|
not even in the wxWindows C++ library yet!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.0b9
|
||||||
|
-------------------
|
||||||
|
Bug fix for ListCtrl in test4.py (Was a missing file... DSM!)
|
||||||
|
|
||||||
|
Bug fix for occassional GPF on Win32 systems upon termination of a
|
||||||
|
wxPython application.
|
||||||
|
|
||||||
|
Added wxListBox.GetSelections returning selections as a Tuple.
|
||||||
|
|
||||||
|
Added a wxTreeItemData that is able to hold any Python object and be
|
||||||
|
associated with items in a wxTreeCtrl. Added test pytree.py to show
|
||||||
|
this feature off.
|
||||||
|
|
||||||
|
Added wxSafeYield function.
|
||||||
|
|
||||||
|
OpenGL Canvas can be optionally compiled in to wxPython.
|
||||||
|
|
||||||
|
Awesome new Demo Framework for showing off wxPython and for learning
|
||||||
|
how it all works.
|
||||||
|
|
||||||
|
The pre-built Win32 version is no longer distributing the wxWindows
|
||||||
|
DLL. It is statically linked with the wxWindows library instead.
|
||||||
|
|
||||||
|
Added a couple missing items from the docs.
|
||||||
|
|
||||||
|
Added wxImage, wxImageHandler, wxPNGHandler, wxJPEGHandler,
|
||||||
|
wxGIFHandler and wxBMPHandler.
|
||||||
|
|
||||||
|
Added new methods to wxTextCtrl.
|
||||||
|
|
||||||
|
Fixed some problems with how SWIG was wrapping some wxTreeCtrl
|
||||||
|
methods.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.0b8
|
||||||
|
-------------------
|
||||||
|
Support for using Python threads in wxPython apps.
|
||||||
|
|
||||||
|
Several missing methods from various classes.
|
||||||
|
|
||||||
|
Various bug fixes.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.0b7
|
||||||
|
-------------------
|
||||||
|
Added DLG_PNT and DLG_SZE convienience methods to wxWindow class.
|
||||||
|
|
||||||
|
Added missing constructor and other methods for wxMenuItem.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.0b6
|
||||||
|
-------------------
|
||||||
|
Just a quickie update to fix the self-installer to be compatible with
|
||||||
|
Python 1.5.2b2's Registry settings.
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 2.0b5
|
||||||
|
-------------------
|
||||||
|
Well obviously the numbering scheme has changed. I did this to
|
||||||
|
reflect the fact that this truly is the second major revision of
|
||||||
|
wxPython, (well the third actually if you count the one I did for
|
||||||
|
wxWindows 1.68 and then threw away...) and also that it is associated
|
||||||
|
with the 2.0 version of wxWindows.
|
||||||
|
|
||||||
|
I have finally started documenting wxPython. There are several pages
|
||||||
|
in the wxWindows documentation tree specifically about wxPython, and I
|
||||||
|
have added notes within the class references about where and how wxPython
|
||||||
|
diverges from wxWindows.
|
||||||
|
|
||||||
|
Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
|
||||||
|
window handle. If you can get the window handle into the python code,
|
||||||
|
it should just work... More news on this later.
|
||||||
|
|
||||||
|
Added wxImageList, wxToolTip.
|
||||||
|
|
||||||
|
Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
|
||||||
|
wxRegConfig class.
|
||||||
|
|
||||||
|
As usual, some bug fixes, tweaks, etc.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 0.5.3
|
||||||
|
-------------------
|
||||||
|
Added wxSashWindow, wxSashEvent, wxLayoutAlgorithm, etc.
|
||||||
|
|
||||||
|
Various cleanup, tweaks, minor additions, etc. to maintain
|
||||||
|
compatibility with the current wxWindows.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 0.5.0
|
||||||
|
-------------------
|
||||||
|
Changed the import semantics from "from wxPython import *" to "from
|
||||||
|
wxPython.wx import *" This is for people who are worried about
|
||||||
|
namespace pollution, they can use "from wxPython import wx" and then
|
||||||
|
prefix all the wxPython identifiers with "wx."
|
||||||
|
|
||||||
|
Added wxTaskbarIcon for wxMSW.
|
||||||
|
|
||||||
|
Made the events work for wxGrid.
|
||||||
|
|
||||||
|
Added wxConfig.
|
||||||
|
|
||||||
|
Added wxMiniFrame for wxGTK.
|
||||||
|
|
||||||
|
Changed many of the args and return values that were pointers to gdi
|
||||||
|
objects to references to reflect changes in the wxWindows API.
|
||||||
|
|
||||||
|
Other assorted fixes and additions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 0.4.2
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
wxPython on wxGTK works!!! Both dynamic and static on Linux and
|
||||||
|
static on Solaris have been tested. Many thanks go to Harm
|
||||||
|
<H.v.d.Heijden@phys.tue.nl> for his astute detective work on tracking
|
||||||
|
down a nasty DECREF bug. Okay so I have to confess that it was just a
|
||||||
|
DSM (Dumb Stupid Mistake) on my part but it was nasty none the less
|
||||||
|
because the behavior was so different on different platforms.
|
||||||
|
|
||||||
|
The dynamicly loaded module on Solaris is still segfaulting, so it
|
||||||
|
must have been a different issue all along...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
What's New in 0.4
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
1. Worked on wxGTK compatibility. It is partially working. On a
|
||||||
|
Solaris/Sparc box wxPython is working but only when it is statically
|
||||||
|
linked with the Python interpreter. When built as a dyamically loaded
|
||||||
|
extension module, things start acting weirdly and it soon seg-faults.
|
||||||
|
And on Linux both the statically linked and the dynamically linked
|
||||||
|
version segfault shortly after starting up.
|
||||||
|
|
||||||
|
2. Added Toolbar, StatusBar and SplitterWindow classes.
|
||||||
|
|
||||||
|
3. Varioius bug fixes, enhancements, etc.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
84
wxPython/README.txt
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
wxPython README
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Welcome to the wonderful world of wxPython!
|
||||||
|
|
||||||
|
Once you have installed the wxPython extension module, you can try it
|
||||||
|
out by going to the [install dir]\wxPython\demo directory and typing:
|
||||||
|
|
||||||
|
python demo.py
|
||||||
|
|
||||||
|
There are also some other sample files there for you to play with and
|
||||||
|
learn from.
|
||||||
|
|
||||||
|
If you selected to install the documentation then point your browser
|
||||||
|
to [install dir]\wxPython\docs\index.htm and you will then be looking
|
||||||
|
at the docs for wxWindows. For the most part you can use the C++ docs
|
||||||
|
as most classes and methods are used identically. Where there are
|
||||||
|
differences they are documented with a "wxPython Note."
|
||||||
|
|
||||||
|
On Win32 systems the binary self-installer creates a program group on
|
||||||
|
the Start Menu that contains a link to running the demo and a link to
|
||||||
|
the help file. To help you save disk space I'm now using Microsoft's
|
||||||
|
HTML Help format. If your system doesn't know what to do with the help
|
||||||
|
file, you can install the HTML Help Viewer as part of IE 4+, NT
|
||||||
|
Service Pack 4+, or the HTML Workshop at
|
||||||
|
|
||||||
|
http://msdn.microsoft.com/workshop/author/htmlhelp/download.asp.
|
||||||
|
|
||||||
|
For some features, the latest common controls library from microsoft
|
||||||
|
is required. You can get this by installing IE 5.0 or Office 2000.
|
||||||
|
You can also get it independently from here:
|
||||||
|
|
||||||
|
http://download.microsoft.com/download/platformsdk/Comctl32/5.80.2614.3600/W9XNT4/EN-US/50comupd.exe
|
||||||
|
|
||||||
|
Windows 95 users may also need the WinSock 2.0 and OpenGL libraries.
|
||||||
|
These can be found at these sites:
|
||||||
|
|
||||||
|
|
||||||
|
http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/default.asp
|
||||||
|
|
||||||
|
http://www.opengl.org/Downloads/Downloads.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Getting Help
|
||||||
|
------------
|
||||||
|
|
||||||
|
Since wxPython is a blending of multiple technologies, help comes from
|
||||||
|
multiple sources. See the http://alldunn.com/wxPython 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://wxwindows.org/mailman/listinfo/wxpython-users
|
||||||
|
|
||||||
|
Or you can send mail directly to the list using this address:
|
||||||
|
|
||||||
|
wxpython-users@wxwindows.org
|
||||||
|
|
||||||
|
|
||||||
|
Other Info
|
||||||
|
----------
|
||||||
|
|
||||||
|
Please also see the following files in this directory:
|
||||||
|
|
||||||
|
CHANGES.txt Information about new features, fixes, etc. in
|
||||||
|
each release.
|
||||||
|
|
||||||
|
BUILD.txt Instructions for building wxPython on various
|
||||||
|
platforms.
|
||||||
|
|
||||||
|
licence.txt Text of the wxWindows license.
|
||||||
|
|
||||||
|
|
||||||
|
----------------
|
||||||
|
Robin Dunn
|
||||||
|
robin@alldunn.com
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
wxPython/buildall
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd src
|
||||||
|
python ../distrib/build.py $*
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ../contrib
|
||||||
|
python buildall.py $*
|
||||||
|
cd ..
|
||||||
|
|
||||||
10
wxPython/buildall.bat
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
cd src
|
||||||
|
python ..\distrib\build.py %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
|
||||||
|
cd ..\contrib
|
||||||
|
python .\buildall.py %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
1
wxPython/contrib/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
update.log
|
||||||
3
wxPython/contrib/README
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
These sub directories contain add-on modules that are not part of the
|
||||||
|
core wxPython, either because of licensing issues, optional code in
|
||||||
|
wxWindows, contrib code in wxWindows, or whatever.
|
||||||
31
wxPython/contrib/buildall.py
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Name: buildall.py
|
||||||
|
# Purpose: Invokes the build script for all modules defined in
|
||||||
|
# MODULELIST
|
||||||
|
#
|
||||||
|
# Author: Robin Dunn
|
||||||
|
#
|
||||||
|
# Created: 18-Aug-1999
|
||||||
|
# RCS-ID: $Id$
|
||||||
|
# Copyright: (c) 1999 by Total Control Software
|
||||||
|
# Licence: wxWindows license
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import sys, os
|
||||||
|
sys.path.insert(0, '../distrib')
|
||||||
|
import build
|
||||||
|
|
||||||
|
MODULELIST = ['glcanvas', 'ogl', 'stc', ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for module in MODULELIST:
|
||||||
|
cwd = os.getcwd()
|
||||||
|
print "**** Building %s ****" % module
|
||||||
|
err = build.main(['../../distrib/build.py', '-C', module] + sys.argv[1:])
|
||||||
|
os.chdir(cwd)
|
||||||
|
if err:
|
||||||
|
break
|
||||||
|
|
||||||
|
sys.exit(err)
|
||||||
14
wxPython/contrib/glcanvas/.cvsignore
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
*.exp
|
||||||
|
*.lib
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
Makefile
|
||||||
|
Makefile.pre
|
||||||
|
Setup
|
||||||
|
build.local
|
||||||
|
config.c
|
||||||
|
glcanvas.h
|
||||||
|
glcanvasc.ilk
|
||||||
|
glcanvasc.pyd
|
||||||
|
sedscript
|
||||||
24
wxPython/contrib/glcanvas/build.cfg
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# -*- python -*-
|
||||||
|
import sys
|
||||||
|
|
||||||
|
MODULE = 'glcanvasc'
|
||||||
|
SWIGFILES = ['glcanvas.i', ]
|
||||||
|
|
||||||
|
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
# SOURCES = ['_glcanvas.cpp']
|
||||||
|
# OTHERLIBS = 'glu32.lib opengl32.lib'
|
||||||
|
# OTHERCFLAGS = '-DwxUSE_GLCANVAS=1'
|
||||||
|
# OTHERRULES = '''
|
||||||
|
#_glcanvas.cpp : $(WXDIR)\src\msw\glcanvas.cpp
|
||||||
|
# copy $(WXDIR)\src\msw\glcanvas.cpp _glcanvas.cpp
|
||||||
|
#'''
|
||||||
|
pass
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
print "Warning: Assuming MesaGL libraries. Override OTHERLIBS in build.local\n"\
|
||||||
|
" if you have native GL!"
|
||||||
|
OTHERLIBS = "-lwx_gtk_gl -lMesaGL -lMesaGLU"
|
||||||
|
|
||||||
|
|
||||||
108
wxPython/contrib/glcanvas/glcanvas.i
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: glcanvas.i
|
||||||
|
// Purpose: SWIG definitions for the OpenGL wxWindows classes
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 15-Mar-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
%module glcanvas
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include <wx/glcanvas.h>
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%extern windows.i
|
||||||
|
%extern windows2.i
|
||||||
|
%extern windows3.i
|
||||||
|
%extern frames.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern misc.i
|
||||||
|
%extern gdi.i
|
||||||
|
%extern controls.i
|
||||||
|
%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"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxPalette;
|
||||||
|
class wxWindow;
|
||||||
|
class wxSize;
|
||||||
|
class wxPoint;
|
||||||
|
class wxGLCanvas;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxGLContext {
|
||||||
|
public:
|
||||||
|
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
|
||||||
|
~wxGLContext();
|
||||||
|
|
||||||
|
void SetCurrent();
|
||||||
|
void SetColour(const char *colour);
|
||||||
|
void SwapBuffers();
|
||||||
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
void SetupPixelFormat();
|
||||||
|
void SetupPalette(const wxPalette& palette);
|
||||||
|
wxPalette CreateDefaultPalette();
|
||||||
|
wxPalette* GetPalette();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxWindow* GetWindow();
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxGLCanvas : public wxScrolledWindow {
|
||||||
|
public:
|
||||||
|
wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
|
||||||
|
const wxPoint& pos = wxPyDefaultPosition,
|
||||||
|
const wxSize& size = wxPyDefaultSize, long style = 0,
|
||||||
|
const char* name = "GLCanvas",
|
||||||
|
int *attribList = 0,
|
||||||
|
const wxPalette& palette = wxNullPalette);
|
||||||
|
|
||||||
|
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
|
||||||
|
|
||||||
|
void SetCurrent();
|
||||||
|
void SetColour(const char *colour);
|
||||||
|
void SwapBuffers();
|
||||||
|
|
||||||
|
wxGLContext* GetContext();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%init %{
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
2
wxPython/contrib/glcanvas/glcanvasc.def
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
EXPORTS
|
||||||
|
initglcanvasc
|
||||||
2
wxPython/contrib/glcanvas/gtk/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*~
|
||||||
|
_glcanvas.cpp
|
||||||
1140
wxPython/contrib/glcanvas/gtk/glcanvas.cpp
Normal file
117
wxPython/contrib/glcanvas/gtk/glcanvas.py
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import glcanvasc
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
import wx
|
||||||
|
class wxGLContextPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self,glcanvasc=glcanvasc):
|
||||||
|
if self.thisown == 1 :
|
||||||
|
glcanvasc.delete_wxGLContext(self)
|
||||||
|
def SetCurrent(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SetCurrent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SwapBuffers(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SwapBuffers,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetupPixelFormat(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SetupPixelFormat,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetupPalette(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SetupPalette,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CreateDefaultPalette(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_CreateDefaultPalette,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPalettePtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def GetPalette(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_GetPalette,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPalettePtr(val)
|
||||||
|
return val
|
||||||
|
def GetWindow(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_GetWindow,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxWindowPtr(val)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxGLContext instance at %s>" % (self.this,)
|
||||||
|
class wxGLContext(wxGLContextPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(glcanvasc.new_wxGLContext,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxGLCanvasPtr(wxScrolledWindowPtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def SetCurrent(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_SetCurrent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_SetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SwapBuffers(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_SwapBuffers,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetContext(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_GetContext,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxGLContextPtr(val)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxGLCanvas instance at %s>" % (self.this,)
|
||||||
|
class wxGLCanvas(wxGLCanvasPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
wx._StdWindowCallbacks(self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
1
wxPython/contrib/glcanvas/msw/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*~
|
||||||
1016
wxPython/contrib/glcanvas/msw/glcanvas.cpp
Normal file
103
wxPython/contrib/glcanvas/msw/glcanvas.py
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import glcanvasc
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
import wx
|
||||||
|
class wxGLContextPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self,glcanvasc=glcanvasc):
|
||||||
|
if self.thisown == 1 :
|
||||||
|
glcanvasc.delete_wxGLContext(self)
|
||||||
|
def SetCurrent(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SetCurrent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SwapBuffers(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_SwapBuffers,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetWindow(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLContext_GetWindow,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxWindowPtr(val)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxGLContext instance at %s>" % (self.this,)
|
||||||
|
class wxGLContext(wxGLContextPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(glcanvasc.new_wxGLContext,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxGLCanvasPtr(wxScrolledWindowPtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def SetCurrent(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_SetCurrent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_SetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SwapBuffers(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_SwapBuffers,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetContext(self, *_args, **_kwargs):
|
||||||
|
val = apply(glcanvasc.wxGLCanvas_GetContext,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxGLContextPtr(val)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxGLCanvas instance at %s>" % (self.this,)
|
||||||
|
class wxGLCanvas(wxGLCanvasPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
wx._StdWindowCallbacks(self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
5
wxPython/contrib/ogl/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Makefile
|
||||||
|
oglc.exp
|
||||||
|
oglc.ilk
|
||||||
|
oglc.pch
|
||||||
|
oglc.pyd
|
||||||
7
wxPython/contrib/ogl/README.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Since OGL is not always bundled with distributions of wxWindows, in
|
||||||
|
order for it to be a standard part of wxPython I need to bundle it
|
||||||
|
here. The contents of the contrib directory are copies of the
|
||||||
|
relevant parts of the main contrib directory in wxWindows. The
|
||||||
|
build.py script in this directory will also build the needed files
|
||||||
|
from there, so you no longer have to worry about aquiring and building
|
||||||
|
additional libraries beyond wxWindows itself.
|
||||||
36
wxPython/contrib/ogl/_extras.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
wxShapeCanvas = wxPyShapeCanvas
|
||||||
|
wxShapeEvtHandler = wxPyShapeEvtHandler
|
||||||
|
wxShape = wxPyShape
|
||||||
|
wxRectangleShape = wxPyRectangleShape
|
||||||
|
wxBitmapShape = wxPyBitmapShape
|
||||||
|
wxDrawnShape = wxPyDrawnShape
|
||||||
|
wxCompositeShape = wxPyCompositeShape
|
||||||
|
wxDividedShape = wxPyDividedShape
|
||||||
|
wxDivisionShape = wxPyDivisionShape
|
||||||
|
wxEllipseShape = wxPyEllipseShape
|
||||||
|
wxCircleShape = wxPyCircleShape
|
||||||
|
wxLineShape = wxPyLineShape
|
||||||
|
wxPolygonShape = wxPyPolygonShape
|
||||||
|
wxTextShape = wxPyTextShape
|
||||||
|
wxControlPoint = wxPyControlPoint
|
||||||
|
|
||||||
|
# Stuff these names into the wx namespace so wxPyConstructObject can find them
|
||||||
|
import wx
|
||||||
|
wx.wxPyShapeCanvasPtr = wxPyShapeCanvasPtr
|
||||||
|
wx.wxPyShapeEvtHandlerPtr = wxPyShapeEvtHandlerPtr
|
||||||
|
wx.wxPyShapePtr = wxPyShapePtr
|
||||||
|
wx.wxPyRectangleShapePtr = wxPyRectangleShapePtr
|
||||||
|
wx.wxPyBitmapShapePtr = wxPyBitmapShapePtr
|
||||||
|
wx.wxPyDrawnShapePtr = wxPyDrawnShapePtr
|
||||||
|
wx.wxPyCompositeShapePtr = wxPyCompositeShapePtr
|
||||||
|
wx.wxPyDividedShapePtr = wxPyDividedShapePtr
|
||||||
|
wx.wxPyDivisionShapePtr = wxPyDivisionShapePtr
|
||||||
|
wx.wxPyEllipseShapePtr = wxPyEllipseShapePtr
|
||||||
|
wx.wxPyCircleShapePtr = wxPyCircleShapePtr
|
||||||
|
wx.wxPyLineShapePtr = wxPyLineShapePtr
|
||||||
|
wx.wxPyPolygonShapePtr = wxPyPolygonShapePtr
|
||||||
|
wx.wxPyTextShapePtr = wxPyTextShapePtr
|
||||||
|
wx.wxShapeRegionPtr = wxShapeRegionPtr
|
||||||
|
wx.wxOGLConstraintPtr = wxOGLConstraintPtr
|
||||||
|
wx.wxControlPointPtr = wxPyControlPointPtr
|
||||||
63
wxPython/contrib/ogl/_ogldefs.i
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: _ogldefs.i
|
||||||
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 27-Aug-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class wxOGLConstraint;
|
||||||
|
class wxBitmapShape;
|
||||||
|
class wxDiagram;
|
||||||
|
class wxDrawnShape;
|
||||||
|
class wxCircleShape;
|
||||||
|
class wxCompositeShape;
|
||||||
|
class wxDividedShape;
|
||||||
|
class wxDivisionShape;
|
||||||
|
class wxEllipseShape;
|
||||||
|
class wxLineShape;
|
||||||
|
class wxPolygonShape;
|
||||||
|
class wxRectangleShape;
|
||||||
|
class wxPseudoMetaFile;
|
||||||
|
class wxShape;
|
||||||
|
class wxShapeCanvas;
|
||||||
|
class wxShapeEvtHandler;
|
||||||
|
class wxTextShape;
|
||||||
|
class wxControlPoint;
|
||||||
|
|
||||||
|
class wxPyOGLConstraint;
|
||||||
|
class wxPyBitmapShape;
|
||||||
|
class wxPyDiagram;
|
||||||
|
class wxPyDrawnShape;
|
||||||
|
class wxPyCircleShape;
|
||||||
|
class wxPyCompositeShape;
|
||||||
|
class wxPyDividedShape;
|
||||||
|
class wxPyDivisionShape;
|
||||||
|
class wxPyEllipseShape;
|
||||||
|
class wxPyLineShape;
|
||||||
|
class wxPyPolygonShape;
|
||||||
|
class wxPyRectangleShape;
|
||||||
|
class wxPyPseudoMetaFile;
|
||||||
|
class wxPyShape;
|
||||||
|
class wxPyShapeCanvas;
|
||||||
|
class wxPyShapeEvtHandler;
|
||||||
|
class wxPyTextShape;
|
||||||
|
class wxPyControlPoint;
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
52
wxPython/contrib/ogl/build.cfg
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# -*- python -*-
|
||||||
|
import sys
|
||||||
|
|
||||||
|
MODULE = 'oglc'
|
||||||
|
SWIGFILES = ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i', 'oglcanvas.i']
|
||||||
|
SOURCES = ['oglhelpers.cpp']
|
||||||
|
|
||||||
|
|
||||||
|
OTHERCFLAGS = '-I$(STCLOC)/contrib/include'
|
||||||
|
SOURCES = SOURCES + [
|
||||||
|
'$(STCLOC)/contrib/src/ogl/basic.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/bmpshape.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/composit.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/divided.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/lines.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/misc.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/basic2.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/canvas.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/constrnt.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/drawn.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/mfutils.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/ogl/ogldiag.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
OTHERDEFS = 'STCLOC = $(WXWIN)'
|
||||||
|
OTHERRULES = '''
|
||||||
|
{$(WXWIN)/contrib/src/ogl}.cpp{}.obj:
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $<
|
||||||
|
<<
|
||||||
|
'''
|
||||||
|
else:
|
||||||
|
OTHERCFLAGS = '-Icontrib/include'
|
||||||
|
DEFAULTRULE = 'default: contrib $(GENCODEDIR) $(TARGET)'
|
||||||
|
OTHERRULES = """
|
||||||
|
%.o : contrib/src/ogl/%.cpp
|
||||||
|
$(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
|
||||||
|
|
||||||
|
contrib :
|
||||||
|
ln -s $(WXWIN)/contrib contrib
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
SWIGDEPS = '_ogldefs.i'
|
||||||
|
OTHERDEPS = 'oglhelpers.h $(WXPSRCDIR)/helpers.h'
|
||||||
|
|
||||||
|
|
||||||
|
# There are no platform differences so we don't need separate code directories
|
||||||
|
GENCODEDIR='.'
|
||||||
|
SWIGTOOLKITFLAG=''
|
||||||
718
wxPython/contrib/ogl/ogl.cpp
Normal file
@@ -0,0 +1,718 @@
|
|||||||
|
/*
|
||||||
|
* FILE : ./ogl.cpp
|
||||||
|
*
|
||||||
|
* This file was automatically generated by :
|
||||||
|
* Simplified Wrapper and Interface Generator (SWIG)
|
||||||
|
* Version 1.1 (Build 810)
|
||||||
|
*
|
||||||
|
* Portions Copyright (c) 1995-1998
|
||||||
|
* The University of Utah and The Regents of the University of California.
|
||||||
|
* Permission is granted to distribute this file in any manner provided
|
||||||
|
* this notice remains intact.
|
||||||
|
*
|
||||||
|
* Do not make changes to this file--changes will be lost!
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SWIGCODE
|
||||||
|
/* Implementation : PYTHON */
|
||||||
|
|
||||||
|
#define SWIGPYTHON
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
/* 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
|
||||||
|
#include "Python.h"
|
||||||
|
extern void SWIG_MakePtr(char *, void *, char *);
|
||||||
|
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
|
||||||
|
extern char *SWIG_GetPtr(char *, void **, char *);
|
||||||
|
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
|
||||||
|
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
||||||
|
extern PyObject *SWIG_newvarlink(void);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#define SWIG_init initoglc
|
||||||
|
|
||||||
|
#define SWIG_name "oglc"
|
||||||
|
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "oglhelpers.h"
|
||||||
|
|
||||||
|
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
|
||||||
|
PyObject* o2;
|
||||||
|
PyObject* o3;
|
||||||
|
if (!target) {
|
||||||
|
target = o;
|
||||||
|
} else if (target == Py_None) {
|
||||||
|
Py_DECREF(Py_None);
|
||||||
|
target = o;
|
||||||
|
} else {
|
||||||
|
if (!PyList_Check(target)) {
|
||||||
|
o2 = target;
|
||||||
|
target = PyList_New(0);
|
||||||
|
PyList_Append(target, o2);
|
||||||
|
Py_XDECREF(o2);
|
||||||
|
}
|
||||||
|
PyList_Append(target,o);
|
||||||
|
Py_XDECREF(o);
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||||
|
PyObject* o2;
|
||||||
|
PyObject* o3;
|
||||||
|
|
||||||
|
if (!target) {
|
||||||
|
target = o;
|
||||||
|
} else if (target == Py_None) {
|
||||||
|
Py_DECREF(Py_None);
|
||||||
|
target = o;
|
||||||
|
} 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);
|
||||||
|
|
||||||
|
o2 = target;
|
||||||
|
target = PySequence_Concat(o2, o3);
|
||||||
|
Py_DECREF(o2);
|
||||||
|
Py_DECREF(o3);
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char* wxStringErrorMsg = "string type is required for parameter";
|
||||||
|
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
wxString wxPyEmptyStr("");
|
||||||
|
wxPoint wxPyDefaultPosition(-1, -1);
|
||||||
|
wxSize wxPyDefaultSize(-1, -1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern "C" SWIGEXPORT(void) initoglbasicc();
|
||||||
|
extern "C" SWIGEXPORT(void) initoglshapesc();
|
||||||
|
extern "C" SWIGEXPORT(void) initoglshapes2c();
|
||||||
|
extern "C" SWIGEXPORT(void) initoglcanvasc();
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
static PyObject *_wrap_wxOGLInitialize(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
char *_kwnames[] = { NULL };
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLInitialize",_kwnames))
|
||||||
|
return NULL;
|
||||||
|
{
|
||||||
|
wxPy_BEGIN_ALLOW_THREADS;
|
||||||
|
wxOGLInitialize();
|
||||||
|
|
||||||
|
wxPy_END_ALLOW_THREADS;
|
||||||
|
} Py_INCREF(Py_None);
|
||||||
|
_resultobj = Py_None;
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *_wrap_wxOGLCleanUp(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
char *_kwnames[] = { NULL };
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLCleanUp",_kwnames))
|
||||||
|
return NULL;
|
||||||
|
{
|
||||||
|
wxPy_BEGIN_ALLOW_THREADS;
|
||||||
|
wxOGLCleanUp();
|
||||||
|
|
||||||
|
wxPy_END_ALLOW_THREADS;
|
||||||
|
} Py_INCREF(Py_None);
|
||||||
|
_resultobj = Py_None;
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyMethodDef oglcMethods[] = {
|
||||||
|
{ "wxOGLCleanUp", (PyCFunction) _wrap_wxOGLCleanUp, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ "wxOGLInitialize", (PyCFunction) _wrap_wxOGLInitialize, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* This table is used by the pointer type-checker
|
||||||
|
*/
|
||||||
|
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||||
|
{ "_wxAcceleratorTable","_class_wxAcceleratorTable",0},
|
||||||
|
{ "_wxEvent","_class_wxEvent",0},
|
||||||
|
{ "_class_wxActivateEvent","_wxActivateEvent",0},
|
||||||
|
{ "_signed_long","_long",0},
|
||||||
|
{ "_wxMenuEvent","_class_wxMenuEvent",0},
|
||||||
|
{ "_class_wxJPEGHandler","_wxJPEGHandler",0},
|
||||||
|
{ "_wxPyBitmapDataObject","_class_wxPyBitmapDataObject",0},
|
||||||
|
{ "_wxBitmapDataObject","_class_wxBitmapDataObject",0},
|
||||||
|
{ "_class_wxPyCommandEvent","_wxPyCommandEvent",0},
|
||||||
|
{ "_wxBMPHandler","_class_wxBMPHandler",0},
|
||||||
|
{ "_wxImage","_class_wxImage",0},
|
||||||
|
{ "_wxPrintQuality","_wxCoord",0},
|
||||||
|
{ "_wxPrintQuality","_int",0},
|
||||||
|
{ "_wxPrintQuality","_signed_int",0},
|
||||||
|
{ "_wxPrintQuality","_unsigned_int",0},
|
||||||
|
{ "_wxPrintQuality","_wxWindowID",0},
|
||||||
|
{ "_wxPrintQuality","_uint",0},
|
||||||
|
{ "_wxPrintQuality","_EBool",0},
|
||||||
|
{ "_wxPrintQuality","_size_t",0},
|
||||||
|
{ "_class_wxCustomDataObject","_wxCustomDataObject",0},
|
||||||
|
{ "_wxFontData","_class_wxFontData",0},
|
||||||
|
{ "_class_wxRegionIterator","_wxRegionIterator",0},
|
||||||
|
{ "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0},
|
||||||
|
{ "_class_wxMenuBar","_wxMenuBar",0},
|
||||||
|
{ "_class_wxPyTreeItemData","_wxPyTreeItemData",0},
|
||||||
|
{ "_class_wxStaticBoxSizer","_wxStaticBoxSizer",0},
|
||||||
|
{ "_class_wxEvtHandler","_wxEvtHandler",0},
|
||||||
|
{ "_wxPaintEvent","_class_wxPaintEvent",0},
|
||||||
|
{ "_wxGIFHandler","_class_wxGIFHandler",0},
|
||||||
|
{ "_wxPySizer","_class_wxPySizer",0},
|
||||||
|
{ "_wxPyCompositeShape","_class_wxPyCompositeShape",0},
|
||||||
|
{ "_wxIndividualLayoutConstraint","_class_wxIndividualLayoutConstraint",0},
|
||||||
|
{ "_wxCursor","_class_wxCursor",0},
|
||||||
|
{ "_wxNotifyEvent","_class_wxNotifyEvent",0},
|
||||||
|
{ "_wxImageHandler","_class_wxImageHandler",0},
|
||||||
|
{ "_class_wxPyRectangleShape","_wxPyRectangleShape",0},
|
||||||
|
{ "_class_wxToolBarBase","_wxToolBarBase",0},
|
||||||
|
{ "_class_wxTreeCtrl","_wxTreeCtrl",0},
|
||||||
|
{ "_wxMask","_class_wxMask",0},
|
||||||
|
{ "_wxToolTip","_class_wxToolTip",0},
|
||||||
|
{ "_wxPNGHandler","_class_wxPNGHandler",0},
|
||||||
|
{ "_class_wxOGLConstraint","_wxOGLConstraint",0},
|
||||||
|
{ "_class_wxColourData","_wxColourData",0},
|
||||||
|
{ "_class_wxPageSetupDialogData","_wxPageSetupDialogData",0},
|
||||||
|
{ "_wxPrinter","_class_wxPrinter",0},
|
||||||
|
{ "_wxPseudoMetaFile","_class_wxPseudoMetaFile",0},
|
||||||
|
{ "_class_wxArrowHead","_wxArrowHead",0},
|
||||||
|
{ "_wxPen","_class_wxPen",0},
|
||||||
|
{ "_wxUpdateUIEvent","_class_wxUpdateUIEvent",0},
|
||||||
|
{ "_byte","_unsigned_char",0},
|
||||||
|
{ "_wxDataObject","_class_wxDataObject",0},
|
||||||
|
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
|
||||||
|
{ "_wxStaticBox","_class_wxStaticBox",0},
|
||||||
|
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
|
||||||
|
{ "_wxPyDropSource","_class_wxPyDropSource",0},
|
||||||
|
{ "_wxChoice","_class_wxChoice",0},
|
||||||
|
{ "_wxSlider","_class_wxSlider",0},
|
||||||
|
{ "_wxNotebookEvent","_class_wxNotebookEvent",0},
|
||||||
|
{ "_wxPyPrintout","_class_wxPyPrintout",0},
|
||||||
|
{ "_wxShapeRegion","_class_wxShapeRegion",0},
|
||||||
|
{ "_long","_unsigned_long",0},
|
||||||
|
{ "_long","_signed_long",0},
|
||||||
|
{ "_wxImageList","_class_wxImageList",0},
|
||||||
|
{ "_wxDataObjectSimple","_class_wxDataObjectSimple",0},
|
||||||
|
{ "_wxDropFilesEvent","_class_wxDropFilesEvent",0},
|
||||||
|
{ "_wxBitmapButton","_class_wxBitmapButton",0},
|
||||||
|
{ "_wxSashWindow","_class_wxSashWindow",0},
|
||||||
|
{ "_class_wxSizer","_wxSizer",0},
|
||||||
|
{ "_class_wxTIFFHandler","_wxTIFFHandler",0},
|
||||||
|
{ "_class_wxPrintDialogData","_wxPrintDialogData",0},
|
||||||
|
{ "_class_wxAcceleratorTable","_wxAcceleratorTable",0},
|
||||||
|
{ "_class_wxClipboard","_wxClipboard",0},
|
||||||
|
{ "_class_wxGauge","_wxGauge",0},
|
||||||
|
{ "_class_wxSashEvent","_wxSashEvent",0},
|
||||||
|
{ "_wxDC","_class_wxDC",0},
|
||||||
|
{ "_wxSizerItem","_class_wxSizerItem",0},
|
||||||
|
{ "_class_wxBitmapDataObject","_wxBitmapDataObject",0},
|
||||||
|
{ "_wxListEvent","_class_wxListEvent",0},
|
||||||
|
{ "_class_wxSingleChoiceDialog","_wxSingleChoiceDialog",0},
|
||||||
|
{ "_wxProgressDialog","_class_wxProgressDialog",0},
|
||||||
|
{ "_class_wxBMPHandler","_wxBMPHandler",0},
|
||||||
|
{ "_wxPrintPreview","_class_wxPrintPreview",0},
|
||||||
|
{ "_wxSpinEvent","_class_wxSpinEvent",0},
|
||||||
|
{ "_wxSashLayoutWindow","_class_wxSashLayoutWindow",0},
|
||||||
|
{ "_wxPyBitmapShape","_class_wxPyBitmapShape",0},
|
||||||
|
{ "_class_wxPyEllipseShape","_wxPyEllipseShape",0},
|
||||||
|
{ "_size_t","_wxCoord",0},
|
||||||
|
{ "_size_t","_wxPrintQuality",0},
|
||||||
|
{ "_size_t","_unsigned_int",0},
|
||||||
|
{ "_size_t","_int",0},
|
||||||
|
{ "_size_t","_wxWindowID",0},
|
||||||
|
{ "_size_t","_uint",0},
|
||||||
|
{ "_class_wxRealPoint","_wxRealPoint",0},
|
||||||
|
{ "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
|
||||||
|
{ "_wxPNMHandler","_class_wxPNMHandler",0},
|
||||||
|
{ "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
|
||||||
|
{ "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0},
|
||||||
|
{ "_class_wxMenuItem","_wxMenuItem",0},
|
||||||
|
{ "_class_wxPaintEvent","_wxPaintEvent",0},
|
||||||
|
{ "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0},
|
||||||
|
{ "_class_wxStatusBar","_wxStatusBar",0},
|
||||||
|
{ "_class_wxGIFHandler","_wxGIFHandler",0},
|
||||||
|
{ "_class_wxPySizer","_wxPySizer",0},
|
||||||
|
{ "_class_wxPyCompositeShape","_wxPyCompositeShape",0},
|
||||||
|
{ "_wxPyPolygonShape","_class_wxPyPolygonShape",0},
|
||||||
|
{ "_class_wxPostScriptDC","_wxPostScriptDC",0},
|
||||||
|
{ "_wxPanel","_class_wxPanel",0},
|
||||||
|
{ "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
|
||||||
|
{ "_wxCheckBox","_class_wxCheckBox",0},
|
||||||
|
{ "_wxPyEvent","_class_wxPyEvent",0},
|
||||||
|
{ "_wxTextCtrl","_class_wxTextCtrl",0},
|
||||||
|
{ "_class_wxMask","_wxMask",0},
|
||||||
|
{ "_wxTextDataObject","_class_wxTextDataObject",0},
|
||||||
|
{ "_class_wxKeyEvent","_wxKeyEvent",0},
|
||||||
|
{ "_class_wxToolTip","_wxToolTip",0},
|
||||||
|
{ "_class_wxPNGHandler","_wxPNGHandler",0},
|
||||||
|
{ "_wxColour","_class_wxColour",0},
|
||||||
|
{ "_class_wxDialog","_wxDialog",0},
|
||||||
|
{ "_wxBusyCursor","_class_wxBusyCursor",0},
|
||||||
|
{ "_wxPageSetupDialog","_class_wxPageSetupDialog",0},
|
||||||
|
{ "_class_wxPrinter","_wxPrinter",0},
|
||||||
|
{ "_class_wxFileDataObject","_wxFileDataObject",0},
|
||||||
|
{ "_wxIdleEvent","_class_wxIdleEvent",0},
|
||||||
|
{ "_class_wxUpdateUIEvent","_wxUpdateUIEvent",0},
|
||||||
|
{ "_wxToolBar","_class_wxToolBar",0},
|
||||||
|
{ "_class_wxDataObject","_wxDataObject",0},
|
||||||
|
{ "_wxCaret","_class_wxCaret",0},
|
||||||
|
{ "_wxStaticLine","_class_wxStaticLine",0},
|
||||||
|
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
|
||||||
|
{ "_wxBrush","_class_wxBrush",0},
|
||||||
|
{ "_wxMiniFrame","_class_wxMiniFrame",0},
|
||||||
|
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
|
||||||
|
{ "_class_wxPyPrintout","_wxPyPrintout",0},
|
||||||
|
{ "_wxDataFormat","_class_wxDataFormat",0},
|
||||||
|
{ "_class_wxDataObjectSimple","_wxDataObjectSimple",0},
|
||||||
|
{ "_class_wxSashWindow","_wxSashWindow",0},
|
||||||
|
{ "_wxShowEvent","_class_wxShowEvent",0},
|
||||||
|
{ "_class_wxPyDivisionShape","_wxPyDivisionShape",0},
|
||||||
|
{ "_uint","_wxCoord",0},
|
||||||
|
{ "_uint","_wxPrintQuality",0},
|
||||||
|
{ "_uint","_size_t",0},
|
||||||
|
{ "_uint","_unsigned_int",0},
|
||||||
|
{ "_uint","_int",0},
|
||||||
|
{ "_uint","_wxWindowID",0},
|
||||||
|
{ "_wxPyValidator","_class_wxPyValidator",0},
|
||||||
|
{ "_class_wxEvent","_wxEvent",0},
|
||||||
|
{ "_wxCheckListBox","_class_wxCheckListBox",0},
|
||||||
|
{ "_wxSplitterEvent","_class_wxSplitterEvent",0},
|
||||||
|
{ "_wxRect","_class_wxRect",0},
|
||||||
|
{ "_wxCommandEvent","_class_wxCommandEvent",0},
|
||||||
|
{ "_wxPyShapeCanvas","_class_wxPyShapeCanvas",0},
|
||||||
|
{ "_wxSizeEvent","_class_wxSizeEvent",0},
|
||||||
|
{ "_class_wxImage","_wxImage",0},
|
||||||
|
{ "_wxPoint","_class_wxPoint",0},
|
||||||
|
{ "_class_wxSashLayoutWindow","_wxSashLayoutWindow",0},
|
||||||
|
{ "_class_wxPyBitmapShape","_wxPyBitmapShape",0},
|
||||||
|
{ "_class_wxButton","_wxButton",0},
|
||||||
|
{ "_wxRadioBox","_class_wxRadioBox",0},
|
||||||
|
{ "_class_wxFontData","_wxFontData",0},
|
||||||
|
{ "_class_wxPNMHandler","_wxPNMHandler",0},
|
||||||
|
{ "_wxBoxSizer","_class_wxBoxSizer",0},
|
||||||
|
{ "_wxBitmap","_class_wxBitmap",0},
|
||||||
|
{ "_char","_wxDash",0},
|
||||||
|
{ "_wxPrintDialog","_class_wxPrintDialog",0},
|
||||||
|
{ "_wxPyControlPoint","_class_wxPyControlPoint",0},
|
||||||
|
{ "_wxPyTimer","_class_wxPyTimer",0},
|
||||||
|
{ "_wxWindowDC","_class_wxWindowDC",0},
|
||||||
|
{ "_wxScrollBar","_class_wxScrollBar",0},
|
||||||
|
{ "_wxSpinButton","_class_wxSpinButton",0},
|
||||||
|
{ "_wxColourDialog","_class_wxColourDialog",0},
|
||||||
|
{ "_wxPrintData","_class_wxPrintData",0},
|
||||||
|
{ "_class_wxIndividualLayoutConstraint","_wxIndividualLayoutConstraint",0},
|
||||||
|
{ "_class_wxNotifyEvent","_wxNotifyEvent",0},
|
||||||
|
{ "_wxMessageDialog","_class_wxMessageDialog",0},
|
||||||
|
{ "_class_wxValidator","_wxValidator",0},
|
||||||
|
{ "_class_wxPyEvent","_wxPyEvent",0},
|
||||||
|
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
|
||||||
|
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
|
||||||
|
{ "_class_wxStaticBitmap","_wxStaticBitmap",0},
|
||||||
|
{ "_class_wxPyDrawnShape","_wxPyDrawnShape",0},
|
||||||
|
{ "_class_wxBusyCursor","_wxBusyCursor",0},
|
||||||
|
{ "_wxToolBarSimple","_class_wxToolBarSimple",0},
|
||||||
|
{ "_wxMDIChildFrame","_class_wxMDIChildFrame",0},
|
||||||
|
{ "_wxListItem","_class_wxListItem",0},
|
||||||
|
{ "_class_wxPseudoMetaFile","_wxPseudoMetaFile",0},
|
||||||
|
{ "_class_wxToolBar","_wxToolBar",0},
|
||||||
|
{ "_wxDropTarget","_class_wxDropTarget",0},
|
||||||
|
{ "_class_wxStaticLine","_wxStaticLine",0},
|
||||||
|
{ "_wxScrollEvent","_class_wxScrollEvent",0},
|
||||||
|
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
|
||||||
|
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
|
||||||
|
{ "_class_wxShapeRegion","_wxShapeRegion",0},
|
||||||
|
{ "_EBool","_wxCoord",0},
|
||||||
|
{ "_EBool","_wxPrintQuality",0},
|
||||||
|
{ "_EBool","_signed_int",0},
|
||||||
|
{ "_EBool","_int",0},
|
||||||
|
{ "_EBool","_wxWindowID",0},
|
||||||
|
{ "_class_wxRegion","_wxRegion",0},
|
||||||
|
{ "_class_wxDataFormat","_wxDataFormat",0},
|
||||||
|
{ "_class_wxDropFilesEvent","_wxDropFilesEvent",0},
|
||||||
|
{ "_wxWindowDestroyEvent","_class_wxWindowDestroyEvent",0},
|
||||||
|
{ "_class_wxPreviewFrame","_wxPreviewFrame",0},
|
||||||
|
{ "_wxStaticText","_class_wxStaticText",0},
|
||||||
|
{ "_wxFont","_class_wxFont",0},
|
||||||
|
{ "_class_wxPyDropTarget","_wxPyDropTarget",0},
|
||||||
|
{ "_wxCloseEvent","_class_wxCloseEvent",0},
|
||||||
|
{ "_class_wxSplitterEvent","_wxSplitterEvent",0},
|
||||||
|
{ "_wxNotebook","_class_wxNotebook",0},
|
||||||
|
{ "_unsigned_long","_long",0},
|
||||||
|
{ "_class_wxRect","_wxRect",0},
|
||||||
|
{ "_class_wxDC","_wxDC",0},
|
||||||
|
{ "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
|
||||||
|
{ "_wxPyCircleShape","_class_wxPyCircleShape",0},
|
||||||
|
{ "_class_wxPyShapeCanvas","_wxPyShapeCanvas",0},
|
||||||
|
{ "_class_wxProgressDialog","_wxProgressDialog",0},
|
||||||
|
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
|
||||||
|
{ "_wxPyApp","_class_wxPyApp",0},
|
||||||
|
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
|
||||||
|
{ "_wxMDIParentFrame","_class_wxMDIParentFrame",0},
|
||||||
|
{ "_class_wxTreeEvent","_wxTreeEvent",0},
|
||||||
|
{ "_class_wxDirDialog","_wxDirDialog",0},
|
||||||
|
{ "_wxPyLineShape","_class_wxPyLineShape",0},
|
||||||
|
{ "_class_wxPyTimer","_wxPyTimer",0},
|
||||||
|
{ "_wxFocusEvent","_class_wxFocusEvent",0},
|
||||||
|
{ "_wxMaximizeEvent","_class_wxMaximizeEvent",0},
|
||||||
|
{ "_class_wxSpinButton","_wxSpinButton",0},
|
||||||
|
{ "_class_wxPyPolygonShape","_wxPyPolygonShape",0},
|
||||||
|
{ "_wxAcceleratorEntry","_class_wxAcceleratorEntry",0},
|
||||||
|
{ "_class_wxPanel","_wxPanel",0},
|
||||||
|
{ "_class_wxCheckBox","_wxCheckBox",0},
|
||||||
|
{ "_wxComboBox","_class_wxComboBox",0},
|
||||||
|
{ "_wxRadioButton","_class_wxRadioButton",0},
|
||||||
|
{ "_class_wxMessageDialog","_wxMessageDialog",0},
|
||||||
|
{ "_signed_int","_wxCoord",0},
|
||||||
|
{ "_signed_int","_wxPrintQuality",0},
|
||||||
|
{ "_signed_int","_EBool",0},
|
||||||
|
{ "_signed_int","_wxWindowID",0},
|
||||||
|
{ "_signed_int","_int",0},
|
||||||
|
{ "_class_wxTextCtrl","_wxTextCtrl",0},
|
||||||
|
{ "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
|
||||||
|
{ "_class_wxTextDataObject","_wxTextDataObject",0},
|
||||||
|
{ "_wxMenu","_class_wxMenu",0},
|
||||||
|
{ "_class_wxMoveEvent","_wxMoveEvent",0},
|
||||||
|
{ "_wxListBox","_class_wxListBox",0},
|
||||||
|
{ "_wxScreenDC","_class_wxScreenDC",0},
|
||||||
|
{ "_class_wxToolBarSimple","_wxToolBarSimple",0},
|
||||||
|
{ "_class_wxMDIChildFrame","_wxMDIChildFrame",0},
|
||||||
|
{ "_wxArrowHead","_class_wxArrowHead",0},
|
||||||
|
{ "_WXTYPE","_short",0},
|
||||||
|
{ "_WXTYPE","_signed_short",0},
|
||||||
|
{ "_WXTYPE","_unsigned_short",0},
|
||||||
|
{ "_wxFileDialog","_class_wxFileDialog",0},
|
||||||
|
{ "_class_wxDropTarget","_wxDropTarget",0},
|
||||||
|
{ "_class_wxCaret","_wxCaret",0},
|
||||||
|
{ "_class_wxMDIClientWindow","_wxMDIClientWindow",0},
|
||||||
|
{ "_class_wxBrush","_wxBrush",0},
|
||||||
|
{ "_unsigned_short","_WXTYPE",0},
|
||||||
|
{ "_unsigned_short","_short",0},
|
||||||
|
{ "_class_wxWindow","_wxWindow",0},
|
||||||
|
{ "_wxSplitterWindow","_class_wxSplitterWindow",0},
|
||||||
|
{ "_class_wxStaticText","_wxStaticText",0},
|
||||||
|
{ "_wxPrintDialogData","_class_wxPrintDialogData",0},
|
||||||
|
{ "_class_wxFont","_wxFont",0},
|
||||||
|
{ "_wxClipboard","_class_wxClipboard",0},
|
||||||
|
{ "_class_wxPyValidator","_wxPyValidator",0},
|
||||||
|
{ "_class_wxCloseEvent","_wxCloseEvent",0},
|
||||||
|
{ "_wxSashEvent","_class_wxSashEvent",0},
|
||||||
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
|
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
|
||||||
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
|
{ "_wxListCtrl","_class_wxListCtrl",0},
|
||||||
|
{ "_wxSingleChoiceDialog","_class_wxSingleChoiceDialog",0},
|
||||||
|
{ "_wxPyDividedShape","_class_wxPyDividedShape",0},
|
||||||
|
{ "_class_wxPoint","_wxPoint",0},
|
||||||
|
{ "_wxRealPoint","_class_wxRealPoint",0},
|
||||||
|
{ "_class_wxRadioBox","_wxRadioBox",0},
|
||||||
|
{ "_class_wxBoxSizer","_wxBoxSizer",0},
|
||||||
|
{ "_signed_short","_WXTYPE",0},
|
||||||
|
{ "_signed_short","_short",0},
|
||||||
|
{ "_wxMemoryDC","_class_wxMemoryDC",0},
|
||||||
|
{ "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
|
||||||
|
{ "_class_wxPrintDialog","_wxPrintDialog",0},
|
||||||
|
{ "_class_wxPyControlPoint","_wxPyControlPoint",0},
|
||||||
|
{ "_wxPaintDC","_class_wxPaintDC",0},
|
||||||
|
{ "_class_wxWindowDC","_wxWindowDC",0},
|
||||||
|
{ "_class_wxFocusEvent","_wxFocusEvent",0},
|
||||||
|
{ "_class_wxMaximizeEvent","_wxMaximizeEvent",0},
|
||||||
|
{ "_wxStatusBar","_class_wxStatusBar",0},
|
||||||
|
{ "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
|
||||||
|
{ "_class_wxCursor","_wxCursor",0},
|
||||||
|
{ "_wxPostScriptDC","_class_wxPostScriptDC",0},
|
||||||
|
{ "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
|
||||||
|
{ "_class_wxImageHandler","_wxImageHandler",0},
|
||||||
|
{ "_wxPyShape","_class_wxPyShape",0},
|
||||||
|
{ "_wxScrolledWindow","_class_wxScrolledWindow",0},
|
||||||
|
{ "_wxTreeItemId","_class_wxTreeItemId",0},
|
||||||
|
{ "_unsigned_char","_byte",0},
|
||||||
|
{ "_class_wxMenu","_wxMenu",0},
|
||||||
|
{ "_wxControl","_class_wxControl",0},
|
||||||
|
{ "_class_wxListBox","_wxListBox",0},
|
||||||
|
{ "_unsigned_int","_wxCoord",0},
|
||||||
|
{ "_unsigned_int","_wxPrintQuality",0},
|
||||||
|
{ "_unsigned_int","_size_t",0},
|
||||||
|
{ "_unsigned_int","_uint",0},
|
||||||
|
{ "_unsigned_int","_wxWindowID",0},
|
||||||
|
{ "_unsigned_int","_int",0},
|
||||||
|
{ "_wxIcon","_class_wxIcon",0},
|
||||||
|
{ "_wxDialog","_class_wxDialog",0},
|
||||||
|
{ "_class_wxListItem","_wxListItem",0},
|
||||||
|
{ "_class_wxPen","_wxPen",0},
|
||||||
|
{ "_class_wxFileDialog","_wxFileDialog",0},
|
||||||
|
{ "_wxQueryLayoutInfoEvent","_class_wxQueryLayoutInfoEvent",0},
|
||||||
|
{ "_short","_WXTYPE",0},
|
||||||
|
{ "_short","_unsigned_short",0},
|
||||||
|
{ "_short","_signed_short",0},
|
||||||
|
{ "_class_wxStaticBox","_wxStaticBox",0},
|
||||||
|
{ "_wxLayoutAlgorithm","_class_wxLayoutAlgorithm",0},
|
||||||
|
{ "_wxPyTextShape","_class_wxPyTextShape",0},
|
||||||
|
{ "_class_wxPyDataObjectSimple","_wxPyDataObjectSimple",0},
|
||||||
|
{ "_class_wxPyDropSource","_wxPyDropSource",0},
|
||||||
|
{ "_class_wxScrollEvent","_wxScrollEvent",0},
|
||||||
|
{ "_wxJoystickEvent","_class_wxJoystickEvent",0},
|
||||||
|
{ "_class_wxChoice","_wxChoice",0},
|
||||||
|
{ "_class_wxSlider","_wxSlider",0},
|
||||||
|
{ "_class_wxCalculateLayoutEvent","_wxCalculateLayoutEvent",0},
|
||||||
|
{ "_class_wxImageList","_wxImageList",0},
|
||||||
|
{ "_class_wxBitmapButton","_wxBitmapButton",0},
|
||||||
|
{ "_wxFrame","_class_wxFrame",0},
|
||||||
|
{ "_wxPCXHandler","_class_wxPCXHandler",0},
|
||||||
|
{ "_wxPyDivisionShape","_class_wxPyDivisionShape",0},
|
||||||
|
{ "_class_wxPaletteChangedEvent","_wxPaletteChangedEvent",0},
|
||||||
|
{ "_class_wxNotebook","_wxNotebook",0},
|
||||||
|
{ "_wxJPEGHandler","_class_wxJPEGHandler",0},
|
||||||
|
{ "_wxWindowID","_wxCoord",0},
|
||||||
|
{ "_wxWindowID","_wxPrintQuality",0},
|
||||||
|
{ "_wxWindowID","_size_t",0},
|
||||||
|
{ "_wxWindowID","_EBool",0},
|
||||||
|
{ "_wxWindowID","_uint",0},
|
||||||
|
{ "_wxWindowID","_int",0},
|
||||||
|
{ "_wxWindowID","_signed_int",0},
|
||||||
|
{ "_wxWindowID","_unsigned_int",0},
|
||||||
|
{ "_class_wxScrollWinEvent","_wxScrollWinEvent",0},
|
||||||
|
{ "_class_wxSizerItem","_wxSizerItem",0},
|
||||||
|
{ "_int","_wxCoord",0},
|
||||||
|
{ "_int","_wxPrintQuality",0},
|
||||||
|
{ "_int","_size_t",0},
|
||||||
|
{ "_int","_EBool",0},
|
||||||
|
{ "_int","_uint",0},
|
||||||
|
{ "_int","_wxWindowID",0},
|
||||||
|
{ "_int","_unsigned_int",0},
|
||||||
|
{ "_int","_signed_int",0},
|
||||||
|
{ "_class_wxMouseEvent","_wxMouseEvent",0},
|
||||||
|
{ "_wxPyCommandEvent","_class_wxPyCommandEvent",0},
|
||||||
|
{ "_class_wxListEvent","_wxListEvent",0},
|
||||||
|
{ "_class_wxPrintPreview","_wxPrintPreview",0},
|
||||||
|
{ "_class_wxSpinEvent","_wxSpinEvent",0},
|
||||||
|
{ "_class_wxQueryNewPaletteEvent","_wxQueryNewPaletteEvent",0},
|
||||||
|
{ "_class_wxNavigationKeyEvent","_wxNavigationKeyEvent",0},
|
||||||
|
{ "_wxButton","_class_wxButton",0},
|
||||||
|
{ "_class_wxPyApp","_wxPyApp",0},
|
||||||
|
{ "_wxSize","_class_wxSize",0},
|
||||||
|
{ "_wxRegionIterator","_class_wxRegionIterator",0},
|
||||||
|
{ "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
|
||||||
|
{ "_class_wxMDIParentFrame","_wxMDIParentFrame",0},
|
||||||
|
{ "_wxPyTreeItemData","_class_wxPyTreeItemData",0},
|
||||||
|
{ "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0},
|
||||||
|
{ "_class_wxPyLineShape","_wxPyLineShape",0},
|
||||||
|
{ "_class_wxPaintDC","_wxPaintDC",0},
|
||||||
|
{ "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0},
|
||||||
|
{ "_class_wxPyFileDropTarget","_wxPyFileDropTarget",0},
|
||||||
|
{ "_class_wxInitDialogEvent","_wxInitDialogEvent",0},
|
||||||
|
{ "_class_wxComboBox","_wxComboBox",0},
|
||||||
|
{ "_class_wxRadioButton","_wxRadioButton",0},
|
||||||
|
{ "_class_wxPyShape","_wxPyShape",0},
|
||||||
|
{ "_wxValidator","_class_wxValidator",0},
|
||||||
|
{ "_wxToolBarBase","_class_wxToolBarBase",0},
|
||||||
|
{ "_class_wxTreeItemId","_wxTreeItemId",0},
|
||||||
|
{ "_wxTreeCtrl","_class_wxTreeCtrl",0},
|
||||||
|
{ "_class_wxLayoutConstraints","_wxLayoutConstraints",0},
|
||||||
|
{ "_wxIconizeEvent","_class_wxIconizeEvent",0},
|
||||||
|
{ "_class_wxControl","_wxControl",0},
|
||||||
|
{ "_wxStaticBitmap","_class_wxStaticBitmap",0},
|
||||||
|
{ "_wxPyDrawnShape","_class_wxPyDrawnShape",0},
|
||||||
|
{ "_class_wxIcon","_wxIcon",0},
|
||||||
|
{ "_class_wxColour","_wxColour",0},
|
||||||
|
{ "_class_wxScreenDC","_wxScreenDC",0},
|
||||||
|
{ "_class_wxPageSetupDialog","_wxPageSetupDialog",0},
|
||||||
|
{ "_wxPalette","_class_wxPalette",0},
|
||||||
|
{ "_class_wxIdleEvent","_wxIdleEvent",0},
|
||||||
|
{ "_wxCoord","_int",0},
|
||||||
|
{ "_wxCoord","_signed_int",0},
|
||||||
|
{ "_wxCoord","_unsigned_int",0},
|
||||||
|
{ "_wxCoord","_wxWindowID",0},
|
||||||
|
{ "_wxCoord","_uint",0},
|
||||||
|
{ "_wxCoord","_EBool",0},
|
||||||
|
{ "_wxCoord","_size_t",0},
|
||||||
|
{ "_wxCoord","_wxPrintQuality",0},
|
||||||
|
{ "_wxEraseEvent","_class_wxEraseEvent",0},
|
||||||
|
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
|
||||||
|
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
|
||||||
|
{ "_class_wxMiniFrame","_wxMiniFrame",0},
|
||||||
|
{ "_wxFontDialog","_class_wxFontDialog",0},
|
||||||
|
{ "_wxRegion","_class_wxRegion",0},
|
||||||
|
{ "_class_wxSplitterWindow","_wxSplitterWindow",0},
|
||||||
|
{ "_wxPreviewFrame","_class_wxPreviewFrame",0},
|
||||||
|
{ "_wxSizer","_class_wxSizer",0},
|
||||||
|
{ "_class_wxShowEvent","_wxShowEvent",0},
|
||||||
|
{ "_class_wxPCXHandler","_wxPCXHandler",0},
|
||||||
|
{ "_wxTIFFHandler","_class_wxTIFFHandler",0},
|
||||||
|
{ "_wxDiagram","_class_wxDiagram",0},
|
||||||
|
{ "_wxPyDropTarget","_class_wxPyDropTarget",0},
|
||||||
|
{ "_wxActivateEvent","_class_wxActivateEvent",0},
|
||||||
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
{ "_class_wxListCtrl","_wxListCtrl",0},
|
||||||
|
{ "_class_wxPyDividedShape","_wxPyDividedShape",0},
|
||||||
|
{ "_wxPyEllipseShape","_class_wxPyEllipseShape",0},
|
||||||
|
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
|
||||||
|
{ "_class_wxSize","_wxSize",0},
|
||||||
|
{ "_class_wxBitmap","_wxBitmap",0},
|
||||||
|
{ "_class_wxMemoryDC","_wxMemoryDC",0},
|
||||||
|
{ "_wxPyTextDropTarget","_class_wxPyTextDropTarget",0},
|
||||||
|
{ "_wxMenuBar","_class_wxMenuBar",0},
|
||||||
|
{ "_wxTreeEvent","_class_wxTreeEvent",0},
|
||||||
|
{ "_wxDirDialog","_class_wxDirDialog",0},
|
||||||
|
{ "_wxPyShapeEvtHandler","_class_wxPyShapeEvtHandler",0},
|
||||||
|
{ "_wxEvtHandler","_class_wxEvtHandler",0},
|
||||||
|
{ "_wxMenuItem","_class_wxMenuItem",0},
|
||||||
|
{ "_class_wxScrollBar","_wxScrollBar",0},
|
||||||
|
{ "_class_wxColourDialog","_wxColourDialog",0},
|
||||||
|
{ "_class_wxPrintData","_wxPrintData",0},
|
||||||
|
{ "_wxDash","_char",0},
|
||||||
|
{ "_wxPyRectangleShape","_class_wxPyRectangleShape",0},
|
||||||
|
{ "_class_wxScrolledWindow","_wxScrolledWindow",0},
|
||||||
|
{ "_class_wxTextEntryDialog","_wxTextEntryDialog",0},
|
||||||
|
{ "_wxKeyEvent","_class_wxKeyEvent",0},
|
||||||
|
{ "_wxMoveEvent","_class_wxMoveEvent",0},
|
||||||
|
{ "_wxOGLConstraint","_class_wxOGLConstraint",0},
|
||||||
|
{ "_wxColourData","_class_wxColourData",0},
|
||||||
|
{ "_wxPageSetupDialogData","_class_wxPageSetupDialogData",0},
|
||||||
|
{ "_class_wxPalette","_wxPalette",0},
|
||||||
|
{ "_wxFileDataObject","_class_wxFileDataObject",0},
|
||||||
|
{ "_class_wxQueryLayoutInfoEvent","_wxQueryLayoutInfoEvent",0},
|
||||||
|
{ "_class_wxEraseEvent","_wxEraseEvent",0},
|
||||||
|
{ "_wxPyFontEnumerator","_class_wxPyFontEnumerator",0},
|
||||||
|
{ "_wxMDIClientWindow","_class_wxMDIClientWindow",0},
|
||||||
|
{ "_class_wxPyTextShape","_wxPyTextShape",0},
|
||||||
|
{ "_class_wxDataObjectComposite","_wxDataObjectComposite",0},
|
||||||
|
{ "_class_wxToolBarToolBase","_wxToolBarToolBase",0},
|
||||||
|
{ "_class_wxFontDialog","_wxFontDialog",0},
|
||||||
|
{ "_wxWindow","_class_wxWindow",0},
|
||||||
|
{ "_class_wxWindowDestroyEvent","_wxWindowDestroyEvent",0},
|
||||||
|
{ "_class_wxFrame","_wxFrame",0},
|
||||||
|
{ "_class_wxDiagram","_wxDiagram",0},
|
||||||
|
{0,0,0}};
|
||||||
|
|
||||||
|
static PyObject *SWIG_globals;
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
SWIGEXPORT(void) initoglc() {
|
||||||
|
PyObject *m, *d;
|
||||||
|
SWIG_globals = SWIG_newvarlink();
|
||||||
|
m = Py_InitModule("oglc", oglcMethods);
|
||||||
|
d = PyModule_GetDict(m);
|
||||||
|
PyDict_SetItemString(d,"KEY_SHIFT", PyInt_FromLong((long) KEY_SHIFT));
|
||||||
|
PyDict_SetItemString(d,"KEY_CTRL", PyInt_FromLong((long) KEY_CTRL));
|
||||||
|
PyDict_SetItemString(d,"ARROW_NONE", PyInt_FromLong((long) ARROW_NONE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_END", PyInt_FromLong((long) ARROW_END));
|
||||||
|
PyDict_SetItemString(d,"ARROW_BOTH", PyInt_FromLong((long) ARROW_BOTH));
|
||||||
|
PyDict_SetItemString(d,"ARROW_MIDDLE", PyInt_FromLong((long) ARROW_MIDDLE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_START", PyInt_FromLong((long) ARROW_START));
|
||||||
|
PyDict_SetItemString(d,"ARROW_HOLLOW_CIRCLE", PyInt_FromLong((long) ARROW_HOLLOW_CIRCLE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_FILLED_CIRCLE", PyInt_FromLong((long) ARROW_FILLED_CIRCLE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_ARROW", PyInt_FromLong((long) ARROW_ARROW));
|
||||||
|
PyDict_SetItemString(d,"ARROW_SINGLE_OBLIQUE", PyInt_FromLong((long) ARROW_SINGLE_OBLIQUE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_DOUBLE_OBLIQUE", PyInt_FromLong((long) ARROW_DOUBLE_OBLIQUE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_METAFILE", PyInt_FromLong((long) ARROW_METAFILE));
|
||||||
|
PyDict_SetItemString(d,"ARROW_POSITION_END", PyInt_FromLong((long) ARROW_POSITION_END));
|
||||||
|
PyDict_SetItemString(d,"ARROW_POSITION_START", PyInt_FromLong((long) ARROW_POSITION_START));
|
||||||
|
PyDict_SetItemString(d,"CONTROL_POINT_VERTICAL", PyInt_FromLong((long) CONTROL_POINT_VERTICAL));
|
||||||
|
PyDict_SetItemString(d,"CONTROL_POINT_HORIZONTAL", PyInt_FromLong((long) CONTROL_POINT_HORIZONTAL));
|
||||||
|
PyDict_SetItemString(d,"CONTROL_POINT_DIAGONAL", PyInt_FromLong((long) CONTROL_POINT_DIAGONAL));
|
||||||
|
PyDict_SetItemString(d,"CONTROL_POINT_ENDPOINT_TO", PyInt_FromLong((long) CONTROL_POINT_ENDPOINT_TO));
|
||||||
|
PyDict_SetItemString(d,"CONTROL_POINT_ENDPOINT_FROM", PyInt_FromLong((long) CONTROL_POINT_ENDPOINT_FROM));
|
||||||
|
PyDict_SetItemString(d,"CONTROL_POINT_LINE", PyInt_FromLong((long) CONTROL_POINT_LINE));
|
||||||
|
PyDict_SetItemString(d,"FORMAT_NONE", PyInt_FromLong((long) FORMAT_NONE));
|
||||||
|
PyDict_SetItemString(d,"FORMAT_CENTRE_HORIZ", PyInt_FromLong((long) FORMAT_CENTRE_HORIZ));
|
||||||
|
PyDict_SetItemString(d,"FORMAT_CENTRE_VERT", PyInt_FromLong((long) FORMAT_CENTRE_VERT));
|
||||||
|
PyDict_SetItemString(d,"FORMAT_SIZE_TO_CONTENTS", PyInt_FromLong((long) FORMAT_SIZE_TO_CONTENTS));
|
||||||
|
PyDict_SetItemString(d,"LINE_ALIGNMENT_HORIZ", PyInt_FromLong((long) LINE_ALIGNMENT_HORIZ));
|
||||||
|
PyDict_SetItemString(d,"LINE_ALIGNMENT_VERT", PyInt_FromLong((long) LINE_ALIGNMENT_VERT));
|
||||||
|
PyDict_SetItemString(d,"LINE_ALIGNMENT_TO_NEXT_HANDLE", PyInt_FromLong((long) LINE_ALIGNMENT_TO_NEXT_HANDLE));
|
||||||
|
PyDict_SetItemString(d,"LINE_ALIGNMENT_NONE", PyInt_FromLong((long) LINE_ALIGNMENT_NONE));
|
||||||
|
PyDict_SetItemString(d,"SHADOW_NONE", PyInt_FromLong((long) SHADOW_NONE));
|
||||||
|
PyDict_SetItemString(d,"SHADOW_LEFT", PyInt_FromLong((long) SHADOW_LEFT));
|
||||||
|
PyDict_SetItemString(d,"SHADOW_RIGHT", PyInt_FromLong((long) SHADOW_RIGHT));
|
||||||
|
PyDict_SetItemString(d,"OP_CLICK_LEFT", PyInt_FromLong((long) OP_CLICK_LEFT));
|
||||||
|
PyDict_SetItemString(d,"OP_CLICK_RIGHT", PyInt_FromLong((long) OP_CLICK_RIGHT));
|
||||||
|
PyDict_SetItemString(d,"OP_DRAG_LEFT", PyInt_FromLong((long) OP_DRAG_LEFT));
|
||||||
|
PyDict_SetItemString(d,"OP_DRAG_RIGHT", PyInt_FromLong((long) OP_DRAG_RIGHT));
|
||||||
|
PyDict_SetItemString(d,"OP_ALL", PyInt_FromLong((long) OP_ALL));
|
||||||
|
PyDict_SetItemString(d,"ATTACHMENT_MODE_NONE", PyInt_FromLong((long) ATTACHMENT_MODE_NONE));
|
||||||
|
PyDict_SetItemString(d,"ATTACHMENT_MODE_EDGE", PyInt_FromLong((long) ATTACHMENT_MODE_EDGE));
|
||||||
|
PyDict_SetItemString(d,"ATTACHMENT_MODE_BRANCHING", PyInt_FromLong((long) ATTACHMENT_MODE_BRANCHING));
|
||||||
|
PyDict_SetItemString(d,"BRANCHING_ATTACHMENT_NORMAL", PyInt_FromLong((long) BRANCHING_ATTACHMENT_NORMAL));
|
||||||
|
PyDict_SetItemString(d,"BRANCHING_ATTACHMENT_BLOB", PyInt_FromLong((long) BRANCHING_ATTACHMENT_BLOB));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_CENTRED_VERTICALLY", PyInt_FromLong((long) gyCONSTRAINT_CENTRED_VERTICALLY));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_CENTRED_HORIZONTALLY", PyInt_FromLong((long) gyCONSTRAINT_CENTRED_HORIZONTALLY));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_CENTRED_BOTH", PyInt_FromLong((long) gyCONSTRAINT_CENTRED_BOTH));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_LEFT_OF", PyInt_FromLong((long) gyCONSTRAINT_LEFT_OF));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_RIGHT_OF", PyInt_FromLong((long) gyCONSTRAINT_RIGHT_OF));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_ABOVE", PyInt_FromLong((long) gyCONSTRAINT_ABOVE));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_BELOW", PyInt_FromLong((long) gyCONSTRAINT_BELOW));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_TOP", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_TOP));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_BOTTOM", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_BOTTOM));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_LEFT", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_LEFT));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_RIGHT", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_RIGHT));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_TOP", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_TOP));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_BOTTOM", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_BOTTOM));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_LEFT", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_LEFT));
|
||||||
|
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_RIGHT", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_RIGHT));
|
||||||
|
PyDict_SetItemString(d,"DIVISION_SIDE_NONE", PyInt_FromLong((long) DIVISION_SIDE_NONE));
|
||||||
|
PyDict_SetItemString(d,"DIVISION_SIDE_LEFT", PyInt_FromLong((long) DIVISION_SIDE_LEFT));
|
||||||
|
PyDict_SetItemString(d,"DIVISION_SIDE_TOP", PyInt_FromLong((long) DIVISION_SIDE_TOP));
|
||||||
|
PyDict_SetItemString(d,"DIVISION_SIDE_RIGHT", PyInt_FromLong((long) DIVISION_SIDE_RIGHT));
|
||||||
|
PyDict_SetItemString(d,"DIVISION_SIDE_BOTTOM", PyInt_FromLong((long) DIVISION_SIDE_BOTTOM));
|
||||||
|
|
||||||
|
|
||||||
|
initoglbasicc();
|
||||||
|
initoglshapesc();
|
||||||
|
initoglshapes2c();
|
||||||
|
initoglcanvasc();
|
||||||
|
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; _swig_mapping[i].n1; i++)
|
||||||
|
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
|
||||||
|
}
|
||||||
|
}
|
||||||
175
wxPython/contrib/ogl/ogl.i
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: ogl.i
|
||||||
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 30-June-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
%module ogl
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "oglhelpers.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%import windows.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern misc.i
|
||||||
|
%extern gdi.i
|
||||||
|
|
||||||
|
%include _ogldefs.i
|
||||||
|
|
||||||
|
%import oglbasic.i
|
||||||
|
%import oglshapes.i
|
||||||
|
%import oglshapes2.i
|
||||||
|
%import oglcanvas.i
|
||||||
|
|
||||||
|
|
||||||
|
%{
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
wxString wxPyEmptyStr("");
|
||||||
|
wxPoint wxPyDefaultPosition(-1, -1);
|
||||||
|
wxSize wxPyDefaultSize(-1, -1);
|
||||||
|
#endif
|
||||||
|
%}
|
||||||
|
|
||||||
|
%pragma(python) code = "import wx"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
enum {
|
||||||
|
KEY_SHIFT,
|
||||||
|
KEY_CTRL,
|
||||||
|
ARROW_NONE,
|
||||||
|
ARROW_END,
|
||||||
|
ARROW_BOTH,
|
||||||
|
ARROW_MIDDLE,
|
||||||
|
ARROW_START,
|
||||||
|
ARROW_HOLLOW_CIRCLE,
|
||||||
|
ARROW_FILLED_CIRCLE,
|
||||||
|
ARROW_ARROW,
|
||||||
|
ARROW_SINGLE_OBLIQUE,
|
||||||
|
ARROW_DOUBLE_OBLIQUE,
|
||||||
|
ARROW_METAFILE,
|
||||||
|
ARROW_POSITION_END,
|
||||||
|
ARROW_POSITION_START,
|
||||||
|
CONTROL_POINT_VERTICAL,
|
||||||
|
CONTROL_POINT_HORIZONTAL,
|
||||||
|
CONTROL_POINT_DIAGONAL,
|
||||||
|
CONTROL_POINT_ENDPOINT_TO,
|
||||||
|
CONTROL_POINT_ENDPOINT_FROM,
|
||||||
|
CONTROL_POINT_LINE,
|
||||||
|
FORMAT_NONE,
|
||||||
|
FORMAT_CENTRE_HORIZ,
|
||||||
|
FORMAT_CENTRE_VERT,
|
||||||
|
FORMAT_SIZE_TO_CONTENTS,
|
||||||
|
LINE_ALIGNMENT_HORIZ,
|
||||||
|
LINE_ALIGNMENT_VERT,
|
||||||
|
LINE_ALIGNMENT_TO_NEXT_HANDLE,
|
||||||
|
LINE_ALIGNMENT_NONE,
|
||||||
|
SHADOW_NONE,
|
||||||
|
SHADOW_LEFT,
|
||||||
|
SHADOW_RIGHT,
|
||||||
|
// SHAPE_BASIC,
|
||||||
|
// SHAPE_RECTANGLE,
|
||||||
|
// SHAPE_ELLIPSE,
|
||||||
|
// SHAPE_POLYGON,
|
||||||
|
// SHAPE_CIRCLE,
|
||||||
|
// SHAPE_LINE,
|
||||||
|
// SHAPE_DIVIDED_RECTANGLE,
|
||||||
|
// SHAPE_COMPOSITE,
|
||||||
|
// SHAPE_CONTROL_POINT,
|
||||||
|
// SHAPE_DRAWN,
|
||||||
|
// SHAPE_DIVISION,
|
||||||
|
// SHAPE_LABEL_OBJECT,
|
||||||
|
// SHAPE_BITMAP,
|
||||||
|
// SHAPE_DIVIDED_OBJECT_CONTROL_POINT,
|
||||||
|
// OBJECT_REGION,
|
||||||
|
OP_CLICK_LEFT,
|
||||||
|
OP_CLICK_RIGHT,
|
||||||
|
OP_DRAG_LEFT,
|
||||||
|
OP_DRAG_RIGHT,
|
||||||
|
OP_ALL,
|
||||||
|
ATTACHMENT_MODE_NONE,
|
||||||
|
ATTACHMENT_MODE_EDGE,
|
||||||
|
ATTACHMENT_MODE_BRANCHING,
|
||||||
|
BRANCHING_ATTACHMENT_NORMAL,
|
||||||
|
BRANCHING_ATTACHMENT_BLOB,
|
||||||
|
|
||||||
|
gyCONSTRAINT_CENTRED_VERTICALLY,
|
||||||
|
gyCONSTRAINT_CENTRED_HORIZONTALLY,
|
||||||
|
gyCONSTRAINT_CENTRED_BOTH,
|
||||||
|
gyCONSTRAINT_LEFT_OF,
|
||||||
|
gyCONSTRAINT_RIGHT_OF,
|
||||||
|
gyCONSTRAINT_ABOVE,
|
||||||
|
gyCONSTRAINT_BELOW,
|
||||||
|
gyCONSTRAINT_ALIGNED_TOP,
|
||||||
|
gyCONSTRAINT_ALIGNED_BOTTOM,
|
||||||
|
gyCONSTRAINT_ALIGNED_LEFT,
|
||||||
|
gyCONSTRAINT_ALIGNED_RIGHT,
|
||||||
|
gyCONSTRAINT_MIDALIGNED_TOP,
|
||||||
|
gyCONSTRAINT_MIDALIGNED_BOTTOM,
|
||||||
|
gyCONSTRAINT_MIDALIGNED_LEFT,
|
||||||
|
gyCONSTRAINT_MIDALIGNED_RIGHT,
|
||||||
|
|
||||||
|
DIVISION_SIDE_NONE,
|
||||||
|
DIVISION_SIDE_LEFT,
|
||||||
|
DIVISION_SIDE_TOP,
|
||||||
|
DIVISION_SIDE_RIGHT,
|
||||||
|
DIVISION_SIDE_BOTTOM,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxOGLInitialize();
|
||||||
|
void wxOGLCleanUp();
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
extern "C" SWIGEXPORT(void) initoglbasicc();
|
||||||
|
extern "C" SWIGEXPORT(void) initoglshapesc();
|
||||||
|
extern "C" SWIGEXPORT(void) initoglshapes2c();
|
||||||
|
extern "C" SWIGEXPORT(void) initoglcanvasc();
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
%init %{
|
||||||
|
|
||||||
|
initoglbasicc();
|
||||||
|
initoglshapesc();
|
||||||
|
initoglshapes2c();
|
||||||
|
initoglcanvasc();
|
||||||
|
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
// And this gets appended to the shadow class file.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
%pragma(python) include="_extras.py";
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
159
wxPython/contrib/ogl/ogl.py
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import oglc
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
|
||||||
|
from oglbasic import *
|
||||||
|
|
||||||
|
from oglshapes import *
|
||||||
|
|
||||||
|
from oglshapes2 import *
|
||||||
|
|
||||||
|
from oglcanvas import *
|
||||||
|
import wx
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
wxOGLInitialize = oglc.wxOGLInitialize
|
||||||
|
|
||||||
|
wxOGLCleanUp = oglc.wxOGLCleanUp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
|
KEY_SHIFT = oglc.KEY_SHIFT
|
||||||
|
KEY_CTRL = oglc.KEY_CTRL
|
||||||
|
ARROW_NONE = oglc.ARROW_NONE
|
||||||
|
ARROW_END = oglc.ARROW_END
|
||||||
|
ARROW_BOTH = oglc.ARROW_BOTH
|
||||||
|
ARROW_MIDDLE = oglc.ARROW_MIDDLE
|
||||||
|
ARROW_START = oglc.ARROW_START
|
||||||
|
ARROW_HOLLOW_CIRCLE = oglc.ARROW_HOLLOW_CIRCLE
|
||||||
|
ARROW_FILLED_CIRCLE = oglc.ARROW_FILLED_CIRCLE
|
||||||
|
ARROW_ARROW = oglc.ARROW_ARROW
|
||||||
|
ARROW_SINGLE_OBLIQUE = oglc.ARROW_SINGLE_OBLIQUE
|
||||||
|
ARROW_DOUBLE_OBLIQUE = oglc.ARROW_DOUBLE_OBLIQUE
|
||||||
|
ARROW_METAFILE = oglc.ARROW_METAFILE
|
||||||
|
ARROW_POSITION_END = oglc.ARROW_POSITION_END
|
||||||
|
ARROW_POSITION_START = oglc.ARROW_POSITION_START
|
||||||
|
CONTROL_POINT_VERTICAL = oglc.CONTROL_POINT_VERTICAL
|
||||||
|
CONTROL_POINT_HORIZONTAL = oglc.CONTROL_POINT_HORIZONTAL
|
||||||
|
CONTROL_POINT_DIAGONAL = oglc.CONTROL_POINT_DIAGONAL
|
||||||
|
CONTROL_POINT_ENDPOINT_TO = oglc.CONTROL_POINT_ENDPOINT_TO
|
||||||
|
CONTROL_POINT_ENDPOINT_FROM = oglc.CONTROL_POINT_ENDPOINT_FROM
|
||||||
|
CONTROL_POINT_LINE = oglc.CONTROL_POINT_LINE
|
||||||
|
FORMAT_NONE = oglc.FORMAT_NONE
|
||||||
|
FORMAT_CENTRE_HORIZ = oglc.FORMAT_CENTRE_HORIZ
|
||||||
|
FORMAT_CENTRE_VERT = oglc.FORMAT_CENTRE_VERT
|
||||||
|
FORMAT_SIZE_TO_CONTENTS = oglc.FORMAT_SIZE_TO_CONTENTS
|
||||||
|
LINE_ALIGNMENT_HORIZ = oglc.LINE_ALIGNMENT_HORIZ
|
||||||
|
LINE_ALIGNMENT_VERT = oglc.LINE_ALIGNMENT_VERT
|
||||||
|
LINE_ALIGNMENT_TO_NEXT_HANDLE = oglc.LINE_ALIGNMENT_TO_NEXT_HANDLE
|
||||||
|
LINE_ALIGNMENT_NONE = oglc.LINE_ALIGNMENT_NONE
|
||||||
|
SHADOW_NONE = oglc.SHADOW_NONE
|
||||||
|
SHADOW_LEFT = oglc.SHADOW_LEFT
|
||||||
|
SHADOW_RIGHT = oglc.SHADOW_RIGHT
|
||||||
|
OP_CLICK_LEFT = oglc.OP_CLICK_LEFT
|
||||||
|
OP_CLICK_RIGHT = oglc.OP_CLICK_RIGHT
|
||||||
|
OP_DRAG_LEFT = oglc.OP_DRAG_LEFT
|
||||||
|
OP_DRAG_RIGHT = oglc.OP_DRAG_RIGHT
|
||||||
|
OP_ALL = oglc.OP_ALL
|
||||||
|
ATTACHMENT_MODE_NONE = oglc.ATTACHMENT_MODE_NONE
|
||||||
|
ATTACHMENT_MODE_EDGE = oglc.ATTACHMENT_MODE_EDGE
|
||||||
|
ATTACHMENT_MODE_BRANCHING = oglc.ATTACHMENT_MODE_BRANCHING
|
||||||
|
BRANCHING_ATTACHMENT_NORMAL = oglc.BRANCHING_ATTACHMENT_NORMAL
|
||||||
|
BRANCHING_ATTACHMENT_BLOB = oglc.BRANCHING_ATTACHMENT_BLOB
|
||||||
|
gyCONSTRAINT_CENTRED_VERTICALLY = oglc.gyCONSTRAINT_CENTRED_VERTICALLY
|
||||||
|
gyCONSTRAINT_CENTRED_HORIZONTALLY = oglc.gyCONSTRAINT_CENTRED_HORIZONTALLY
|
||||||
|
gyCONSTRAINT_CENTRED_BOTH = oglc.gyCONSTRAINT_CENTRED_BOTH
|
||||||
|
gyCONSTRAINT_LEFT_OF = oglc.gyCONSTRAINT_LEFT_OF
|
||||||
|
gyCONSTRAINT_RIGHT_OF = oglc.gyCONSTRAINT_RIGHT_OF
|
||||||
|
gyCONSTRAINT_ABOVE = oglc.gyCONSTRAINT_ABOVE
|
||||||
|
gyCONSTRAINT_BELOW = oglc.gyCONSTRAINT_BELOW
|
||||||
|
gyCONSTRAINT_ALIGNED_TOP = oglc.gyCONSTRAINT_ALIGNED_TOP
|
||||||
|
gyCONSTRAINT_ALIGNED_BOTTOM = oglc.gyCONSTRAINT_ALIGNED_BOTTOM
|
||||||
|
gyCONSTRAINT_ALIGNED_LEFT = oglc.gyCONSTRAINT_ALIGNED_LEFT
|
||||||
|
gyCONSTRAINT_ALIGNED_RIGHT = oglc.gyCONSTRAINT_ALIGNED_RIGHT
|
||||||
|
gyCONSTRAINT_MIDALIGNED_TOP = oglc.gyCONSTRAINT_MIDALIGNED_TOP
|
||||||
|
gyCONSTRAINT_MIDALIGNED_BOTTOM = oglc.gyCONSTRAINT_MIDALIGNED_BOTTOM
|
||||||
|
gyCONSTRAINT_MIDALIGNED_LEFT = oglc.gyCONSTRAINT_MIDALIGNED_LEFT
|
||||||
|
gyCONSTRAINT_MIDALIGNED_RIGHT = oglc.gyCONSTRAINT_MIDALIGNED_RIGHT
|
||||||
|
DIVISION_SIDE_NONE = oglc.DIVISION_SIDE_NONE
|
||||||
|
DIVISION_SIDE_LEFT = oglc.DIVISION_SIDE_LEFT
|
||||||
|
DIVISION_SIDE_TOP = oglc.DIVISION_SIDE_TOP
|
||||||
|
DIVISION_SIDE_RIGHT = oglc.DIVISION_SIDE_RIGHT
|
||||||
|
DIVISION_SIDE_BOTTOM = oglc.DIVISION_SIDE_BOTTOM
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- USER INCLUDE -----------------------
|
||||||
|
|
||||||
|
|
||||||
|
wxShapeCanvas = wxPyShapeCanvas
|
||||||
|
wxShapeEvtHandler = wxPyShapeEvtHandler
|
||||||
|
wxShape = wxPyShape
|
||||||
|
wxRectangleShape = wxPyRectangleShape
|
||||||
|
wxBitmapShape = wxPyBitmapShape
|
||||||
|
wxDrawnShape = wxPyDrawnShape
|
||||||
|
wxCompositeShape = wxPyCompositeShape
|
||||||
|
wxDividedShape = wxPyDividedShape
|
||||||
|
wxDivisionShape = wxPyDivisionShape
|
||||||
|
wxEllipseShape = wxPyEllipseShape
|
||||||
|
wxCircleShape = wxPyCircleShape
|
||||||
|
wxLineShape = wxPyLineShape
|
||||||
|
wxPolygonShape = wxPyPolygonShape
|
||||||
|
wxTextShape = wxPyTextShape
|
||||||
|
wxControlPoint = wxPyControlPoint
|
||||||
|
|
||||||
|
# Stuff these names into the wx namespace so wxPyConstructObject can find them
|
||||||
|
import wx
|
||||||
|
wx.wxPyShapeCanvasPtr = wxPyShapeCanvasPtr
|
||||||
|
wx.wxPyShapeEvtHandlerPtr = wxPyShapeEvtHandlerPtr
|
||||||
|
wx.wxPyShapePtr = wxPyShapePtr
|
||||||
|
wx.wxPyRectangleShapePtr = wxPyRectangleShapePtr
|
||||||
|
wx.wxPyBitmapShapePtr = wxPyBitmapShapePtr
|
||||||
|
wx.wxPyDrawnShapePtr = wxPyDrawnShapePtr
|
||||||
|
wx.wxPyCompositeShapePtr = wxPyCompositeShapePtr
|
||||||
|
wx.wxPyDividedShapePtr = wxPyDividedShapePtr
|
||||||
|
wx.wxPyDivisionShapePtr = wxPyDivisionShapePtr
|
||||||
|
wx.wxPyEllipseShapePtr = wxPyEllipseShapePtr
|
||||||
|
wx.wxPyCircleShapePtr = wxPyCircleShapePtr
|
||||||
|
wx.wxPyLineShapePtr = wxPyLineShapePtr
|
||||||
|
wx.wxPyPolygonShapePtr = wxPyPolygonShapePtr
|
||||||
|
wx.wxPyTextShapePtr = wxPyTextShapePtr
|
||||||
|
wx.wxShapeRegionPtr = wxShapeRegionPtr
|
||||||
|
wx.wxOGLConstraintPtr = wxOGLConstraintPtr
|
||||||
|
wx.wxControlPointPtr = wxPyControlPointPtr
|
||||||
8693
wxPython/contrib/ogl/oglbasic.cpp
Normal file
401
wxPython/contrib/ogl/oglbasic.i
Normal file
@@ -0,0 +1,401 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: oglbasic.i
|
||||||
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 3-Sept-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
%module oglbasic
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "oglhelpers.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%import windows.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern misc.i
|
||||||
|
%extern gdi.i
|
||||||
|
|
||||||
|
%include _ogldefs.i
|
||||||
|
|
||||||
|
//%extern oglcanvas.i
|
||||||
|
|
||||||
|
|
||||||
|
%pragma(python) code = "import wx"
|
||||||
|
%pragma(python) code = "from oglcanvas import wxPyShapeCanvasPtr"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class wxShapeRegion {
|
||||||
|
public:
|
||||||
|
wxShapeRegion();
|
||||||
|
//~wxShapeRegion();
|
||||||
|
|
||||||
|
void SetText(const wxString& s);
|
||||||
|
void SetFont(wxFont *f);
|
||||||
|
void SetMinSize(double w, double h);
|
||||||
|
void SetSize(double w, double h);
|
||||||
|
void SetPosition(double x, double y);
|
||||||
|
void SetProportions(double x, double y);
|
||||||
|
void SetFormatMode(int mode);
|
||||||
|
void SetName(const wxString& s);
|
||||||
|
void SetColour(const wxString& col);
|
||||||
|
|
||||||
|
wxString GetText();
|
||||||
|
wxFont *GetFont();
|
||||||
|
void GetMinSize(double *OUTPUT, double *OUTPUT);
|
||||||
|
void GetProportion(double *OUTPUT, double *OUTPUT);
|
||||||
|
void GetSize(double *OUTPUT, double *OUTPUT);
|
||||||
|
void GetPosition(double *OUTPUT, double *OUTPUT);
|
||||||
|
int GetFormatMode();
|
||||||
|
wxString GetName();
|
||||||
|
wxString GetColour();
|
||||||
|
wxColour *GetActualColourObject();
|
||||||
|
wxList& GetFormattedText();
|
||||||
|
wxString GetPenColour();
|
||||||
|
int GetPenStyle();
|
||||||
|
void SetPenStyle(int style);
|
||||||
|
void SetPenColour(const wxString& col);
|
||||||
|
wxPen *GetActualPen();
|
||||||
|
double GetWidth();
|
||||||
|
double GetHeight();
|
||||||
|
|
||||||
|
void ClearText();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyShapeEvtHandler,wxShapeEvtHandler);
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShapeEvtHandler {
|
||||||
|
public:
|
||||||
|
wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL,
|
||||||
|
wxPyShape *shape = NULL);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShapeEvtHandler)"
|
||||||
|
|
||||||
|
%addmethods {
|
||||||
|
void Destroy() { delete self; }
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetShape(wxPyShape *sh);
|
||||||
|
wxPyShape *GetShape();
|
||||||
|
void SetPreviousHandler(wxPyShapeEvtHandler* handler);
|
||||||
|
wxPyShapeEvtHandler* GetPreviousHandler();
|
||||||
|
wxPyShapeEvtHandler* CreateNewCopy();
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyShape, wxShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShape : public wxPyShapeEvtHandler {
|
||||||
|
public:
|
||||||
|
// wxPyShape(wxPyShapeCanvas *can = NULL); abstract base class...
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShape)"
|
||||||
|
|
||||||
|
%addmethods {
|
||||||
|
void Destroy() { delete self; }
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT);
|
||||||
|
void GetBoundingBoxMin(double *OUTPUT, double *OUTPUT);
|
||||||
|
bool GetPerimeterPoint(double x1, double y1,
|
||||||
|
double x2, double y2,
|
||||||
|
double *OUTPUT, double *OUTPUT);
|
||||||
|
wxPyShapeCanvas *GetCanvas();
|
||||||
|
void SetCanvas(wxPyShapeCanvas *the_canvas);
|
||||||
|
void AddToCanvas(wxPyShapeCanvas *the_canvas, wxPyShape *addAfter = NULL);
|
||||||
|
void InsertInCanvas(wxPyShapeCanvas *the_canvas);
|
||||||
|
void RemoveFromCanvas(wxPyShapeCanvas *the_canvas);
|
||||||
|
double GetX();
|
||||||
|
double GetY();
|
||||||
|
void SetX(double x);
|
||||||
|
void SetY(double y);
|
||||||
|
wxPyShape *GetParent();
|
||||||
|
void SetParent(wxPyShape *p);
|
||||||
|
wxPyShape *GetTopAncestor();
|
||||||
|
|
||||||
|
|
||||||
|
// wxList& GetChildren();
|
||||||
|
%addmethods {
|
||||||
|
PyObject* GetChildren() {
|
||||||
|
wxList& list = self->GetChildren();
|
||||||
|
return wxPy_ConvertList(&list, "wxPyShape");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Unlink();
|
||||||
|
void SetDrawHandles(bool drawH);
|
||||||
|
bool GetDrawHandles();
|
||||||
|
void MakeControlPoints();
|
||||||
|
void DeleteControlPoints(wxDC *dc = NULL);
|
||||||
|
void ResetControlPoints();
|
||||||
|
wxPyShapeEvtHandler *GetEventHandler();
|
||||||
|
void SetEventHandler(wxPyShapeEvtHandler *handler);
|
||||||
|
void MakeMandatoryControlPoints();
|
||||||
|
void ResetMandatoryControlPoints();
|
||||||
|
bool Recompute();
|
||||||
|
void CalculateSize();
|
||||||
|
void Select(bool select = TRUE, wxDC* dc = NULL);
|
||||||
|
void SetHighlight(bool hi = TRUE, bool recurse = FALSE);
|
||||||
|
bool IsHighlighted() ;
|
||||||
|
bool Selected();
|
||||||
|
bool AncestorSelected();
|
||||||
|
void SetSensitivityFilter(int sens = OP_ALL, bool recursive = FALSE);
|
||||||
|
int GetSensitivityFilter();
|
||||||
|
void SetDraggable(bool drag, bool recursive = FALSE);
|
||||||
|
void SetFixedSize(bool x, bool y);
|
||||||
|
void GetFixedSize(bool *OUTPUT, bool *OUTPUT) ;
|
||||||
|
bool GetFixedWidth();
|
||||||
|
bool GetFixedHeight();
|
||||||
|
void SetSpaceAttachments(bool sp);
|
||||||
|
bool GetSpaceAttachments() ;
|
||||||
|
void SetShadowMode(int mode, bool redraw = FALSE);
|
||||||
|
int GetShadowMode();
|
||||||
|
bool HitTest(double x, double y, int *OUTPUT, double *OUTPUT);
|
||||||
|
void SetCentreResize(bool cr);
|
||||||
|
bool GetCentreResize();
|
||||||
|
void SetMaintainAspectRatio(bool ar);
|
||||||
|
bool GetMaintainAspectRatio();
|
||||||
|
|
||||||
|
|
||||||
|
// wxList& GetLines();
|
||||||
|
%addmethods {
|
||||||
|
PyObject* GetLines() {
|
||||||
|
wxList& list = self->GetLines();
|
||||||
|
return wxPy_ConvertList(&list, "wxPyLineShape");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetDisableLabel(bool flag);
|
||||||
|
bool GetDisableLabel();
|
||||||
|
void SetAttachmentMode(int mode);
|
||||||
|
int GetAttachmentMode();
|
||||||
|
void SetId(long i);
|
||||||
|
long GetId();
|
||||||
|
void SetPen(wxPen *pen);
|
||||||
|
void SetBrush(wxBrush *brush);
|
||||||
|
|
||||||
|
// void SetClientData(wxObject *client_data);
|
||||||
|
// wxObject *GetClientData();
|
||||||
|
%addmethods {
|
||||||
|
void SetClientData(PyObject* userData) {
|
||||||
|
wxPyUserData* data = NULL;
|
||||||
|
if (userData)
|
||||||
|
data = new wxPyUserData(userData);
|
||||||
|
self->SetClientData(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
PyObject* GetClientData() {
|
||||||
|
wxPyUserData* data = (wxPyUserData*)self->GetClientData();
|
||||||
|
if (data) {
|
||||||
|
Py_INCREF(data->m_obj);
|
||||||
|
return data->m_obj;
|
||||||
|
} else {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Show(bool show);
|
||||||
|
bool IsShown();
|
||||||
|
void Move(wxDC& dc, double x1, double y1, bool display = TRUE);
|
||||||
|
void Erase(wxDC& dc);
|
||||||
|
void EraseContents(wxDC& dc);
|
||||||
|
void Draw(wxDC& dc);
|
||||||
|
void Flash();
|
||||||
|
void MoveLinks(wxDC& dc);
|
||||||
|
void DrawContents(wxDC& dc);
|
||||||
|
void SetSize(double x, double y, bool recursive = TRUE);
|
||||||
|
void SetAttachmentSize(double x, double y);
|
||||||
|
void Attach(wxPyShapeCanvas *can);
|
||||||
|
void Detach();
|
||||||
|
bool Constrain();
|
||||||
|
void AddLine(wxPyLineShape *line, wxPyShape *other,
|
||||||
|
int attachFrom = 0, int attachTo = 0,
|
||||||
|
int positionFrom = -1, int positionTo = -1);
|
||||||
|
int GetLinePosition(wxPyLineShape* line);
|
||||||
|
void AddText(const wxString& string);
|
||||||
|
wxPen *GetPen();
|
||||||
|
wxBrush *GetBrush();
|
||||||
|
void SetDefaultRegionSize();
|
||||||
|
void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
|
||||||
|
void SetFormatMode(int mode, int regionId = 0);
|
||||||
|
int GetFormatMode(int regionId = 0);
|
||||||
|
void SetFont(wxFont *font, int regionId = 0);
|
||||||
|
wxFont *GetFont(int regionId = 0);
|
||||||
|
void SetTextColour(const wxString& colour, int regionId = 0);
|
||||||
|
wxString GetTextColour(int regionId = 0);
|
||||||
|
int GetNumberOfTextRegions();
|
||||||
|
void SetRegionName(const wxString& name, int regionId = 0);
|
||||||
|
wxString GetRegionName(int regionId);
|
||||||
|
int GetRegionId(const wxString& name);
|
||||||
|
void NameRegions(const wxString& parentName = "");
|
||||||
|
|
||||||
|
// wxList& GetRegions();
|
||||||
|
%addmethods {
|
||||||
|
PyObject* GetRegions() {
|
||||||
|
wxList& list = self->GetRegions();
|
||||||
|
return wxPy_ConvertList(&list, "wxShapeRegion");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddRegion(wxShapeRegion *region);
|
||||||
|
void ClearRegions();
|
||||||
|
void AssignNewIds();
|
||||||
|
wxPyShape *FindRegion(const wxString& regionName, int *OUTPUT);
|
||||||
|
void FindRegionNames(wxStringList& list);
|
||||||
|
void ClearText(int regionId = 0);
|
||||||
|
void RemoveLine(wxPyLineShape *line);
|
||||||
|
|
||||||
|
#ifdef PROLOGIO
|
||||||
|
void WriteAttributes(wxExpr *clause);
|
||||||
|
void ReadAttributes(wxExpr *clause);
|
||||||
|
void ReadConstraints(wxExpr *clause, wxExprDatabase *database);
|
||||||
|
void WriteRegions(wxExpr *clause);
|
||||||
|
void ReadRegions(wxExpr *clause);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool GetAttachmentPosition(int attachment, double *OUTPUT, double *OUTPUT,
|
||||||
|
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
|
||||||
|
int GetNumberOfAttachments();
|
||||||
|
bool AttachmentIsValid(int attachment);
|
||||||
|
bool GetAttachmentPositionEdge(int attachment, double *OUTPUT, double *OUTPUT,
|
||||||
|
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
|
||||||
|
wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
|
||||||
|
int nth, int noArcs, wxPyLineShape* line);
|
||||||
|
bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
|
||||||
|
void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
|
||||||
|
void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
|
||||||
|
bool MoveLineToNewAttachment(wxDC& dc, wxPyLineShape *to_move,
|
||||||
|
double x, double y);
|
||||||
|
|
||||||
|
//void ApplyAttachmentOrdering(wxList& linesToSort);
|
||||||
|
%addmethods {
|
||||||
|
void ApplyAttachmentOrdering(PyObject* linesToSort) {
|
||||||
|
wxList* list = wxPy_wxListHelper(linesToSort, "_wxPyLineShape_p");
|
||||||
|
self->ApplyAttachmentOrdering(*list);
|
||||||
|
delete list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRealPoint GetBranchingAttachmentRoot(int attachment);
|
||||||
|
bool GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRealPoint& neck,
|
||||||
|
wxRealPoint& shoulder1, wxRealPoint& shoulder2);
|
||||||
|
bool GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& attachmentPoint,
|
||||||
|
wxRealPoint& stemPoint);
|
||||||
|
int GetAttachmentLineCount(int attachment);
|
||||||
|
void SetBranchNeckLength(int len);
|
||||||
|
int GetBranchNeckLength();
|
||||||
|
void SetBranchStemLength(int len);
|
||||||
|
int GetBranchStemLength();
|
||||||
|
void SetBranchSpacing(int len);
|
||||||
|
int GetBranchSpacing();
|
||||||
|
void SetBranchStyle(long style);
|
||||||
|
long GetBranchStyle();
|
||||||
|
int PhysicalToLogicalAttachment(int physicalAttachment);
|
||||||
|
int LogicalToPhysicalAttachment(int logicalAttachment);
|
||||||
|
bool Draggable();
|
||||||
|
bool HasDescendant(wxPyShape *image);
|
||||||
|
wxPyShape *CreateNewCopy(bool resetMapping = TRUE, bool recompute = TRUE);
|
||||||
|
void Copy(wxPyShape& copy);
|
||||||
|
void CopyWithHandler(wxPyShape& copy);
|
||||||
|
void Rotate(double x, double y, double theta);
|
||||||
|
double GetRotation();
|
||||||
|
void ClearAttachments();
|
||||||
|
void Recentre(wxDC& dc);
|
||||||
|
void ClearPointList(wxList& list);
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
791
wxPython/contrib/ogl/oglbasic.py
Normal file
@@ -0,0 +1,791 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import oglbasicc
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
import wx
|
||||||
|
from oglcanvas import wxPyShapeCanvasPtr
|
||||||
|
class wxShapeRegionPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def SetText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFont(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetFont,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMinSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetMinSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetProportions(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetProportions,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFormatMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetFormatMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetName(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetName,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFont(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetFont,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxFontPtr(val)
|
||||||
|
return val
|
||||||
|
def GetMinSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetMinSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetProportion(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetProportion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFormatMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetFormatMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetName(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetName,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetActualColourObject(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetActualColourObject,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxColourPtr(val)
|
||||||
|
return val
|
||||||
|
def GetFormattedText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetFormattedText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPenColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetPenColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPenStyle(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetPenStyle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetPenStyle(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetPenStyle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetPenColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_SetPenColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetActualPen(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetActualPen,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPenPtr(val)
|
||||||
|
return val
|
||||||
|
def GetWidth(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetWidth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetHeight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_GetHeight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxShapeRegion_ClearText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxShapeRegion instance at %s>" % (self.this,)
|
||||||
|
class wxShapeRegion(wxShapeRegionPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglbasicc.new_wxShapeRegion,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShapeEvtHandlerPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Destroy(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_Destroy,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_SetShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_GetShape,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def SetPreviousHandler(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_SetPreviousHandler,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPreviousHandler(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_GetPreviousHandler,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapeEvtHandlerPtr(val)
|
||||||
|
return val
|
||||||
|
def CreateNewCopy(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_CreateNewCopy,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapeEvtHandlerPtr(val)
|
||||||
|
return val
|
||||||
|
def base_OnDelete(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDelete,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyShapeEvtHandler instance at %s>" % (self.this,)
|
||||||
|
class wxPyShapeEvtHandler(wxPyShapeEvtHandlerPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglbasicc.new_wxPyShapeEvtHandler,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyShapeEvtHandler)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShapePtr(wxPyShapeEvtHandlerPtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Destroy(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Destroy,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBoundingBoxMax(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBoundingBoxMax,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBoundingBoxMin(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBoundingBoxMin,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPerimeterPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetPerimeterPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetCanvas,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapeCanvasPtr(val)
|
||||||
|
return val
|
||||||
|
def SetCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetCanvas,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddToCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AddToCanvas,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def InsertInCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_InsertInCanvas,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def RemoveFromCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_RemoveFromCanvas,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetX(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetX,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetY(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetY,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetX(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetX,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetY(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetY,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetParent(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetParent,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def SetParent(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetParent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetTopAncestor(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetTopAncestor,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def GetChildren(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetChildren,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Unlink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Unlink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetDrawHandles(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetDrawHandles,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetDrawHandles(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetDrawHandles,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MakeControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_MakeControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DeleteControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_DeleteControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ResetControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ResetControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEventHandler(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetEventHandler,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapeEvtHandlerPtr(val)
|
||||||
|
return val
|
||||||
|
def SetEventHandler(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetEventHandler,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MakeMandatoryControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_MakeMandatoryControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ResetMandatoryControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ResetMandatoryControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Recompute(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Recompute,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CalculateSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_CalculateSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Select(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Select,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IsHighlighted(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_IsHighlighted,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Selected(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Selected,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AncestorSelected(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AncestorSelected,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSensitivityFilter(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetSensitivityFilter,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSensitivityFilter(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetSensitivityFilter,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetDraggable(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetDraggable,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFixedSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetFixedSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFixedSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetFixedSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFixedWidth(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetFixedWidth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFixedHeight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetFixedHeight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSpaceAttachments(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetSpaceAttachments,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSpaceAttachments(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetSpaceAttachments,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetShadowMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetShadowMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetShadowMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetShadowMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def HitTest(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_HitTest,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetCentreResize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetCentreResize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetCentreResize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetCentreResize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMaintainAspectRatio(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetMaintainAspectRatio,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMaintainAspectRatio(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetMaintainAspectRatio,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLines(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetLines,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetDisableLabel(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetDisableLabel,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetDisableLabel(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetDisableLabel,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetAttachmentMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetAttachmentMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAttachmentMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetAttachmentMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetId(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetId,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetId(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetId,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetPen(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetPen,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBrush(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetBrush,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetClientData(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetClientData,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetClientData(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetClientData,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Show(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Show,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IsShown(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_IsShown,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Move(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Move,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Erase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Erase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_EraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Draw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Draw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Flash(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Flash,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_MoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_DrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetAttachmentSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetAttachmentSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Attach(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Attach,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Detach(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Detach,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Constrain(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Constrain,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AddLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLinePosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetLinePosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AddText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPen(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetPen,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPenPtr(val)
|
||||||
|
return val
|
||||||
|
def GetBrush(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBrush,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxBrushPtr(val)
|
||||||
|
return val
|
||||||
|
def SetDefaultRegionSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetDefaultRegionSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FormatText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_FormatText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFormatMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetFormatMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFormatMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetFormatMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFont(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetFont,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFont(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetFont,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxFontPtr(val)
|
||||||
|
return val
|
||||||
|
def SetTextColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetTextColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetTextColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetTextColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetNumberOfTextRegions(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetNumberOfTextRegions,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetRegionName(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetRegionName,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetRegionName(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetRegionName,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetRegionId(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetRegionId,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def NameRegions(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_NameRegions,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetRegions(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetRegions,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AddRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearRegions(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ClearRegions,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AssignNewIds(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AssignNewIds,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_FindRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindRegionNames(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_FindRegionNames,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearText(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ClearText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def RemoveLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_RemoveLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAttachmentPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetAttachmentPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetNumberOfAttachments(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetNumberOfAttachments,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AttachmentIsValid(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AttachmentIsValid,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAttachmentPositionEdge(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetAttachmentPositionEdge,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CalcSimpleAttachment(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_CalcSimpleAttachment,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxRealPointPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def AttachmentSortTest(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_AttachmentSortTest,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EraseLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_EraseLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DrawLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_DrawLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MoveLineToNewAttachment(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_MoveLineToNewAttachment,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ApplyAttachmentOrdering(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ApplyAttachmentOrdering,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBranchingAttachmentRoot(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchingAttachmentRoot,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxRealPointPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def GetBranchingAttachmentInfo(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchingAttachmentInfo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBranchingAttachmentPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchingAttachmentPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAttachmentLineCount(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetAttachmentLineCount,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBranchNeckLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetBranchNeckLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBranchNeckLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchNeckLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBranchStemLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetBranchStemLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBranchStemLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchStemLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBranchSpacing(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetBranchSpacing,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBranchSpacing(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchSpacing,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBranchStyle(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_SetBranchStyle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetBranchStyle(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetBranchStyle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def PhysicalToLogicalAttachment(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_PhysicalToLogicalAttachment,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def LogicalToPhysicalAttachment(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_LogicalToPhysicalAttachment,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Draggable(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Draggable,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def HasDescendant(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_HasDescendant,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CreateNewCopy(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_CreateNewCopy,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def Copy(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Copy,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CopyWithHandler(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_CopyWithHandler,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Rotate(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Rotate,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetRotation(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_GetRotation,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearAttachments(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ClearAttachments,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Recentre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_Recentre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearPointList(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_ClearPointList,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDelete(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDelete,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglbasicc.wxPyShape_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyShape instance at %s>" % (self.this,)
|
||||||
|
class wxPyShape(wxPyShapePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
2
wxPython/contrib/ogl/oglc.def
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
EXPORTS
|
||||||
|
initoglc
|
||||||
2447
wxPython/contrib/ogl/oglcanvas.cpp
Normal file
157
wxPython/contrib/ogl/oglcanvas.i
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: oglcanvas.i
|
||||||
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 7-Sept-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
%module oglcanvas
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "oglhelpers.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%import windows.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern misc.i
|
||||||
|
%extern gdi.i
|
||||||
|
|
||||||
|
%include _ogldefs.i
|
||||||
|
|
||||||
|
%extern oglbasic.i
|
||||||
|
|
||||||
|
|
||||||
|
%pragma(python) code = "import wx"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxDiagram {
|
||||||
|
public:
|
||||||
|
wxDiagram();
|
||||||
|
~wxDiagram();
|
||||||
|
|
||||||
|
void AddShape(wxPyShape*shape, wxPyShape *addAfter = NULL);
|
||||||
|
void Clear(wxDC& dc);
|
||||||
|
void DeleteAllShapes();
|
||||||
|
void DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2);
|
||||||
|
wxPyShape* FindShape(long id);
|
||||||
|
wxPyShapeCanvas* GetCanvas();
|
||||||
|
int GetCount();
|
||||||
|
double GetGridSpacing();
|
||||||
|
int GetMouseTolerance();
|
||||||
|
|
||||||
|
// wxList* GetShapeList();
|
||||||
|
%addmethods {
|
||||||
|
PyObject* GetShapeList() {
|
||||||
|
wxList* list = self->GetShapeList();
|
||||||
|
return wxPy_ConvertList(list, "wxPyShape");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetQuickEditMode();
|
||||||
|
bool GetSnapToGrid();
|
||||||
|
void InsertShape(wxPyShape *shape);
|
||||||
|
bool LoadFile(const wxString& filename);
|
||||||
|
|
||||||
|
// **** Have to deal with wxExpr and wxExprDatabase first...
|
||||||
|
//void OnDatabaseLoad(wxExprDatabase& database);
|
||||||
|
//void OnDatabaseSave(wxExprDatabase& database);
|
||||||
|
//bool OnHeaderLoad(wxExprDatabase& database, wxExpr& expr);
|
||||||
|
//bool OnHeaderSave(wxExprDatabase& database, wxExpr& expr);
|
||||||
|
//bool OnShapeLoad(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
|
||||||
|
//bool OnShapeSave(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
|
||||||
|
|
||||||
|
|
||||||
|
void ReadContainerGeometry(wxExprDatabase& database);
|
||||||
|
void ReadLines(wxExprDatabase& database);
|
||||||
|
void ReadNodes(wxExprDatabase& database);
|
||||||
|
void RecentreAll(wxDC& dc);
|
||||||
|
void Redraw(wxDC& dc);
|
||||||
|
void RemoveAllShapes();
|
||||||
|
void RemoveShape(wxPyShape* shape);
|
||||||
|
bool SaveFile(const wxString& filename);
|
||||||
|
void SetCanvas(wxPyShapeCanvas* canvas);
|
||||||
|
void SetGridSpacing(double spacing);
|
||||||
|
void SetMouseTolerance(int tolerance);
|
||||||
|
void SetQuickEditMode(bool mode);
|
||||||
|
void SetSnapToGrid(bool snap);
|
||||||
|
void ShowAll(bool show);
|
||||||
|
void Snap(double *OUTPUT, double *OUTPUT);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%{
|
||||||
|
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft);
|
||||||
|
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight);
|
||||||
|
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragLeft);
|
||||||
|
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragRight);
|
||||||
|
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragLeft);
|
||||||
|
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragRight);
|
||||||
|
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnLeftClick);
|
||||||
|
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnRightClick);
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShapeCanvas : public wxScrolledWindow {
|
||||||
|
public:
|
||||||
|
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
|
||||||
|
const wxPoint& pos = wxPyDefaultPosition,
|
||||||
|
const wxSize& size = wxPyDefaultSize,
|
||||||
|
long style = wxBORDER);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShapeCanvas)"
|
||||||
|
|
||||||
|
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
|
||||||
|
%pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
|
||||||
|
|
||||||
|
void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL);
|
||||||
|
|
||||||
|
// **** Need a typemap for wxClassInfo, or implement wxObject, etc.....
|
||||||
|
wxPyShape* FindShape(double x1, double y, int *OUTPUT,
|
||||||
|
wxClassInfo *info = NULL, wxPyShape* notImage = NULL);
|
||||||
|
|
||||||
|
wxPyShape * FindFirstSensitiveShape(double x1, double y, int *OUTPUT, int op);
|
||||||
|
wxDiagram* GetDiagram();
|
||||||
|
|
||||||
|
bool GetQuickEditMode();
|
||||||
|
void InsertShape(wxPyShape* shape);
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys = 0);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys = 0);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0);
|
||||||
|
|
||||||
|
void Redraw(wxDC& dc);
|
||||||
|
void RemoveShape(wxPyShape *shape);
|
||||||
|
void SetDiagram(wxDiagram *diagram);
|
||||||
|
void Snap(double *OUTPUT, double *OUTPUT);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
226
wxPython/contrib/ogl/oglcanvas.py
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import oglcanvasc
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
import wx
|
||||||
|
class wxDiagramPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self,oglcanvasc=oglcanvasc):
|
||||||
|
if self.thisown == 1 :
|
||||||
|
oglcanvasc.delete_wxDiagram(self)
|
||||||
|
def AddShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_AddShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Clear(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_Clear,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DeleteAllShapes(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_DeleteAllShapes,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_DrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_FindShape,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def GetCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetCanvas,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapeCanvasPtr(val)
|
||||||
|
return val
|
||||||
|
def GetCount(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetCount,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetGridSpacing(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetGridSpacing,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMouseTolerance(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetMouseTolerance,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetShapeList(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetShapeList,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetQuickEditMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetQuickEditMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSnapToGrid(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_GetSnapToGrid,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def InsertShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_InsertShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def LoadFile(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_LoadFile,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ReadContainerGeometry(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_ReadContainerGeometry,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ReadLines(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_ReadLines,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ReadNodes(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_ReadNodes,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def RecentreAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_RecentreAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Redraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_Redraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def RemoveAllShapes(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_RemoveAllShapes,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def RemoveShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_RemoveShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SaveFile(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_SaveFile,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetCanvas(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_SetCanvas,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetGridSpacing(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_SetGridSpacing,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMouseTolerance(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_SetMouseTolerance,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetQuickEditMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_SetQuickEditMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSnapToGrid(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_SetSnapToGrid,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ShowAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_ShowAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Snap(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxDiagram_Snap,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxDiagram instance at %s>" % (self.this,)
|
||||||
|
class wxDiagram(wxDiagramPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglcanvasc.new_wxDiagram,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShapeCanvasPtr(wxScrolledWindowPtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_AddShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_FindShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindFirstSensitiveShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_FindFirstSensitiveShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetDiagram(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_GetDiagram,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxDiagramPtr(val)
|
||||||
|
return val
|
||||||
|
def GetQuickEditMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_GetQuickEditMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def InsertShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_InsertShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Redraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_Redraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def RemoveShape(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_RemoveShape,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetDiagram(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_SetDiagram,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Snap(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglcanvasc.wxPyShapeCanvas_Snap,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyShapeCanvas instance at %s>" % (self.this,)
|
||||||
|
class wxPyShapeCanvas(wxPyShapeCanvasPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyShapeCanvas)
|
||||||
|
wx._StdWindowCallbacks(self)
|
||||||
|
wx._StdOnScrollCallbacks(self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
103
wxPython/contrib/ogl/oglhelpers.cpp
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
262
wxPython/contrib/ogl/oglhelpers.h
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: oglhelpers.h
|
||||||
|
// Purpose: Some Helper functions to help in data conversions in OGL
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 9-Sept-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef __wxp_ogl_helpers__
|
||||||
|
#define __wxp_ogl_helpers__
|
||||||
|
|
||||||
|
|
||||||
|
#include <wx/ogl/ogl.h>
|
||||||
|
#include <wx/ogl/basicp.h>
|
||||||
|
#include <wx/ogl/constrnt.h>
|
||||||
|
#include <wx/ogl/bmpshape.h>
|
||||||
|
#include <wx/ogl/drawn.h>
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
// Define a macro that will be used in the class definintions below
|
||||||
|
|
||||||
|
#define WXSHAPE_DEC_CALLBACKS() \
|
||||||
|
DEC_PYCALLBACK__ (OnDelete); \
|
||||||
|
DEC_PYCALLBACK__DC (OnDraw); \
|
||||||
|
DEC_PYCALLBACK__DC (OnDrawContents); \
|
||||||
|
DEC_PYCALLBACK__DCBOOL (OnDrawBranches); \
|
||||||
|
DEC_PYCALLBACK__DC (OnMoveLinks); \
|
||||||
|
DEC_PYCALLBACK__DC (OnErase); \
|
||||||
|
DEC_PYCALLBACK__DC (OnEraseContents); \
|
||||||
|
DEC_PYCALLBACK__DC (OnHighlight); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnLeftClick); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnLeftDoubleClick); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnRightClick); \
|
||||||
|
DEC_PYCALLBACK__2DBL (OnSize); \
|
||||||
|
DEC_PYCALLBACK_BOOL_DC4DBLBOOL (OnMovePre); \
|
||||||
|
DEC_PYCALLBACK__DC4DBLBOOL (OnMovePost); \
|
||||||
|
DEC_PYCALLBACK__BOOL2DBL2INT (OnDragLeft); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnBeginDragLeft); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnEndDragLeft); \
|
||||||
|
DEC_PYCALLBACK__BOOL2DBL2INT (OnDragRight); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnBeginDragRight); \
|
||||||
|
DEC_PYCALLBACK__2DBL2INT (OnEndDragRight); \
|
||||||
|
DEC_PYCALLBACK__DC4DBL (OnDrawOutline); \
|
||||||
|
DEC_PYCALLBACK__DC (OnDrawControlPoints); \
|
||||||
|
DEC_PYCALLBACK__DC (OnEraseControlPoints); \
|
||||||
|
DEC_PYCALLBACK__DCBOOL (OnMoveLink); \
|
||||||
|
DEC_PYCALLBACK__WXCPBOOL2DBL2INT(OnSizingDragLeft); \
|
||||||
|
DEC_PYCALLBACK__WXCP2DBL2INT (OnSizingBeginDragLeft);\
|
||||||
|
DEC_PYCALLBACK__WXCP2DBL2INT (OnSizingEndDragLeft); \
|
||||||
|
DEC_PYCALLBACK__2DBL (OnBeginSize); \
|
||||||
|
DEC_PYCALLBACK__2DBL (OnEndSize); \
|
||||||
|
\
|
||||||
|
PYPRIVATE;
|
||||||
|
|
||||||
|
|
||||||
|
#define WXSHAPE_IMP_CALLBACKS(CLASS, PARENT) \
|
||||||
|
IMP_PYCALLBACK__ (CLASS, PARENT, OnDelete); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDraw); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDrawContents); \
|
||||||
|
IMP_PYCALLBACK__DCBOOL (CLASS, PARENT, OnDrawBranches); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnMoveLinks); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnErase); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnEraseContents); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnHighlight); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnLeftClick); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnLeftDoubleClick); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnRightClick); \
|
||||||
|
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnSize); \
|
||||||
|
IMP_PYCALLBACK_BOOL_DC4DBLBOOL (CLASS, PARENT, OnMovePre); \
|
||||||
|
IMP_PYCALLBACK__DC4DBLBOOL (CLASS, PARENT, OnMovePost); \
|
||||||
|
IMP_PYCALLBACK__BOOL2DBL2INT (CLASS, PARENT, OnDragLeft); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnBeginDragLeft); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnEndDragLeft); \
|
||||||
|
IMP_PYCALLBACK__BOOL2DBL2INT (CLASS, PARENT, OnDragRight); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnBeginDragRight); \
|
||||||
|
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnEndDragRight); \
|
||||||
|
IMP_PYCALLBACK__DC4DBL (CLASS, PARENT, OnDrawOutline); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDrawControlPoints); \
|
||||||
|
IMP_PYCALLBACK__DC (CLASS, PARENT, OnEraseControlPoints); \
|
||||||
|
IMP_PYCALLBACK__DCBOOL (CLASS, PARENT, OnMoveLink); \
|
||||||
|
IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PARENT, OnSizingDragLeft); \
|
||||||
|
IMP_PYCALLBACK__WXCP2DBL2INT (CLASS, PARENT, OnSizingBeginDragLeft);\
|
||||||
|
IMP_PYCALLBACK__WXCP2DBL2INT (CLASS, PARENT, OnSizingEndDragLeft); \
|
||||||
|
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnBeginSize); \
|
||||||
|
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnEndSize); \
|
||||||
|
|
||||||
|
|
||||||
|
// This one may be difficult...
|
||||||
|
//PYCALLBACK__??????? (PARENT, OnChangeAttachment);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
// These are prototypes of some helper functions found in oglhelpers.cpp
|
||||||
|
|
||||||
|
wxList* wxPy_wxListHelper(PyObject* pyList, char* className);
|
||||||
|
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
// Classes that derive from the shapes and such, but which know how to turn
|
||||||
|
// virtual callbacks into Python callbacks.
|
||||||
|
|
||||||
|
class wxPyShapeCanvas : public wxShapeCanvas {
|
||||||
|
public:
|
||||||
|
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
|
||||||
|
const wxPoint& pos = wxPyDefaultPosition,
|
||||||
|
const wxSize& size = wxPyDefaultSize,
|
||||||
|
long style = wxBORDER)
|
||||||
|
: wxShapeCanvas(parent, id, pos, size, style) {}
|
||||||
|
|
||||||
|
DEC_PYCALLBACK__2DBLINT(OnBeginDragLeft);
|
||||||
|
DEC_PYCALLBACK__2DBLINT(OnBeginDragRight);
|
||||||
|
DEC_PYCALLBACK__2DBLINT(OnEndDragLeft);
|
||||||
|
DEC_PYCALLBACK__2DBLINT(OnEndDragRight);
|
||||||
|
DEC_PYCALLBACK__BOOL2DBLINT(OnDragLeft);
|
||||||
|
DEC_PYCALLBACK__BOOL2DBLINT(OnDragRight);
|
||||||
|
DEC_PYCALLBACK__2DBLINT(OnLeftClick);
|
||||||
|
DEC_PYCALLBACK__2DBLINT(OnRightClick);
|
||||||
|
|
||||||
|
PYPRIVATE;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShapeEvtHandler : public wxShapeEvtHandler {
|
||||||
|
public:
|
||||||
|
wxPyShapeEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL)
|
||||||
|
: wxShapeEvtHandler(prev, shape) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyShape : public wxShape {
|
||||||
|
public:
|
||||||
|
wxPyShape(wxPyShapeCanvas *can = NULL)
|
||||||
|
: wxShape(can) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyRectangleShape : public wxRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyRectangleShape(double width = 0.0, double height = 0.0)
|
||||||
|
: wxRectangleShape(width, height) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
class wxPyControlPoint : public wxControlPoint {
|
||||||
|
public:
|
||||||
|
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
|
||||||
|
wxPyShape *object = NULL,
|
||||||
|
double size = 0.0, double the_xoffset = 0.0,
|
||||||
|
double the_yoffset = 0.0, int the_type = 0)
|
||||||
|
: wxControlPoint(the_canvas, object, size,
|
||||||
|
the_xoffset, the_yoffset, the_type) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyBitmapShape : public wxBitmapShape {
|
||||||
|
public:
|
||||||
|
wxPyBitmapShape() : wxBitmapShape() {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyDrawnShape : public wxDrawnShape {
|
||||||
|
public:
|
||||||
|
wxPyDrawnShape() : wxDrawnShape() {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyCompositeShape : public wxCompositeShape {
|
||||||
|
public:
|
||||||
|
wxPyCompositeShape() : wxCompositeShape() {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyDividedShape : public wxDividedShape {
|
||||||
|
public:
|
||||||
|
wxPyDividedShape(double width = 0.0, double height = 0.0)
|
||||||
|
: wxDividedShape(width, height) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyDivisionShape : public wxDivisionShape {
|
||||||
|
public:
|
||||||
|
wxPyDivisionShape() : wxDivisionShape() {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyEllipseShape : public wxEllipseShape {
|
||||||
|
public:
|
||||||
|
wxPyEllipseShape(double width = 0.0, double height = 0.0)
|
||||||
|
: wxEllipseShape(width, height) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyCircleShape : public wxCircleShape {
|
||||||
|
public:
|
||||||
|
wxPyCircleShape(double width = 0.0)
|
||||||
|
: wxCircleShape(width) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyLineShape : public wxLineShape {
|
||||||
|
public:
|
||||||
|
wxPyLineShape() : wxLineShape() {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyPolygonShape : public wxPolygonShape {
|
||||||
|
public:
|
||||||
|
wxPyPolygonShape() : wxPolygonShape() {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyTextShape : public wxTextShape {
|
||||||
|
public:
|
||||||
|
wxPyTextShape(double width = 0.0, double height = 0.0)
|
||||||
|
: wxTextShape(width, height) {}
|
||||||
|
|
||||||
|
WXSHAPE_DEC_CALLBACKS();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
#endif
|
||||||
|
|
||||||
13039
wxPython/contrib/ogl/oglshapes.cpp
Normal file
574
wxPython/contrib/ogl/oglshapes.i
Normal file
@@ -0,0 +1,574 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: oglshapes.i
|
||||||
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 3-Sept-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
%module oglshapes
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "oglhelpers.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%import windows.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern misc.i
|
||||||
|
%extern gdi.i
|
||||||
|
|
||||||
|
%include _ogldefs.i
|
||||||
|
|
||||||
|
%import oglbasic.i
|
||||||
|
|
||||||
|
|
||||||
|
%pragma(python) code = "import wx"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxPseudoMetaFile {
|
||||||
|
public:
|
||||||
|
wxPseudoMetaFile();
|
||||||
|
~wxPseudoMetaFile();
|
||||||
|
|
||||||
|
void Draw(wxDC& dc, double xoffset, double yoffset);
|
||||||
|
|
||||||
|
void WriteAttributes(wxExpr *clause, int whichAngle);
|
||||||
|
void ReadAttributes(wxExpr *clause, int whichAngle);
|
||||||
|
void Clear();
|
||||||
|
void Copy(wxPseudoMetaFile& copy);
|
||||||
|
void Scale(double sx, double sy);
|
||||||
|
void ScaleTo(double w, double h);
|
||||||
|
void Translate(double x, double y);
|
||||||
|
void Rotate(double x, double y, double theta);
|
||||||
|
bool LoadFromMetaFile(char* filename, double *width, double *height);
|
||||||
|
void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
|
||||||
|
void CalculateSize(wxDrawnShape* shape);
|
||||||
|
|
||||||
|
// **** fix these... is it even possible? these are lists of various GDI opperations (not the objects...)
|
||||||
|
// wxList& GetOutlineColours();
|
||||||
|
// wxList& GetFillColours();
|
||||||
|
// wxList& GetOps();
|
||||||
|
|
||||||
|
void SetRotateable(bool rot);
|
||||||
|
bool GetRotateable();
|
||||||
|
void SetSize(double w, double h);
|
||||||
|
void SetFillBrush(wxBrush* brush);
|
||||||
|
wxBrush* GetFillBrush();
|
||||||
|
void SetOutlinePen(wxPen* pen);
|
||||||
|
wxPen* GetOutlinePen();
|
||||||
|
void SetOutlineOp(int op);
|
||||||
|
int GetOutlineOp();
|
||||||
|
|
||||||
|
|
||||||
|
bool IsValid();
|
||||||
|
void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
|
||||||
|
void DrawRectangle(const wxRect& rect);
|
||||||
|
void DrawRoundedRectangle(const wxRect& rect, double radius);
|
||||||
|
void DrawArc(const wxPoint& centrePt, const wxPoint& startPt, const wxPoint& endPt);
|
||||||
|
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
|
||||||
|
void DrawEllipse(const wxRect& rect);
|
||||||
|
void DrawPoint(const wxPoint& pt);
|
||||||
|
void DrawText(const wxString& text, const wxPoint& pt);
|
||||||
|
void DrawLines(int PCOUNT, wxPoint* points);
|
||||||
|
void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
|
||||||
|
void DrawSpline(int PCOUNT, wxPoint* points);
|
||||||
|
void SetClippingRect(const wxRect& rect);
|
||||||
|
void DestroyClippingRect();
|
||||||
|
void SetPen(wxPen* pen, bool isOutline = FALSE);
|
||||||
|
void SetBrush(wxBrush* brush, bool isFill = FALSE);
|
||||||
|
void SetFont(wxFont* font);
|
||||||
|
void SetTextColour(const wxColour& colour);
|
||||||
|
void SetBackgroundColour(const wxColour& colour);
|
||||||
|
void SetBackgroundMode(int mode);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyRectangleShape, wxRectangleShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyRectangleShape : public wxPyShape {
|
||||||
|
public:
|
||||||
|
wxPyRectangleShape(double width = 0.0, double height = 0.0);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyRectangleShape)"
|
||||||
|
|
||||||
|
void SetCornerRadius(double radius);
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyControlPoint, wxControlPoint);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyControlPoint : public wxPyRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
|
||||||
|
wxPyShape *object = NULL,
|
||||||
|
double size = 0.0, double the_xoffset = 0.0,
|
||||||
|
double the_yoffset = 0.0, int the_type = 0);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyControlPoint)"
|
||||||
|
|
||||||
|
void SetCornerRadius(double radius);
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyBitmapShape, wxBitmapShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyBitmapShape : public wxPyRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyBitmapShape();
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyBitmapShape)"
|
||||||
|
|
||||||
|
wxBitmap& GetBitmap();
|
||||||
|
wxString GetFilename();
|
||||||
|
void SetBitmap(const wxBitmap& bitmap);
|
||||||
|
void SetFilename(const wxString& filename);
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyDrawnShape, wxDrawnShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyDrawnShape : public wxPyRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyDrawnShape();
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyDrawnShape)"
|
||||||
|
|
||||||
|
void CalculateSize();
|
||||||
|
void DestroyClippingRect();
|
||||||
|
void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint,
|
||||||
|
const wxPoint& endPoint);
|
||||||
|
void DrawAtAngle(int angle);
|
||||||
|
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
|
||||||
|
void DrawLine(const wxPoint& point1, const wxPoint& point2);
|
||||||
|
void DrawLines(int PCOUNT, wxPoint* points);
|
||||||
|
void DrawPoint(const wxPoint& point);
|
||||||
|
void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
|
||||||
|
void DrawRectangle(const wxRect& rect);
|
||||||
|
void DrawRoundedRectangle(const wxRect& rect, double radius);
|
||||||
|
void DrawSpline(int PCOUNT, wxPoint* points);
|
||||||
|
void DrawText(const wxString& text, const wxPoint& point);
|
||||||
|
int GetAngle();
|
||||||
|
|
||||||
|
wxPseudoMetaFile& GetMetaFile();
|
||||||
|
|
||||||
|
double GetRotation();
|
||||||
|
bool LoadFromMetaFile(char * filename);
|
||||||
|
void Rotate(double x, double y, double theta);
|
||||||
|
void SetClippingRect(const wxRect& rect);
|
||||||
|
void SetDrawnBackgroundColour(const wxColour& colour);
|
||||||
|
void SetDrawnBackgroundMode(int mode);
|
||||||
|
void SetDrawnBrush(wxBrush* pen, bool isOutline = FALSE);
|
||||||
|
void SetDrawnFont(wxFont* font);
|
||||||
|
void SetDrawnPen(wxPen* pen, bool isOutline = FALSE);
|
||||||
|
void SetDrawnTextColour(const wxColour& colour);
|
||||||
|
void Scale(double sx, double sy);
|
||||||
|
void SetSaveToFile(bool save);
|
||||||
|
void Translate(double x, double y);
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxOGLConstraint {
|
||||||
|
public:
|
||||||
|
//wxOGLConstraint(int type, wxPyShape *constraining, wxList& constrained);
|
||||||
|
%addmethods {
|
||||||
|
wxOGLConstraint(int type, wxPyShape *constraining, PyObject* constrained) {
|
||||||
|
wxList* list = wxPy_wxListHelper(constrained, "_wxPyShape_p");
|
||||||
|
wxOGLConstraint* rv = new wxOGLConstraint(type, constraining, *list);
|
||||||
|
delete list;
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~wxOGLConstraint();
|
||||||
|
|
||||||
|
bool Evaluate();
|
||||||
|
void SetSpacing(double x, double y);
|
||||||
|
bool Equals(double a, double b);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyCompositeShape, wxCompositeShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyCompositeShape : public wxPyRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyCompositeShape();
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyCompositeShape)"
|
||||||
|
|
||||||
|
void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL);
|
||||||
|
|
||||||
|
wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint);
|
||||||
|
|
||||||
|
|
||||||
|
//wxOGLConstraint * AddConstraint(int type,
|
||||||
|
// wxPyShape *constraining,
|
||||||
|
// wxList& constrained);
|
||||||
|
%addmethods {
|
||||||
|
wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining,
|
||||||
|
PyObject* constrained) {
|
||||||
|
wxList* list = wxPy_wxListHelper(constrained, "_wxPyShape_p");
|
||||||
|
wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
|
||||||
|
delete list;
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type,
|
||||||
|
wxPyShape *constraining,
|
||||||
|
wxPyShape *constrained);
|
||||||
|
|
||||||
|
void CalculateSize();
|
||||||
|
bool ContainsDivision(wxPyDivisionShape *division);
|
||||||
|
void DeleteConstraint(wxOGLConstraint *constraint);
|
||||||
|
void DeleteConstraintsInvolvingChild(wxPyShape *child);
|
||||||
|
|
||||||
|
// **** Needs an output typemap
|
||||||
|
//wxOGLConstraint * FindConstraint(long id, wxPyCompositeShape **actualComposite);
|
||||||
|
|
||||||
|
wxPyShape * FindContainerImage();
|
||||||
|
|
||||||
|
// wxList& GetConstraints();
|
||||||
|
// wxList& GetDivisions();
|
||||||
|
%addmethods {
|
||||||
|
PyObject* GetConstraints() {
|
||||||
|
wxList& list = self->GetConstraints();
|
||||||
|
return wxPy_ConvertList(&list, "wxOGLConstraint");
|
||||||
|
}
|
||||||
|
|
||||||
|
PyObject* GetDivisions() {
|
||||||
|
wxList& list = self->GetDivisions();
|
||||||
|
return wxPy_ConvertList(&list, "wxPyDivisionShape");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MakeContainer();
|
||||||
|
bool Recompute();
|
||||||
|
void RemoveChild(wxPyShape *child);
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyDividedShape, wxDividedShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyDividedShape : public wxPyRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyDividedShape(double width = 0.0, double height = 0.0);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyDividedShape)"
|
||||||
|
|
||||||
|
void EditRegions();
|
||||||
|
void SetRegionSizes();
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyDivisionShape, wxDivisionShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyDivisionShape : public wxPyCompositeShape {
|
||||||
|
public:
|
||||||
|
wxPyDivisionShape();
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyDivisionShape)"
|
||||||
|
|
||||||
|
void AdjustBottom(double bottom, bool test);
|
||||||
|
void AdjustLeft(double left, bool test);
|
||||||
|
void AdjustRight(double right, bool test);
|
||||||
|
void AdjustTop(double top, bool test);
|
||||||
|
void Divide(int direction);
|
||||||
|
void EditEdge(int side);
|
||||||
|
wxPyDivisionShape * GetBottomSide();
|
||||||
|
int GetHandleSide();
|
||||||
|
wxPyDivisionShape * GetLeftSide();
|
||||||
|
wxString GetLeftSideColour();
|
||||||
|
wxPen * GetLeftSidePen();
|
||||||
|
wxPyDivisionShape * GetRightSide();
|
||||||
|
wxPyDivisionShape * GetTopSide();
|
||||||
|
wxPen * GetTopSidePen();
|
||||||
|
void ResizeAdjoining(int side, double newPos, bool test);
|
||||||
|
void PopupMenu(double x, double y);
|
||||||
|
void SetBottomSide(wxPyDivisionShape *shape);
|
||||||
|
void SetHandleSide(int side);
|
||||||
|
void SetLeftSide(wxPyDivisionShape *shape);
|
||||||
|
void SetLeftSideColour(const wxString& colour);
|
||||||
|
void SetLeftSidePen(wxPen *pen);
|
||||||
|
void SetRightSide(wxPyDivisionShape *shape);
|
||||||
|
void SetTopSide(wxPyDivisionShape *shape);
|
||||||
|
void SetTopSideColour(const wxString& colour);
|
||||||
|
void SetTopSidePen(wxPen *pen);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
1187
wxPython/contrib/ogl/oglshapes.py
Normal file
8382
wxPython/contrib/ogl/oglshapes2.cpp
Normal file
369
wxPython/contrib/ogl/oglshapes2.i
Normal file
@@ -0,0 +1,369 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: oglshapes2.i
|
||||||
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 3-Sept-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
%module oglshapes2
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "oglhelpers.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%import windows.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern misc.i
|
||||||
|
%extern gdi.i
|
||||||
|
|
||||||
|
%include _ogldefs.i
|
||||||
|
|
||||||
|
%import oglbasic.i
|
||||||
|
%import oglshapes.i
|
||||||
|
|
||||||
|
|
||||||
|
%pragma(python) code = "import wx"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyEllipseShape : public wxPyShape {
|
||||||
|
public:
|
||||||
|
wxPyEllipseShape(double width = 0.0, double height = 0.0);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyEllipseShape)"
|
||||||
|
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyCircleShape : public wxPyEllipseShape {
|
||||||
|
public:
|
||||||
|
wxPyCircleShape(double width = 0.0);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyCircleShape)"
|
||||||
|
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
class wxArrowHead {
|
||||||
|
public:
|
||||||
|
wxArrowHead(int type = 0,
|
||||||
|
int end = 0,
|
||||||
|
double size = 0.0,
|
||||||
|
double dist = 0.0,
|
||||||
|
const char * name = "",
|
||||||
|
wxPseudoMetaFile *mf = NULL,
|
||||||
|
long arrowId = -1);
|
||||||
|
~wxArrowHead();
|
||||||
|
|
||||||
|
int _GetType();
|
||||||
|
int GetPosition();
|
||||||
|
void SetPosition(int pos);
|
||||||
|
double GetXOffset();
|
||||||
|
double GetYOffset();
|
||||||
|
double GetSpacing();
|
||||||
|
double GetSize();
|
||||||
|
wxString GetName();
|
||||||
|
void SetXOffset(double x);
|
||||||
|
void SetYOffset(double y);
|
||||||
|
wxPseudoMetaFile *GetMetaFile();
|
||||||
|
long GetId();
|
||||||
|
int GetArrowEnd();
|
||||||
|
double GetArrowSize();
|
||||||
|
void SetSize(double size);
|
||||||
|
void SetSpacing(double sp);
|
||||||
|
};
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyLineShape, wxLineShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyLineShape : public wxPyShape {
|
||||||
|
public:
|
||||||
|
wxPyLineShape();
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyLineShape)"
|
||||||
|
|
||||||
|
void AddArrow(int type, int end = ARROW_POSITION_END,
|
||||||
|
double arrowSize = 10.0, double xOffset = 0.0,
|
||||||
|
char* name = "", wxPseudoMetaFile *mf = NULL,
|
||||||
|
long arrowId = -1);
|
||||||
|
|
||||||
|
//void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
|
||||||
|
%addmethods {
|
||||||
|
void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
|
||||||
|
wxList* list = wxPy_wxListHelper(referenceList, "_wxArrowHead_p");
|
||||||
|
self->AddArrowOrdered(arrow, *list, end);
|
||||||
|
delete list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool ClearArrow(const wxString& name);
|
||||||
|
void ClearArrowsAtPosition(int position = -1);
|
||||||
|
void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset);
|
||||||
|
%name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId);
|
||||||
|
bool DeleteArrowHead(int position, const wxString& name);
|
||||||
|
bool DeleteLineControlPoint();
|
||||||
|
void DrawArrows(wxDC& dc);
|
||||||
|
void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
|
||||||
|
void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
|
||||||
|
%name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId);
|
||||||
|
wxArrowHead * FindArrowHead(int position, const wxString& name);
|
||||||
|
void FindLineEndPoints(double *OUTPUT, double *OUTPUT,
|
||||||
|
double *OUTPUT, double *OUTPUT);
|
||||||
|
int FindLinePosition(double x, double y);
|
||||||
|
double FindMinimumWidth();
|
||||||
|
void FindNth(wxPyShape *image, int *OUTPUT, int *OUTPUT, bool incoming);
|
||||||
|
int GetAttachmentFrom();
|
||||||
|
int GetAttachmentTo();
|
||||||
|
void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
|
||||||
|
wxPyShape * GetFrom();
|
||||||
|
void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
|
||||||
|
wxPoint * GetNextControlPoint(wxPyShape *shape);
|
||||||
|
wxPyShape * GetTo();
|
||||||
|
void Initialise();
|
||||||
|
void InsertLineControlPoint(wxDC* dc);
|
||||||
|
bool IsEnd(wxPyShape *shape);
|
||||||
|
bool IsSpline();
|
||||||
|
void MakeLineControlPoints(int n);
|
||||||
|
|
||||||
|
void SetAttachmentFrom(int fromAttach);
|
||||||
|
void SetAttachments(int fromAttach, int toAttach);
|
||||||
|
void SetAttachmentTo(int toAttach);
|
||||||
|
void SetEnds(double x1, double y1, double x2, double y2);
|
||||||
|
void SetFrom(wxPyShape *object);
|
||||||
|
void SetIgnoreOffsets(bool ignore);
|
||||||
|
void SetSpline(bool spline);
|
||||||
|
void SetTo(wxPyShape *object);
|
||||||
|
void Straighten(wxDC* dc = NULL);
|
||||||
|
void Unlink();
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyPolygonShape : public wxPyShape {
|
||||||
|
public:
|
||||||
|
wxPyPolygonShape();
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyPolygonShape)"
|
||||||
|
|
||||||
|
|
||||||
|
// void Create(wxList* points);
|
||||||
|
%addmethods {
|
||||||
|
PyObject* Create(PyObject* points) {
|
||||||
|
wxList* list = wxPy_wxRealPoint_ListHelper(points);
|
||||||
|
if (list) {
|
||||||
|
self->Create(list);
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
else return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolygonPoint(int pos = 0);
|
||||||
|
void CalculatePolygonCentre();
|
||||||
|
void DeletePolygonPoint(int pos = 0);
|
||||||
|
|
||||||
|
// wxList* GetPoints();
|
||||||
|
%addmethods {
|
||||||
|
PyObject* GetPoints() {
|
||||||
|
wxList* list = self->GetPoints();
|
||||||
|
return wxPy_ConvertList(list, "wxRealPoint");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateOriginalPoints();
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
};
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
%{
|
||||||
|
WXSHAPE_IMP_CALLBACKS(wxPyTextShape, wxTextShape);
|
||||||
|
%}
|
||||||
|
|
||||||
|
class wxPyTextShape : public wxPyRectangleShape {
|
||||||
|
public:
|
||||||
|
wxPyTextShape(double width = 0.0, double height = 0.0);
|
||||||
|
|
||||||
|
void _setSelf(PyObject* self, PyObject* _class);
|
||||||
|
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyTextShape)"
|
||||||
|
|
||||||
|
|
||||||
|
void base_OnDelete();
|
||||||
|
void base_OnDraw(wxDC& dc);
|
||||||
|
void base_OnDrawContents(wxDC& dc);
|
||||||
|
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
|
||||||
|
void base_OnMoveLinks(wxDC& dc);
|
||||||
|
void base_OnErase(wxDC& dc);
|
||||||
|
void base_OnEraseContents(wxDC& dc);
|
||||||
|
void base_OnHighlight(wxDC& dc);
|
||||||
|
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||||
|
void base_OnSize(double x, double y);
|
||||||
|
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
|
||||||
|
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
|
||||||
|
void base_OnDrawControlPoints(wxDC& dc);
|
||||||
|
void base_OnEraseControlPoints(wxDC& dc);
|
||||||
|
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
|
||||||
|
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||||
|
void base_OnBeginSize(double w, double h);
|
||||||
|
void base_OnEndSize(double w, double h);
|
||||||
|
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
|
||||||
|
|
||||||
|
};
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
768
wxPython/contrib/ogl/oglshapes2.py
Normal file
@@ -0,0 +1,768 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import oglshapes2c
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
|
||||||
|
from oglbasic import *
|
||||||
|
|
||||||
|
from oglshapes import *
|
||||||
|
import wx
|
||||||
|
class wxPyEllipseShapePtr(wxPyShapePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyEllipseShape instance at %s>" % (self.this,)
|
||||||
|
class wxPyEllipseShape(wxPyEllipseShapePtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglshapes2c.new_wxPyEllipseShape,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyEllipseShape)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyCircleShapePtr(wxPyEllipseShapePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyCircleShape_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyCircleShape instance at %s>" % (self.this,)
|
||||||
|
class wxPyCircleShape(wxPyCircleShapePtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglshapes2c.new_wxPyCircleShape,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyCircleShape)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxArrowHeadPtr :
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self,oglshapes2c=oglshapes2c):
|
||||||
|
if self.thisown == 1 :
|
||||||
|
oglshapes2c.delete_wxArrowHead(self)
|
||||||
|
def _GetType(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead__GetType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_SetPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetXOffset(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetXOffset,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetYOffset(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetYOffset,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSpacing(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetSpacing,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetName(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetName,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetXOffset(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_SetXOffset,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetYOffset(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_SetYOffset,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMetaFile(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetMetaFile,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPseudoMetaFilePtr(val)
|
||||||
|
return val
|
||||||
|
def GetId(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetId,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetArrowEnd(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetArrowEnd,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetArrowSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_GetArrowSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_SetSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSpacing(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxArrowHead_SetSpacing,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxArrowHead instance at %s>" % (self.this,)
|
||||||
|
class wxArrowHead(wxArrowHeadPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglshapes2c.new_wxArrowHead,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyLineShapePtr(wxPyShapePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddArrow(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_AddArrow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddArrowOrdered(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_AddArrowOrdered,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearArrow(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_ClearArrow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearArrowsAtPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_ClearArrowsAtPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DrawArrow(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_DrawArrow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DeleteArrowHeadId(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_DeleteArrowHeadId,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DeleteArrowHead(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_DeleteArrowHead,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DeleteLineControlPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_DeleteLineControlPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DrawArrows(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_DrawArrows,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DrawRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_DrawRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EraseRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_EraseRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindArrowHeadId(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_FindArrowHeadId,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxArrowHeadPtr(val)
|
||||||
|
return val
|
||||||
|
def FindArrowHead(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_FindArrowHead,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxArrowHeadPtr(val)
|
||||||
|
return val
|
||||||
|
def FindLineEndPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_FindLineEndPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindLinePosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_FindLinePosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindMinimumWidth(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_FindMinimumWidth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindNth(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_FindNth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAttachmentFrom(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetAttachmentFrom,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAttachmentTo(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetAttachmentTo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEnds(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetEnds,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFrom(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetFrom,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def GetLabelPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetLabelPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetNextControlPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetNextControlPoint,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPointPtr(val)
|
||||||
|
return val
|
||||||
|
def GetTo(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_GetTo,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPyShapePtr(val)
|
||||||
|
return val
|
||||||
|
def Initialise(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_Initialise,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def InsertLineControlPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_InsertLineControlPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IsEnd(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_IsEnd,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IsSpline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_IsSpline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MakeLineControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_MakeLineControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetAttachmentFrom(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetAttachmentFrom,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetAttachments(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetAttachments,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetAttachmentTo(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetAttachmentTo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetEnds(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetEnds,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFrom(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetFrom,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetIgnoreOffsets(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetIgnoreOffsets,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSpline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetSpline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetTo(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_SetTo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Straighten(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_Straighten,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Unlink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_Unlink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyLineShape_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyLineShape instance at %s>" % (self.this,)
|
||||||
|
class wxPyLineShape(wxPyLineShapePtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglshapes2c.new_wxPyLineShape,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyLineShape)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyPolygonShapePtr(wxPyShapePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Create(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_Create,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddPolygonPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_AddPolygonPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CalculatePolygonCentre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_CalculatePolygonCentre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DeletePolygonPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_DeletePolygonPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_GetPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def UpdateOriginalPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_UpdateOriginalPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyPolygonShape instance at %s>" % (self.this,)
|
||||||
|
class wxPyPolygonShape(wxPyPolygonShapePtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglshapes2c.new_wxPyPolygonShape,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyPolygonShape)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxPyTextShapePtr(wxPyRectangleShapePtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def _setSelf(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape__setSelf,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDelete(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDelete,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawBranches(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawBranches,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLinks(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnMoveLinks,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnErase(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnErase,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseContents(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnEraseContents,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnLeftClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnRightClick(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnRightClick,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePre(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnMovePre,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMovePost(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnMovePost,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndDragRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnEndDragRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawOutline(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawOutline,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnDrawControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEraseControlPoints(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnMoveLink(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnMoveLink,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnBeginSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnBeginSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def base_OnEndSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(oglshapes2c.wxPyTextShape_base_OnEndSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxPyTextShape instance at %s>" % (self.this,)
|
||||||
|
class wxPyTextShape(wxPyTextShapePtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(oglshapes2c.new_wxPyTextShape,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
self._setSelf(self, wxPyTextShape)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
5
wxPython/contrib/stc/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile
|
||||||
|
stc_c.exp
|
||||||
|
stc_c.ilk
|
||||||
|
stc_c.pch
|
||||||
7
wxPython/contrib/stc/README.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Since STC is not always bundled with distributions of wxWindows, in
|
||||||
|
order for it to be a standard part of wxPython I need to bundle it
|
||||||
|
here. The contents of the contrib directory are copies of the
|
||||||
|
relevant parts of the main contrib directory in wxWindows. The
|
||||||
|
build.py script in this directory will also build the needed files
|
||||||
|
from there, so you no longer have to worry about aquiring and building
|
||||||
|
additional libraries beyond wxWindows itself.
|
||||||
3
wxPython/contrib/stc/_stcextras.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Stuff these names into the wx namespace so wxPyConstructObject can find them
|
||||||
|
|
||||||
|
wx.wxStyledTextEventPtr = wxStyledTextEventPtr
|
||||||
83
wxPython/contrib/stc/build.cfg
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# -*- python -*-
|
||||||
|
import sys
|
||||||
|
|
||||||
|
MODULE = 'stc_c'
|
||||||
|
SWIGFILES = ['stc_.i']
|
||||||
|
SOURCES = []
|
||||||
|
PYFILES = ['stc.py']
|
||||||
|
|
||||||
|
|
||||||
|
OTHERSWIGFLAGS = '-I$(STCLOC)/contrib/include/wx/stc'
|
||||||
|
SWIGDEPS = '$(STCLOC)/contrib/include/wx/stc/stc.h'
|
||||||
|
|
||||||
|
SOURCES = SOURCES + [
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/AutoComplete.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/CallTip.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/CellBuffer.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/ContractionState.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/Document.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/Editor.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/Indicator.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/KeyMap.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/KeyWords.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LineMarker.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/PropSet.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/ScintillaBase.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/Style.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/ViewStyle.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexCPP.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexHTML.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexOthers.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexPerl.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexPython.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexSQL.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/LexVB.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/DocumentAccessor.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/UniConversion.cxx',
|
||||||
|
'$(STCLOC)/contrib/src/stc/scintilla/src/WindowAccessor.cxx',
|
||||||
|
|
||||||
|
'$(STCLOC)/contrib/src/stc/PlatWX.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/stc/ScintillaWX.cpp',
|
||||||
|
'$(STCLOC)/contrib/src/stc/stc.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
OTHERCFLAGS = '-D__WX__ -DSCI_LEXER ' + \
|
||||||
|
'-I$(STCLOC)/contrib/src/stc/scintilla/include ' + \
|
||||||
|
'-I$(STCLOC)/contrib/include ' + \
|
||||||
|
'-I$(STCLOC)/contrib/src/stc/scintilla/src'
|
||||||
|
|
||||||
|
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
OTHERDEFS = 'STCLOC = $(WXWIN)'
|
||||||
|
OTHERRULES = '''
|
||||||
|
{$(WXWIN)/contrib/src/stc}.cpp{}.obj:
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $<
|
||||||
|
<<
|
||||||
|
|
||||||
|
{$(WXWIN)/contrib/src/stc/scintilla/src}.cxx{}.obj:
|
||||||
|
$(cc) @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $<
|
||||||
|
<<
|
||||||
|
'''
|
||||||
|
|
||||||
|
else:
|
||||||
|
DEFAULTRULE = 'default: contrib $(GENCODEDIR) $(TARGET)'
|
||||||
|
OTHERDEFS = 'STCLOC = .'
|
||||||
|
OTHERRULES = '''
|
||||||
|
%.o : contrib/src/stc/%.cpp
|
||||||
|
$(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
|
||||||
|
|
||||||
|
%.o : contrib/src/stc/scintilla/src/%.cxx
|
||||||
|
$(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
|
||||||
|
|
||||||
|
contrib :
|
||||||
|
ln -s $(WXWIN)/contrib contrib
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
# There are no platform differences so we don't need separate code directories
|
||||||
|
GENCODEDIR='.'
|
||||||
|
SWIGTOOLKITFLAG=''
|
||||||
|
|
||||||
7
wxPython/contrib/stc/stc.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
# The name "stc.cpp" was cuasing the debugger to get confused with the
|
||||||
|
# same module name in the stc library, so I changed the name of this
|
||||||
|
# one to stc_.cpp and this little stub to make the "stc" Python module
|
||||||
|
# name still usesable for everything that matters.
|
||||||
|
|
||||||
|
from stc_ import *
|
||||||
7715
wxPython/contrib/stc/stc_.cpp
Normal file
102
wxPython/contrib/stc/stc_.i
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: stc.i
|
||||||
|
// Purpose: Wrappers for the wxStyledTextCtrl.
|
||||||
|
//
|
||||||
|
// Author: Robin Dunn
|
||||||
|
//
|
||||||
|
// Created: 12-Oct-1999
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2000 by Total Control Software
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
%module stc_
|
||||||
|
|
||||||
|
|
||||||
|
%{
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "wx/stc/stc.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%include typemaps.i
|
||||||
|
%include my_typemaps.i
|
||||||
|
|
||||||
|
%extern wx.i
|
||||||
|
%extern windows.i
|
||||||
|
%extern _defs.i
|
||||||
|
%extern events.i
|
||||||
|
%extern controls.i
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
// Get all our defs from the REAL header file.
|
||||||
|
|
||||||
|
%include stc.h
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
// Python functions to act like the event macros
|
||||||
|
|
||||||
|
%pragma(python) code = "
|
||||||
|
def EVT_STC_CHANGE(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_CHANGE, fn)
|
||||||
|
|
||||||
|
def EVT_STC_STYLENEEDED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_STYLENEEDED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_CHARADDED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_CHARADDED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_UPDATEUI(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_UPDATEUI, fn)
|
||||||
|
|
||||||
|
def EVT_STC_SAVEPOINTREACHED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_SAVEPOINTREACHED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_SAVEPOINTLEFT(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_SAVEPOINTLEFT, fn)
|
||||||
|
|
||||||
|
def EVT_STC_ROMODIFYATTEMPT(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_ROMODIFYATTEMPT, fn)
|
||||||
|
|
||||||
|
def EVT_STC_DOUBLECLICK(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_DOUBLECLICK, fn)
|
||||||
|
|
||||||
|
def EVT_STC_MODIFIED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_MODIFIED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_KEY(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_KEY, fn)
|
||||||
|
|
||||||
|
def EVT_STC_MACRORECORD(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_MACRORECORD, fn)
|
||||||
|
|
||||||
|
def EVT_STC_MARGINCLICK(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_MARGINCLICK, fn)
|
||||||
|
|
||||||
|
def EVT_STC_NEEDSHOWN(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_NEEDSHOWN, fn)
|
||||||
|
|
||||||
|
|
||||||
|
"
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
%init %{
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
%pragma(python) include="_stcextras.py";
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
901
wxPython/contrib/stc/stc_.py
Normal file
@@ -0,0 +1,901 @@
|
|||||||
|
# This file was created automatically by SWIG.
|
||||||
|
import stc_c
|
||||||
|
|
||||||
|
from misc import *
|
||||||
|
|
||||||
|
from misc2 import *
|
||||||
|
|
||||||
|
from windows import *
|
||||||
|
|
||||||
|
from gdi import *
|
||||||
|
|
||||||
|
from clip_dnd import *
|
||||||
|
|
||||||
|
from events import *
|
||||||
|
|
||||||
|
from mdi import *
|
||||||
|
|
||||||
|
from frames import *
|
||||||
|
|
||||||
|
from stattool import *
|
||||||
|
|
||||||
|
from controls import *
|
||||||
|
|
||||||
|
from controls2 import *
|
||||||
|
|
||||||
|
from windows2 import *
|
||||||
|
|
||||||
|
from cmndlgs import *
|
||||||
|
|
||||||
|
from windows3 import *
|
||||||
|
|
||||||
|
from image import *
|
||||||
|
|
||||||
|
from printfw import *
|
||||||
|
|
||||||
|
from sizers import *
|
||||||
|
|
||||||
|
def EVT_STC_CHANGE(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_CHANGE, fn)
|
||||||
|
|
||||||
|
def EVT_STC_STYLENEEDED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_STYLENEEDED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_CHARADDED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_CHARADDED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_UPDATEUI(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_UPDATEUI, fn)
|
||||||
|
|
||||||
|
def EVT_STC_SAVEPOINTREACHED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_SAVEPOINTREACHED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_SAVEPOINTLEFT(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_SAVEPOINTLEFT, fn)
|
||||||
|
|
||||||
|
def EVT_STC_ROMODIFYATTEMPT(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_ROMODIFYATTEMPT, fn)
|
||||||
|
|
||||||
|
def EVT_STC_DOUBLECLICK(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_DOUBLECLICK, fn)
|
||||||
|
|
||||||
|
def EVT_STC_MODIFIED(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_MODIFIED, fn)
|
||||||
|
|
||||||
|
def EVT_STC_KEY(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_KEY, fn)
|
||||||
|
|
||||||
|
def EVT_STC_MACRORECORD(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_MACRORECORD, fn)
|
||||||
|
|
||||||
|
def EVT_STC_MARGINCLICK(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_MARGINCLICK, fn)
|
||||||
|
|
||||||
|
def EVT_STC_NEEDSHOWN(win, id, fn):
|
||||||
|
win.Connect(id, -1, wxEVT_STC_NEEDSHOWN, fn)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxStyledTextCtrlPtr(wxControlPtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def GetText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ReplaceSelection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ReplaceSelection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetReadOnly(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetReadOnly,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetReadOnly(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetReadOnly,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetTextRange(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetTextRange,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetStyledTextRange(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetStyledTextRange,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AddText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AddStyledText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AddStyledText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def InsertText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_InsertText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ClearAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetCharAt(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetCharAt,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetStyleAt(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetStyleAt,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetStyleBits(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetStyleBits,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetStyleBits(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetStyleBits,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Cut(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_Cut,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Copy(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_Copy,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Paste(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_Paste,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CanPaste(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CanPaste,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ClearClipbrd(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ClearClipbrd,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Undo(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_Undo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CanUndo(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CanUndo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EmptyUndoBuffer(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_EmptyUndoBuffer,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Redo(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_Redo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CanRedo(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CanRedo,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetUndoCollection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetUndoCollection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetUndoCollection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetUndoCollection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def BeginUndoAction(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_BeginUndoAction,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EndUndoAction(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_EndUndoAction,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSelection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetSelection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSelection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetSelection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSelectedText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetSelectedText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def HideSelection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_HideSelection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetHideSelection(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetHideSelection,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetTextLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetTextLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFirstVisibleLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetFirstVisibleLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetModified(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetModified,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineCount(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineCount,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetRect(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetRect,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxRectPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def GetLineFromPos(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineFromPos,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineStartPos(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineStartPos,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineLengthAtPos(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineLengthAtPos,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetCurrentLineText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetCurrentLineText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetCurrentLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetCurrentLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def PositionFromPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_PositionFromPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def LineFromPoint(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_LineFromPoint,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def PointFromPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_PointFromPosition,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxPointPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def GetCurrentPos(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetCurrentPos,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAnchor(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetAnchor,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SelectAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SelectAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetCurrentPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetCurrentPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetAnchor(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetAnchor,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GotoPos(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GotoPos,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GotoLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GotoLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ChangePosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ChangePosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def PageMove(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_PageMove,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ScrollBy(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ScrollBy,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ScrollToLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ScrollToLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ScrollToColumn(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ScrollToColumn,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EnsureCaretVisible(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_EnsureCaretVisible,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetCaretPolicy(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetCaretPolicy,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetSelectionType(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetSelectionType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLinesOnScreen(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLinesOnScreen,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IsSelectionRectangle(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_IsSelectionRectangle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetUseHorizontalScrollBar(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetUseHorizontalScrollBar,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetUseHorizontalScrollBar(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetUseHorizontalScrollBar,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FindText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_FindText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SearchAnchor(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SearchAnchor,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SearchNext(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SearchNext,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SearchPrev(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SearchPrev,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetViewWhitespace(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetViewWhitespace,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetViewWhitespace(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetViewWhitespace,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEOLMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetEOLMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetEOLMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetEOLMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetViewEOL(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetViewEOL,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetViewEOL(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetViewEOL,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ConvertEOL(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ConvertEOL,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEndStyled(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetEndStyled,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StartStyling(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StartStyling,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetStyleFor(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetStyleFor,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetStyleBytes(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetStyleBytes,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLineState(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetLineState,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineState(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineState,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleClearAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleClearAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleResetDefault(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleResetDefault,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetSpec(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetSpec,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetForeground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetForeground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetBackground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetBackground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetFont(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetFont,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetFontAttr(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetFontAttr,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetBold(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetBold,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetItalic(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetItalic,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetFaceName(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetFaceName,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetSize(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetSize,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def StyleSetEOLFilled(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_StyleSetEOLFilled,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLeftMargin(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLeftMargin,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetRightMargin(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetRightMargin,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMargins(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetMargins,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMarginType(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetMarginType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMarginType(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetMarginType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMarginWidth(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetMarginWidth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMarginWidth(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetMarginWidth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMarginMask(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetMarginMask,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMarginMask(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetMarginMask,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMarginSensitive(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetMarginSensitive,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMarginSensitive(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetMarginSensitive,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSelectionForeground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetSelectionForeground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetSelectionBackground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetSelectionBackground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetCaretForeground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetCaretForeground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetCaretPeriod(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetCaretPeriod,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetCaretPeriod(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetCaretPeriod,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBufferedDraw(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetBufferedDraw,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetTabWidth(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetTabWidth,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetIndent(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetIndent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetUseTabs(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetUseTabs,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLineIndentation(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetLineIndentation,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineIndentation(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineIndentation,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineIndentationPos(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineIndentationPos,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetWordChars(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetWordChars,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetUsePop(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetUsePop,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def BraceHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_BraceHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def BraceBadlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_BraceBadlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def BraceMatch(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_BraceMatch,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerDefine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerDefine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerSetType(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerSetType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerSetForeground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerSetForeground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerSetBackground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerSetBackground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerAdd(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerAdd,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerDelete(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerDelete,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerDeleteAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerDeleteAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerGet(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerGet,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerGetNextLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerGetNextLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerGetPrevLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerGetPrevLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerLineFromHandle(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerLineFromHandle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def MarkerDeleteHandle(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_MarkerDeleteHandle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IndicatorSetStyle(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_IndicatorSetStyle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IndicatorGetStyle(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_IndicatorGetStyle,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IndicatorSetColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_IndicatorSetColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompShow(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompShow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompCancel(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompCancel,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompActive(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompActive,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompPosAtStart(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompPosAtStart,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompComplete(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompComplete,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompStopChars(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompStopChars,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompSetSeparator(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompSetSeparator,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompGetSeparator(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompGetSeparator,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def AutoCompSelect(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_AutoCompSelect,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CallTipShow(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CallTipShow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CallTipCancel(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CallTipCancel,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CallTipActive(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CallTipActive,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CallTipPosAtStart(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CallTipPosAtStart,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CallTipSetHighlight(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CallTipSetHighlight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CallTipSetBackground(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CallTipSetBackground,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CmdKeyAssign(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CmdKeyAssign,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CmdKeyClear(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CmdKeyClear,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CmdKeyClearAll(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CmdKeyClearAll,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CmdKeyExecute(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_CmdKeyExecute,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def FormatRange(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_FormatRange,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetDocument(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetDocument,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetDocument(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetDocument,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def VisibleFromDocLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_VisibleFromDocLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def DocLineFromVisible(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_DocLineFromVisible,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFoldLevel(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetFoldLevel,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFoldLevel(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetFoldLevel,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLastChild(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLastChild,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFoldParent(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetFoldParent,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ShowLines(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ShowLines,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def HideLines(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_HideLines,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLineVisible(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLineVisible,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFoldExpanded(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetFoldExpanded,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFoldExpanded(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetFoldExpanded,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def ToggleFold(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_ToggleFold,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def EnsureVisible(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_EnsureVisible,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFoldFlags(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetFoldFlags,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEdgeColumn(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetEdgeColumn,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetEdgeColumn(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetEdgeColumn,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEdgeMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetEdgeMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetEdgeMode(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetEdgeMode,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetEdgeColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetEdgeColour,(self,) + _args, _kwargs)
|
||||||
|
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||||
|
return val
|
||||||
|
def SetEdgeColour(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetEdgeColour,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLexer(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetLexer,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLexer(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_GetLexer,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Colourise(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_Colourise,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetProperty(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetProperty,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetKeywords(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextCtrl_SetKeywords,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxStyledTextCtrl instance at %s>" % (self.this,)
|
||||||
|
class wxStyledTextCtrl(wxStyledTextCtrlPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(stc_c.new_wxStyledTextCtrl,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class wxStyledTextEventPtr(wxCommandEventPtr):
|
||||||
|
def __init__(self,this):
|
||||||
|
self.this = this
|
||||||
|
self.thisown = 0
|
||||||
|
def __del__(self,stc_c=stc_c):
|
||||||
|
if self.thisown == 1 :
|
||||||
|
stc_c.delete_wxStyledTextEvent(self)
|
||||||
|
def SetPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetKey(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetKey,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetModifiers(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetModifiers,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetModificationType(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetModificationType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLinesAdded(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetLinesAdded,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFoldLevelNow(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetFoldLevelNow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetFoldLevelPrev(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetFoldLevelPrev,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMargin(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetMargin,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetMessage(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetMessage,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetWParam(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetWParam,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetLParam(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_SetLParam,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetPosition(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetPosition,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetKey(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetKey,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetModifiers(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetModifiers,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetModificationType(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetModificationType,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetText(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetText,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLength(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetLength,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLinesAdded(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetLinesAdded,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLine(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetLine,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFoldLevelNow(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetFoldLevelNow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetFoldLevelPrev(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetFoldLevelPrev,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMargin(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetMargin,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetMessage(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetMessage,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetWParam(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetWParam,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetLParam(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetLParam,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetShift(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetShift,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetControl(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetControl,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def GetAlt(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_GetAlt,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def CopyObject(self, *_args, **_kwargs):
|
||||||
|
val = apply(stc_c.wxStyledTextEvent_CopyObject,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def __repr__(self):
|
||||||
|
return "<C wxStyledTextEvent instance at %s>" % (self.this,)
|
||||||
|
class wxStyledTextEvent(wxStyledTextEventPtr):
|
||||||
|
def __init__(self,*_args,**_kwargs):
|
||||||
|
self.this = apply(stc_c.new_wxStyledTextEvent,_args,_kwargs)
|
||||||
|
self.thisown = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- VARIABLE WRAPPERS ------------------
|
||||||
|
|
||||||
|
wxSTC_UndoCollectNone = stc_c.wxSTC_UndoCollectNone
|
||||||
|
wxSTC_UndoCollectAutoStart = stc_c.wxSTC_UndoCollectAutoStart
|
||||||
|
wxSTC_EOL_CRLF = stc_c.wxSTC_EOL_CRLF
|
||||||
|
wxSTC_EOL_CR = stc_c.wxSTC_EOL_CR
|
||||||
|
wxSTC_EOL_LF = stc_c.wxSTC_EOL_LF
|
||||||
|
wxSTC_EDGE_NONE = stc_c.wxSTC_EDGE_NONE
|
||||||
|
wxSTC_EDGE_LINE = stc_c.wxSTC_EDGE_LINE
|
||||||
|
wxSTC_EDGE_BACKGROUND = stc_c.wxSTC_EDGE_BACKGROUND
|
||||||
|
wxSTC_LEX_STYLE_MAX = stc_c.wxSTC_LEX_STYLE_MAX
|
||||||
|
wxSTC_STYLE_DEFAULT = stc_c.wxSTC_STYLE_DEFAULT
|
||||||
|
wxSTC_STYLE_LINENUMBER = stc_c.wxSTC_STYLE_LINENUMBER
|
||||||
|
wxSTC_STYLE_BRACELIGHT = stc_c.wxSTC_STYLE_BRACELIGHT
|
||||||
|
wxSTC_STYLE_BRACEBAD = stc_c.wxSTC_STYLE_BRACEBAD
|
||||||
|
wxSTC_STYLE_CONTROLCHAR = stc_c.wxSTC_STYLE_CONTROLCHAR
|
||||||
|
wxSTC_STYLE_MAX = stc_c.wxSTC_STYLE_MAX
|
||||||
|
wxSTC_STYLE_MASK = stc_c.wxSTC_STYLE_MASK
|
||||||
|
wxSTC_MARKER_MAX = stc_c.wxSTC_MARKER_MAX
|
||||||
|
wxSTC_MARK_CIRCLE = stc_c.wxSTC_MARK_CIRCLE
|
||||||
|
wxSTC_MARK_ROUNDRECT = stc_c.wxSTC_MARK_ROUNDRECT
|
||||||
|
wxSTC_MARK_ARROW = stc_c.wxSTC_MARK_ARROW
|
||||||
|
wxSTC_MARK_SMALLRECT = stc_c.wxSTC_MARK_SMALLRECT
|
||||||
|
wxSTC_MARK_SHORTARROW = stc_c.wxSTC_MARK_SHORTARROW
|
||||||
|
wxSTC_MARK_EMPTY = stc_c.wxSTC_MARK_EMPTY
|
||||||
|
wxSTC_MARK_ARROWDOWN = stc_c.wxSTC_MARK_ARROWDOWN
|
||||||
|
wxSTC_MARK_MINUS = stc_c.wxSTC_MARK_MINUS
|
||||||
|
wxSTC_MARK_PLUS = stc_c.wxSTC_MARK_PLUS
|
||||||
|
wxSTC_MARKNUM_FOLDER = stc_c.wxSTC_MARKNUM_FOLDER
|
||||||
|
wxSTC_MARKNUM_FOLDEROPEN = stc_c.wxSTC_MARKNUM_FOLDEROPEN
|
||||||
|
wxSTC_MASK_FOLDERS = stc_c.wxSTC_MASK_FOLDERS
|
||||||
|
wxSTC_INDIC_MAX = stc_c.wxSTC_INDIC_MAX
|
||||||
|
wxSTC_INDIC_PLAIN = stc_c.wxSTC_INDIC_PLAIN
|
||||||
|
wxSTC_INDIC_SQUIGGLE = stc_c.wxSTC_INDIC_SQUIGGLE
|
||||||
|
wxSTC_INDIC_TT = stc_c.wxSTC_INDIC_TT
|
||||||
|
wxSTC_INDIC0_MASK = stc_c.wxSTC_INDIC0_MASK
|
||||||
|
wxSTC_INDIC1_MASK = stc_c.wxSTC_INDIC1_MASK
|
||||||
|
wxSTC_INDIC2_MASK = stc_c.wxSTC_INDIC2_MASK
|
||||||
|
wxSTC_INDICS_MASK = stc_c.wxSTC_INDICS_MASK
|
||||||
|
wxSTC_FOLDLEVELBASE = stc_c.wxSTC_FOLDLEVELBASE
|
||||||
|
wxSTC_FOLDLEVELWHITEFLAG = stc_c.wxSTC_FOLDLEVELWHITEFLAG
|
||||||
|
wxSTC_FOLDLEVELHEADERFLAG = stc_c.wxSTC_FOLDLEVELHEADERFLAG
|
||||||
|
wxSTC_FOLDLEVELNUMBERMASK = stc_c.wxSTC_FOLDLEVELNUMBERMASK
|
||||||
|
wxSTC_CMD_LINEDOWN = stc_c.wxSTC_CMD_LINEDOWN
|
||||||
|
wxSTC_CMD_LINEDOWNEXTEND = stc_c.wxSTC_CMD_LINEDOWNEXTEND
|
||||||
|
wxSTC_CMD_LINEUP = stc_c.wxSTC_CMD_LINEUP
|
||||||
|
wxSTC_CMD_LINEUPEXTEND = stc_c.wxSTC_CMD_LINEUPEXTEND
|
||||||
|
wxSTC_CMD_CHARLEFT = stc_c.wxSTC_CMD_CHARLEFT
|
||||||
|
wxSTC_CMD_CHARLEFTEXTEND = stc_c.wxSTC_CMD_CHARLEFTEXTEND
|
||||||
|
wxSTC_CMD_CHARRIGHT = stc_c.wxSTC_CMD_CHARRIGHT
|
||||||
|
wxSTC_CMD_CHARRIGHTEXTEND = stc_c.wxSTC_CMD_CHARRIGHTEXTEND
|
||||||
|
wxSTC_CMD_WORDLEFT = stc_c.wxSTC_CMD_WORDLEFT
|
||||||
|
wxSTC_CMD_WORDLEFTEXTEND = stc_c.wxSTC_CMD_WORDLEFTEXTEND
|
||||||
|
wxSTC_CMD_WORDRIGHT = stc_c.wxSTC_CMD_WORDRIGHT
|
||||||
|
wxSTC_CMD_WORDRIGHTEXTEND = stc_c.wxSTC_CMD_WORDRIGHTEXTEND
|
||||||
|
wxSTC_CMD_HOME = stc_c.wxSTC_CMD_HOME
|
||||||
|
wxSTC_CMD_HOMEEXTEND = stc_c.wxSTC_CMD_HOMEEXTEND
|
||||||
|
wxSTC_CMD_LINEEND = stc_c.wxSTC_CMD_LINEEND
|
||||||
|
wxSTC_CMD_LINEENDEXTEND = stc_c.wxSTC_CMD_LINEENDEXTEND
|
||||||
|
wxSTC_CMD_DOCUMENTSTART = stc_c.wxSTC_CMD_DOCUMENTSTART
|
||||||
|
wxSTC_CMD_DOCUMENTSTARTEXTEND = stc_c.wxSTC_CMD_DOCUMENTSTARTEXTEND
|
||||||
|
wxSTC_CMD_DOCUMENTEND = stc_c.wxSTC_CMD_DOCUMENTEND
|
||||||
|
wxSTC_CMD_DOCUMENTENDEXTEND = stc_c.wxSTC_CMD_DOCUMENTENDEXTEND
|
||||||
|
wxSTC_CMD_PAGEUP = stc_c.wxSTC_CMD_PAGEUP
|
||||||
|
wxSTC_CMD_PAGEUPEXTEND = stc_c.wxSTC_CMD_PAGEUPEXTEND
|
||||||
|
wxSTC_CMD_PAGEDOWN = stc_c.wxSTC_CMD_PAGEDOWN
|
||||||
|
wxSTC_CMD_PAGEDOWNEXTEND = stc_c.wxSTC_CMD_PAGEDOWNEXTEND
|
||||||
|
wxSTC_CMD_EDITTOGGLEOVERTYPE = stc_c.wxSTC_CMD_EDITTOGGLEOVERTYPE
|
||||||
|
wxSTC_CMD_CANCEL = stc_c.wxSTC_CMD_CANCEL
|
||||||
|
wxSTC_CMD_DELETEBACK = stc_c.wxSTC_CMD_DELETEBACK
|
||||||
|
wxSTC_CMD_TAB = stc_c.wxSTC_CMD_TAB
|
||||||
|
wxSTC_CMD_BACKTAB = stc_c.wxSTC_CMD_BACKTAB
|
||||||
|
wxSTC_CMD_NEWLINE = stc_c.wxSTC_CMD_NEWLINE
|
||||||
|
wxSTC_CMD_FORMFEED = stc_c.wxSTC_CMD_FORMFEED
|
||||||
|
wxSTC_CMD_VCHOME = stc_c.wxSTC_CMD_VCHOME
|
||||||
|
wxSTC_CMD_VCHOMEEXTEND = stc_c.wxSTC_CMD_VCHOMEEXTEND
|
||||||
|
wxSTC_CMD_ZOOMIN = stc_c.wxSTC_CMD_ZOOMIN
|
||||||
|
wxSTC_CMD_ZOOMOUT = stc_c.wxSTC_CMD_ZOOMOUT
|
||||||
|
wxSTC_CMD_DELWORDLEFT = stc_c.wxSTC_CMD_DELWORDLEFT
|
||||||
|
wxSTC_CMD_DELWORDRIGHT = stc_c.wxSTC_CMD_DELWORDRIGHT
|
||||||
|
wxSTC_CMD_LINECUT = stc_c.wxSTC_CMD_LINECUT
|
||||||
|
wxSTC_CMD_LINEDELETE = stc_c.wxSTC_CMD_LINEDELETE
|
||||||
|
wxSTC_CMD_LINETRANSPOSE = stc_c.wxSTC_CMD_LINETRANSPOSE
|
||||||
|
wxSTC_CMD_LOWERCASE = stc_c.wxSTC_CMD_LOWERCASE
|
||||||
|
wxSTC_CMD_UPPERCASE = stc_c.wxSTC_CMD_UPPERCASE
|
||||||
|
wxSTC_CMD_LINESCROLLDOWN = stc_c.wxSTC_CMD_LINESCROLLDOWN
|
||||||
|
wxSTC_CMD_LINESCROLLUP = stc_c.wxSTC_CMD_LINESCROLLUP
|
||||||
|
wxSTC_LEX_CONTAINER = stc_c.wxSTC_LEX_CONTAINER
|
||||||
|
wxSTC_LEX_NULL = stc_c.wxSTC_LEX_NULL
|
||||||
|
wxSTC_LEX_PYTHON = stc_c.wxSTC_LEX_PYTHON
|
||||||
|
wxSTC_LEX_CPP = stc_c.wxSTC_LEX_CPP
|
||||||
|
wxSTC_LEX_HTML = stc_c.wxSTC_LEX_HTML
|
||||||
|
wxSTC_LEX_XML = stc_c.wxSTC_LEX_XML
|
||||||
|
wxSTC_LEX_PERL = stc_c.wxSTC_LEX_PERL
|
||||||
|
wxSTC_LEX_SQL = stc_c.wxSTC_LEX_SQL
|
||||||
|
wxSTC_LEX_VB = stc_c.wxSTC_LEX_VB
|
||||||
|
wxSTC_LEX_PROPERTIES = stc_c.wxSTC_LEX_PROPERTIES
|
||||||
|
wxSTC_LEX_ERRORLIST = stc_c.wxSTC_LEX_ERRORLIST
|
||||||
|
wxSTC_LEX_MAKEFILE = stc_c.wxSTC_LEX_MAKEFILE
|
||||||
|
wxSTC_LEX_BATCH = stc_c.wxSTC_LEX_BATCH
|
||||||
|
wxSTC_CARET_SLOP = stc_c.wxSTC_CARET_SLOP
|
||||||
|
WXSTC_CARET_CENTER = stc_c.WXSTC_CARET_CENTER
|
||||||
|
wxSTC_CARET_STRICT = stc_c.wxSTC_CARET_STRICT
|
||||||
|
wxSTC_MARGIN_SYMBOL = stc_c.wxSTC_MARGIN_SYMBOL
|
||||||
|
wxSTC_MARGIN_NUMBER = stc_c.wxSTC_MARGIN_NUMBER
|
||||||
|
wxSTCNameStr = stc_c.wxSTCNameStr
|
||||||
|
wxEVT_STC_CHANGE = stc_c.wxEVT_STC_CHANGE
|
||||||
|
wxEVT_STC_STYLENEEDED = stc_c.wxEVT_STC_STYLENEEDED
|
||||||
|
wxEVT_STC_CHARADDED = stc_c.wxEVT_STC_CHARADDED
|
||||||
|
wxEVT_STC_UPDATEUI = stc_c.wxEVT_STC_UPDATEUI
|
||||||
|
wxEVT_STC_SAVEPOINTREACHED = stc_c.wxEVT_STC_SAVEPOINTREACHED
|
||||||
|
wxEVT_STC_SAVEPOINTLEFT = stc_c.wxEVT_STC_SAVEPOINTLEFT
|
||||||
|
wxEVT_STC_ROMODIFYATTEMPT = stc_c.wxEVT_STC_ROMODIFYATTEMPT
|
||||||
|
wxEVT_STC_DOUBLECLICK = stc_c.wxEVT_STC_DOUBLECLICK
|
||||||
|
wxEVT_STC_MODIFIED = stc_c.wxEVT_STC_MODIFIED
|
||||||
|
wxEVT_STC_KEY = stc_c.wxEVT_STC_KEY
|
||||||
|
wxEVT_STC_MACRORECORD = stc_c.wxEVT_STC_MACRORECORD
|
||||||
|
wxEVT_STC_MARGINCLICK = stc_c.wxEVT_STC_MARGINCLICK
|
||||||
|
wxEVT_STC_NEEDSHOWN = stc_c.wxEVT_STC_NEEDSHOWN
|
||||||
|
|
||||||
|
|
||||||
|
#-------------- USER INCLUDE -----------------------
|
||||||
|
|
||||||
|
# Stuff these names into the wx namespace so wxPyConstructObject can find them
|
||||||
|
|
||||||
|
wx.wxStyledTextEventPtr = wxStyledTextEventPtr
|
||||||
6
wxPython/demo/.cvsignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
*.pyc
|
||||||
|
.emacs.desktop
|
||||||
|
hangman_dict.txt
|
||||||
|
setup.bat
|
||||||
|
test.out
|
||||||
|
tmphtml.txt
|
||||||
64
wxPython/demo/About.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.html import *
|
||||||
|
import wxPython.lib.wxpTag
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyAboutBox(wxDialog):
|
||||||
|
text = '''
|
||||||
|
<html>
|
||||||
|
<body bgcolor="#AC76DE">
|
||||||
|
<center><table bgcolor="#458154" width="100%%" cellspacing="0"
|
||||||
|
cellpadding="0" border="1">
|
||||||
|
<tr>
|
||||||
|
<td align="center"><h1>wxPython %s</h1></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p><b>wxPython</b> is a Python extension module that
|
||||||
|
encapsulates the wxWindows GUI classes.</p>
|
||||||
|
|
||||||
|
<p>This demo shows off some of the capabilities
|
||||||
|
of <b>wxPython</b>. Select items from the menu or tree control,
|
||||||
|
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-1999.</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<font size="-1">Please see <i>license.txt</i> for licensing information.</font>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><wxp class="wxButton">
|
||||||
|
<param name="label" value="Okay">
|
||||||
|
<param name="id" value="wxID_OK">
|
||||||
|
</wxp></p>
|
||||||
|
</center>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
'''
|
||||||
|
def __init__(self, parent):
|
||||||
|
wxDialog.__init__(self, parent, -1, 'About the wxPython demo',
|
||||||
|
size=wxSize(420, 380))
|
||||||
|
self.html = wxHtmlWindow(self, -1)
|
||||||
|
self.html.SetPage(self.text % wx.__version__)
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
lc = wxLayoutConstraints()
|
||||||
|
lc.top.SameAs(self, wxTop, 5)
|
||||||
|
lc.left.SameAs(self, wxLeft, 5)
|
||||||
|
lc.bottom.SameAs(self, wxBottom, 5)
|
||||||
|
lc.right.SameAs(self, wxRight, 5)
|
||||||
|
self.html.SetConstraints(lc)
|
||||||
|
self.Layout()
|
||||||
|
|
||||||
|
self.CentreOnParent(wxBOTH)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
127
wxPython/demo/ActiveXWrapper_Acrobat.py
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
"""
|
||||||
|
<html><body>
|
||||||
|
This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.)
|
||||||
|
<p>
|
||||||
|
The MakeActiveXClass function dynamically builds a new Class on the fly, that has the
|
||||||
|
same signature and semantics as wxWindow. This means that when you call the function
|
||||||
|
you get back a new class that you can use just like wxWindow, (set the size and position,
|
||||||
|
use in a sizer, etc.) except its contents will be the COM control.
|
||||||
|
<p>
|
||||||
|
This demo embeds the Adobe Acrobat Reader, and gives you some buttons for opening a PDF
|
||||||
|
file, changing pages, etc. that show how to call methods on the COM object. If you don't
|
||||||
|
have Acrobat Reader 4.0 installed it won't work.
|
||||||
|
</body></html>
|
||||||
|
"""
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
if wxPlatform == '__WXMSW__':
|
||||||
|
from wxPython.lib.activexwrapper import MakeActiveXClass
|
||||||
|
import win32com.client.gencache
|
||||||
|
|
||||||
|
try:
|
||||||
|
acrobat = win32com.client.gencache.EnsureModule('{CA8A9783-280D-11CF-A24D-444553540000}', 0x0, 1, 3)
|
||||||
|
except:
|
||||||
|
raise ImportError("Can't load PDF.OCX, install Acrobat 4.0")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
btnSizer = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
|
||||||
|
# this function creates a new class that can be used as
|
||||||
|
# a wxWindow, but contains the given ActiveX control.
|
||||||
|
ActiveXWrapper = MakeActiveXClass(acrobat.Pdf)
|
||||||
|
|
||||||
|
# create an instance of the new class
|
||||||
|
self.pdf = ActiveXWrapper( self, -1, style=wxSUNKEN_BORDER)
|
||||||
|
|
||||||
|
sizer.Add(self.pdf, 1, wxEXPAND)
|
||||||
|
|
||||||
|
btn = wxButton(self, wxNewId(), "Open PDF File")
|
||||||
|
EVT_BUTTON(self, btn.GetId(), self.OnOpenButton)
|
||||||
|
btnSizer.Add(btn, 1, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
btn = wxButton(self, wxNewId(), "<-- Previous Page")
|
||||||
|
EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton)
|
||||||
|
btnSizer.Add(btn, 1, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
btn = wxButton(self, wxNewId(), "Next Page -->")
|
||||||
|
EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton)
|
||||||
|
btnSizer.Add(btn, 1, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
|
||||||
|
btnSizer.Add(50, -1, 2, wxEXPAND)
|
||||||
|
sizer.Add(btnSizer, 0, wxEXPAND)
|
||||||
|
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.pdf.Cleanup()
|
||||||
|
self.pdf = None
|
||||||
|
|
||||||
|
|
||||||
|
def OnOpenButton(self, event):
|
||||||
|
dlg = wxFileDialog(self, wildcard="*.pdf")
|
||||||
|
if dlg.ShowModal() == wxID_OK:
|
||||||
|
wxBeginBusyCursor()
|
||||||
|
self.pdf.LoadFile(dlg.GetPath())
|
||||||
|
wxEndBusyCursor()
|
||||||
|
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
def OnPrevPageButton(self, event):
|
||||||
|
self.pdf.gotoPreviousPage()
|
||||||
|
|
||||||
|
|
||||||
|
def OnNextPageButton(self, event):
|
||||||
|
self.pdf.gotoNextPage()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
if wxPlatform == '__WXMSW__':
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
else:
|
||||||
|
dlg = wxMessageDialog(frame, 'This demo only works on MSW.',
|
||||||
|
'Sorry', wxOK | wxICON_INFORMATION)
|
||||||
|
dlg.ShowModal()
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
overview = __doc__
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self):
|
||||||
|
wxFrame.__init__(self, None, -1, "ActiveX test -- Acrobat", size=(640, 480),
|
||||||
|
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
|
self.tp = TestPanel(self, sys.stdout)
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.tp.pdf.Cleanup()
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
app = wxPySimpleApp()
|
||||||
|
frame = TestFrame()
|
||||||
|
frame.Show(true)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
196
wxPython/demo/ActiveXWrapper_IE.py
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
"""
|
||||||
|
<html><body>
|
||||||
|
This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.)
|
||||||
|
<p>
|
||||||
|
The MakeActiveXClass function dynamically builds a new Class on the fly, that has the
|
||||||
|
same signature and semantics as wxWindow. This means that when you call the function
|
||||||
|
you get back a new class that you can use just like wxWindow, (set the size and position,
|
||||||
|
use in a sizer, etc.) except its contents will be the COM control.
|
||||||
|
<p>
|
||||||
|
This demo embeds the Internet Exploer WebBrowser control, and shows how to receive events
|
||||||
|
from the COM control. (The title bar and status bar are updated as pages change, in addition
|
||||||
|
to the log messages being shown.)
|
||||||
|
</body></html>
|
||||||
|
"""
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
if wxPlatform == '__WXMSW__':
|
||||||
|
from wxPython.lib.activexwrapper import MakeActiveXClass
|
||||||
|
import win32com.client.gencache
|
||||||
|
|
||||||
|
try:
|
||||||
|
browserModule = win32com.client.gencache.EnsureModule("{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}", 0, 1, 1)
|
||||||
|
except:
|
||||||
|
raise ImportError("IE4 or greater does not appear to be installed.")
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestPanel(wxWindow):
|
||||||
|
def __init__(self, parent, log, frame=None):
|
||||||
|
wxWindow.__init__(self, parent, -1)#, style=wxCLIP_CHILDREN)
|
||||||
|
self.log = log
|
||||||
|
self.current = "http://alldunn.com/"
|
||||||
|
self.frame = frame
|
||||||
|
if frame:
|
||||||
|
self.titleBase = frame.GetTitle()
|
||||||
|
|
||||||
|
|
||||||
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
btnSizer = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
|
||||||
|
# Make a new class that derives from the WebBrowser class in the
|
||||||
|
# COM module imported above. This class also derives from wxWindow and
|
||||||
|
# implements the machinery needed to integrate the two worlds.
|
||||||
|
theClass = MakeActiveXClass(browserModule.WebBrowser,
|
||||||
|
eventObj = self)
|
||||||
|
|
||||||
|
# Create an instance of that class
|
||||||
|
self.ie = theClass(self, -1, style=wxSUNKEN_BORDER)
|
||||||
|
|
||||||
|
|
||||||
|
#btn = wxButton(self, wxNewId(), " Open ")
|
||||||
|
#EVT_BUTTON(self, btn.GetId(), self.OnOpenButton)
|
||||||
|
#btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
btn = wxButton(self, wxNewId(), " Home ")
|
||||||
|
EVT_BUTTON(self, btn.GetId(), self.OnHomeButton)
|
||||||
|
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
btn = wxButton(self, wxNewId(), " <-- ")
|
||||||
|
EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton)
|
||||||
|
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
btn = wxButton(self, wxNewId(), " --> ")
|
||||||
|
EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton)
|
||||||
|
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
txt = wxStaticText(self, -1, "Location:")
|
||||||
|
btnSizer.Add(txt, 0, wxCENTER|wxALL, 5)
|
||||||
|
|
||||||
|
self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN)
|
||||||
|
EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect)
|
||||||
|
EVT_KEY_UP(self.location, self.OnLocationKey)
|
||||||
|
#EVT_CHAR(self.location, self.IgnoreReturn)
|
||||||
|
btnSizer.Add(self.location, 1, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
sizer.Add(btnSizer, 0, wxEXPAND)
|
||||||
|
sizer.Add(self.ie, 1, wxEXPAND)
|
||||||
|
|
||||||
|
self.ie.Navigate(self.current)
|
||||||
|
self.location.Append(self.current)
|
||||||
|
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
|
||||||
|
|
||||||
|
def OnSize(self, evt):
|
||||||
|
self.Layout()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.ie.Cleanup()
|
||||||
|
self.ie = None
|
||||||
|
|
||||||
|
def OnLocationSelect(self, evt):
|
||||||
|
url = self.location.GetStringSelection()
|
||||||
|
self.log.write('OnLocationSelect: %s\n' % url)
|
||||||
|
self.ie.Navigate(url)
|
||||||
|
|
||||||
|
def OnLocationKey(self, evt):
|
||||||
|
if evt.KeyCode() == WXK_RETURN:
|
||||||
|
URL = self.location.GetValue()
|
||||||
|
self.location.Append(URL)
|
||||||
|
self.ie.Navigate(URL)
|
||||||
|
else:
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def IgnoreReturn(self, evt):
|
||||||
|
print 'IgnoreReturn'
|
||||||
|
if evt.KeyCode() != WXK_RETURN:
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnOpenButton(self, event):
|
||||||
|
dlg = wxTextEntryDialog(self, "Open Location",
|
||||||
|
"Enter a full URL or local path",
|
||||||
|
self.current, wxOK|wxCANCEL)
|
||||||
|
dlg.CentreOnParent()
|
||||||
|
if dlg.ShowModal() == wxID_OK:
|
||||||
|
self.current = dlg.GetValue()
|
||||||
|
self.ie.Navigate(self.current)
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
def OnHomeButton(self, event):
|
||||||
|
self.ie.GoHome() ## ET Phone Home!
|
||||||
|
|
||||||
|
def OnPrevPageButton(self, event):
|
||||||
|
self.ie.GoBack()
|
||||||
|
|
||||||
|
|
||||||
|
def OnNextPageButton(self, event):
|
||||||
|
self.ie.GoForward()
|
||||||
|
|
||||||
|
|
||||||
|
# The following event handlers are called by the web browser COM
|
||||||
|
# control since we passed self to MakeActiveXClass. It will look
|
||||||
|
# here for matching attributes and call them if they exist. See the
|
||||||
|
# module generated by makepy for details of method names, etc.
|
||||||
|
def OnBeforeNavigate2(self, pDisp, URL, *args):
|
||||||
|
self.log.write('OnBeforeNavigate2: %s\n' % URL)
|
||||||
|
|
||||||
|
def OnNavigateComplete2(self, pDisp, URL):
|
||||||
|
self.log.write('OnNavigateComplete2: %s\n' % URL)
|
||||||
|
self.current = URL
|
||||||
|
self.location.SetValue(URL)
|
||||||
|
|
||||||
|
def OnTitleChange(self, text):
|
||||||
|
self.log.write('OnTitleChange: %s\n' % text)
|
||||||
|
if self.frame:
|
||||||
|
self.frame.SetTitle(self.titleBase + ' -- ' + text)
|
||||||
|
|
||||||
|
def OnStatusTextChange(self, text):
|
||||||
|
self.log.write('OnStatusTextChange: %s\n' % text)
|
||||||
|
if self.frame:
|
||||||
|
self.frame.SetStatusText(text)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
# for the demo framework...
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
if wxPlatform == '__WXMSW__':
|
||||||
|
win = TestPanel(nb, log, frame)
|
||||||
|
return win
|
||||||
|
else:
|
||||||
|
dlg = wxMessageDialog(frame, 'This demo only works on MSW.',
|
||||||
|
'Sorry', wxOK | wxICON_INFORMATION)
|
||||||
|
dlg.ShowModal()
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
overview = __doc__
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self):
|
||||||
|
wxFrame.__init__(self, None, -1, "ActiveX test -- Internet Explorer",
|
||||||
|
size=(640, 480),
|
||||||
|
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
|
self.CreateStatusBar()
|
||||||
|
self.tp = TestPanel(self, sys.stdout, self)
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.tp.ie.Cleanup()
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
app = wxPySimpleApp()
|
||||||
|
frame = TestFrame()
|
||||||
|
frame.Show(true)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
13
wxPython/demo/ColorPanel.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class ColoredPanel(wxWindow):
|
||||||
|
def __init__(self, parent, color):
|
||||||
|
wxWindow.__init__(self, parent, -1,
|
||||||
|
wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER)
|
||||||
|
self.SetBackgroundColour(color)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
273
wxPython/demo/CustomDragAndDrop.py
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
import cPickle
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class DoodlePad(wxWindow):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxWindow.__init__(self, parent, -1, style=wxSUNKEN_BORDER)
|
||||||
|
self.log = log
|
||||||
|
self.SetBackgroundColour(wxWHITE)
|
||||||
|
self.lines = []
|
||||||
|
self.x = self.y = 0
|
||||||
|
self.SetCursor(wxStockCursor(wxCURSOR_PENCIL))
|
||||||
|
|
||||||
|
EVT_LEFT_DOWN(self, self.OnLeftDown)
|
||||||
|
EVT_LEFT_UP(self, self.OnLeftUp)
|
||||||
|
EVT_RIGHT_UP(self, self.OnRightUp)
|
||||||
|
EVT_MOTION(self, self.OnMotion)
|
||||||
|
|
||||||
|
|
||||||
|
def OnPaint(self, event):
|
||||||
|
dc = wxPaintDC(self)
|
||||||
|
self.DrawSavedLines(dc)
|
||||||
|
|
||||||
|
def DrawSavedLines(self, dc):
|
||||||
|
dc.BeginDrawing()
|
||||||
|
dc.SetPen(wxPen(wxBLUE, 3))
|
||||||
|
for line in self.lines:
|
||||||
|
for coords in line:
|
||||||
|
apply(dc.DrawLine, coords)
|
||||||
|
dc.EndDrawing()
|
||||||
|
|
||||||
|
|
||||||
|
def OnLeftDown(self, event):
|
||||||
|
if event.ControlDown():
|
||||||
|
self.StartDragOpperation()
|
||||||
|
else:
|
||||||
|
self.curLine = []
|
||||||
|
self.x, self.y = event.GetPositionTuple()
|
||||||
|
self.CaptureMouse()
|
||||||
|
|
||||||
|
|
||||||
|
def OnLeftUp(self, event):
|
||||||
|
self.lines.append(self.curLine)
|
||||||
|
self.curLine = []
|
||||||
|
self.ReleaseMouse()
|
||||||
|
|
||||||
|
def OnRightUp(self, event):
|
||||||
|
self.lines = []
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def OnMotion(self, event):
|
||||||
|
if event.Dragging() and not event.ControlDown():
|
||||||
|
dc = wxClientDC(self)
|
||||||
|
dc.BeginDrawing()
|
||||||
|
dc.SetPen(wxPen(wxBLUE, 3))
|
||||||
|
coords = (self.x, self.y) + event.GetPositionTuple()
|
||||||
|
self.curLine.append(coords)
|
||||||
|
apply(dc.DrawLine, coords)
|
||||||
|
self.x, self.y = event.GetPositionTuple()
|
||||||
|
dc.EndDrawing()
|
||||||
|
|
||||||
|
|
||||||
|
def StartDragOpperation(self):
|
||||||
|
# pickle the lines list
|
||||||
|
linesdata = cPickle.dumps(self.lines, 1)
|
||||||
|
|
||||||
|
# create our own data format and use it in a
|
||||||
|
# custom data object
|
||||||
|
ldata = wxCustomDataObject(wxCustomDataFormat("DoodleLines"))
|
||||||
|
ldata.SetData(linesdata)
|
||||||
|
|
||||||
|
# Also create a Bitmap version of the drawing
|
||||||
|
size = self.GetSize()
|
||||||
|
bmp = wxEmptyBitmap(size.width, size.height)
|
||||||
|
dc = wxMemoryDC()
|
||||||
|
dc.SelectObject(bmp)
|
||||||
|
dc.SetBackground(wxWHITE_BRUSH)
|
||||||
|
dc.Clear()
|
||||||
|
self.DrawSavedLines(dc)
|
||||||
|
dc.SelectObject(wxNullBitmap)
|
||||||
|
|
||||||
|
# Now make a data object for the bitmap and also a composite
|
||||||
|
# data object holding both of the others.
|
||||||
|
bdata = wxBitmapDataObject(bmp)
|
||||||
|
data = wxDataObjectComposite()
|
||||||
|
data.Add(ldata)
|
||||||
|
data.Add(bdata)
|
||||||
|
|
||||||
|
# And finally, create the drop source and begin the drag
|
||||||
|
# and drop opperation
|
||||||
|
dropSource = wxDropSource(self)
|
||||||
|
dropSource.SetData(data)
|
||||||
|
self.log.WriteText("Begining DragDrop\n")
|
||||||
|
result = dropSource.DoDragDrop()
|
||||||
|
self.log.WriteText("DragDrop completed: %d\n" % result)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class DoodleDropTarget(wxPyDropTarget):
|
||||||
|
def __init__(self, window, log):
|
||||||
|
wxPyDropTarget.__init__(self)
|
||||||
|
self.log = log
|
||||||
|
self.dv = window
|
||||||
|
self.data = wxCustomDataObject(wxCustomDataFormat("DoodleLines"))
|
||||||
|
self.SetDataObject(self.data)
|
||||||
|
|
||||||
|
def OnEnter(self, x, y, d):
|
||||||
|
self.log.WriteText("OnEnter: %d, %d, %d\n" % (x, y, d))
|
||||||
|
return wxDragCopy
|
||||||
|
|
||||||
|
def OnLeave(self):
|
||||||
|
self.log.WriteText("OnLeave\n")
|
||||||
|
|
||||||
|
def OnDrop(self, x, y):
|
||||||
|
self.log.WriteText("OnDrop: %d %d\n" % (x, y))
|
||||||
|
return true
|
||||||
|
|
||||||
|
def OnData(self, x, y, d):
|
||||||
|
self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
|
||||||
|
if self.GetData():
|
||||||
|
linesdata = self.data.GetData()
|
||||||
|
lines = cPickle.loads(linesdata)
|
||||||
|
self.dv.SetLines(lines)
|
||||||
|
return d
|
||||||
|
|
||||||
|
#def OnDragOver(self, x, y, d):
|
||||||
|
# self.log.WriteText("OnDragOver: %d, %d, %d\n" % (x, y, d))
|
||||||
|
# return wxDragCopy
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class DoodleViewer(wxWindow):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxWindow.__init__(self, parent, -1, style=wxSUNKEN_BORDER)
|
||||||
|
self.log = log
|
||||||
|
self.SetBackgroundColour(wxWHITE)
|
||||||
|
self.lines = []
|
||||||
|
self.x = self.y = 0
|
||||||
|
dt = DoodleDropTarget(self, log)
|
||||||
|
self.SetDropTarget(dt)
|
||||||
|
|
||||||
|
def SetLines(self, lines):
|
||||||
|
self.lines = lines
|
||||||
|
self.Refresh()
|
||||||
|
|
||||||
|
def OnPaint(self, event):
|
||||||
|
dc = wxPaintDC(self)
|
||||||
|
self.DrawSavedLines(dc)
|
||||||
|
|
||||||
|
def DrawSavedLines(self, dc):
|
||||||
|
dc.BeginDrawing()
|
||||||
|
dc.SetPen(wxPen(wxRED, 3))
|
||||||
|
for line in self.lines:
|
||||||
|
for coords in line:
|
||||||
|
apply(dc.DrawLine, coords)
|
||||||
|
dc.EndDrawing()
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class CustomDnDPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||||
|
|
||||||
|
sizer = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
text = wxStaticText(self, -1,
|
||||||
|
"Draw a little picture in this window\n"
|
||||||
|
"then Ctrl-Drag it to the lower \n"
|
||||||
|
"window or to another application\n"
|
||||||
|
"that accepts BMP's as a drop target.\n\n"
|
||||||
|
"The lower window is accepting a\n"
|
||||||
|
"custom data type that is a pickled\n"
|
||||||
|
"Python list of lines data.")
|
||||||
|
sizer.Add(text, 1, wxALL, 10)
|
||||||
|
|
||||||
|
insizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
insizer.Add(DoodlePad(self, log), 1, wxEXPAND|wxALL, 5)
|
||||||
|
insizer.Add(DoodleViewer(self, log), 1, wxEXPAND|wxALL, 5)
|
||||||
|
|
||||||
|
sizer.Add(insizer, 1, wxEXPAND)
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
|
||||||
|
msg = "Custom Drag-And-Drop"
|
||||||
|
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
|
||||||
|
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||||
|
text.SetLabel(msg)
|
||||||
|
w,h = text.GetTextExtent(msg)
|
||||||
|
text.SetSize(wxSize(w,h+1))
|
||||||
|
text.SetForegroundColour(wxBLUE)
|
||||||
|
sizer.Add(text, 0, wxEXPAND|wxALL, 5)
|
||||||
|
sizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
|
||||||
|
|
||||||
|
sizer.Add(CustomDnDPanel(self, log), 1, wxEXPAND)
|
||||||
|
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import sys
|
||||||
|
class DummyLog:
|
||||||
|
def WriteText(self, text):
|
||||||
|
sys.stdout.write(text)
|
||||||
|
|
||||||
|
class TestApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
self.MakeFrame()
|
||||||
|
return true
|
||||||
|
|
||||||
|
def MakeFrame(self, event=None):
|
||||||
|
frame = wxFrame(None, -1, "Custom Drag and Drop", size=(550,400))
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(6543, "Window")
|
||||||
|
mb = wxMenuBar()
|
||||||
|
mb.Append(menu, "New")
|
||||||
|
frame.SetMenuBar(mb)
|
||||||
|
EVT_MENU(frame, 6543, self.MakeFrame)
|
||||||
|
panel = TestPanel(frame, DummyLog())
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
app = TestApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
This demo shows Drag and Drop using a custom data type and a custom data object. A type called "DoodleLines" is created and a Python Pickle of a list is actually transfered in the drag and drop opperation.
|
||||||
|
|
||||||
|
A second data object is also created containing a bitmap of the image and is made available to any drop target that accepts bitmaps, such as MS Word.
|
||||||
|
|
||||||
|
The two data objects are combined in a wxDataObjectComposite and the rest is handled by the framework.
|
||||||
|
"""
|
||||||
|
|
||||||
126
wxPython/demo/DialogUnits.py
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Name: DialogUnits.py
|
||||||
|
# Purpose: A minimal wxPython program that is a bit smarter than test1.
|
||||||
|
#
|
||||||
|
# Author: Robin Dunn
|
||||||
|
#
|
||||||
|
# Created: A long time ago, in a galaxy far, far away...
|
||||||
|
# RCS-ID: $Id$
|
||||||
|
# Copyright: (c) 1998 by Total Control Software
|
||||||
|
# Licence: wxWindows license
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
## import all of the wxPython GUI package
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
## Create a new frame class, derived from the wxPython Frame.
|
||||||
|
class MyFrame(wxFrame):
|
||||||
|
|
||||||
|
def __init__(self, parent, id, title):
|
||||||
|
# First, call the base class' __init__ method to create the frame
|
||||||
|
wxFrame.__init__(self, parent, id, title,
|
||||||
|
wxPoint(100, 100), wxSize(160, 100))
|
||||||
|
|
||||||
|
# Associate some events with methods of this class
|
||||||
|
EVT_SIZE(self, self.OnSize)
|
||||||
|
EVT_MOVE(self, self.OnMove)
|
||||||
|
|
||||||
|
# Add a panel and some controls to display the size and position
|
||||||
|
panel = wxPanel(self, -1)
|
||||||
|
wxStaticText(panel, -1, "Size:",
|
||||||
|
wxDLG_PNT(panel, wxPoint(4, 4)), wxDefaultSize)
|
||||||
|
wxStaticText(panel, -1, "Pos:",
|
||||||
|
wxDLG_PNT(panel, wxPoint(4, 16)), wxDefaultSize)
|
||||||
|
self.sizeCtrl = wxTextCtrl(panel, -1, "",
|
||||||
|
wxDLG_PNT(panel, wxPoint(24, 4)),
|
||||||
|
wxDLG_SZE(panel, wxSize(36, -1)),
|
||||||
|
wxTE_READONLY)
|
||||||
|
|
||||||
|
self.posCtrl = wxTextCtrl(panel, -1, "",
|
||||||
|
wxDLG_PNT(panel, wxPoint(24, 16)),
|
||||||
|
wxDLG_SZE(panel, wxSize(36, -1)),
|
||||||
|
wxTE_READONLY)
|
||||||
|
|
||||||
|
#print wxDLG_PNT(panel, wxPoint(24, 4)), wxDLG_SZE(panel, wxSize(36, -1))
|
||||||
|
#print wxDLG_PNT(panel, wxPoint(24, 16)),wxDLG_SZE(panel, wxSize(36, -1))
|
||||||
|
|
||||||
|
|
||||||
|
# This method is called automatically when the CLOSE event is
|
||||||
|
# sent to this window
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
# tell the window to kill itself
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
# This method is called by the System when the window is resized,
|
||||||
|
# because of the association above.
|
||||||
|
def OnSize(self, event):
|
||||||
|
size = event.GetSize()
|
||||||
|
self.sizeCtrl.SetValue("%s, %s" % (size.width, size.height))
|
||||||
|
|
||||||
|
# tell the event system to continue looking for an event handler,
|
||||||
|
# so the default handler will get called.
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
# This method is called by the System when the window is moved,
|
||||||
|
# because of the association above.
|
||||||
|
def OnMove(self, event):
|
||||||
|
pos = event.GetPosition()
|
||||||
|
self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# if running standalone
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
# Every wxWindows application must have a class derived from wxApp
|
||||||
|
class MyApp(wxApp):
|
||||||
|
|
||||||
|
# wxWindows calls this method to initialize the application
|
||||||
|
def OnInit(self):
|
||||||
|
|
||||||
|
# Create an instance of our customized Frame class
|
||||||
|
frame = MyFrame(NULL, -1, "This is a test")
|
||||||
|
frame.Show(true)
|
||||||
|
|
||||||
|
# Tell wxWindows that this is our main window
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
|
||||||
|
# Return a success flag
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
app = MyApp(0) # Create an instance of the application class
|
||||||
|
app.MainLoop() # Tell it to start processing events
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# if running as part of the Demo Framework...
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = MyFrame(frame, -1, "This is a test")
|
||||||
|
frame.otherWin = win
|
||||||
|
win.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
A simple example that shows how to use Dialog Units.
|
||||||
|
"""
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
196
wxPython/demo/DragAndDrop.py
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class ClipTextPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
#self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||||
|
|
||||||
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
sizer.Add(wxStaticText(self, -1,
|
||||||
|
"Copy/Paste text to/from\n"
|
||||||
|
"this window and other apps"), 0, wxEXPAND|wxALL, 2)
|
||||||
|
|
||||||
|
self.text = wxTextCtrl(self, -1, "", style=wxTE_MULTILINE|wxHSCROLL)
|
||||||
|
sizer.Add(self.text, 1, wxEXPAND)
|
||||||
|
|
||||||
|
hsz = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
hsz.Add(wxButton(self, 6050, " Copy "), 1, wxEXPAND|wxALL, 2)
|
||||||
|
hsz.Add(wxButton(self, 6051, " Paste "), 1, wxEXPAND|wxALL, 2)
|
||||||
|
sizer.Add(hsz, 0, wxEXPAND)
|
||||||
|
sizer.Add(wxButton(self, 6052, " Copy Bitmap "), 0, wxEXPAND|wxALL, 2)
|
||||||
|
|
||||||
|
EVT_BUTTON(self, 6050, self.OnCopy)
|
||||||
|
EVT_BUTTON(self, 6051, self.OnPaste)
|
||||||
|
EVT_BUTTON(self, 6052, self.OnCopyBitmap)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
|
|
||||||
|
def OnCopy(self, evt):
|
||||||
|
self.do = wxTextDataObject()
|
||||||
|
self.do.SetText(self.text.GetValue())
|
||||||
|
wxTheClipboard.Open()
|
||||||
|
wxTheClipboard.SetData(self.do)
|
||||||
|
wxTheClipboard.Close()
|
||||||
|
|
||||||
|
|
||||||
|
def OnPaste(self, evt):
|
||||||
|
do = wxTextDataObject()
|
||||||
|
wxTheClipboard.Open()
|
||||||
|
success = wxTheClipboard.GetData(do)
|
||||||
|
wxTheClipboard.Close()
|
||||||
|
if success:
|
||||||
|
self.text.SetValue(do.GetText())
|
||||||
|
else:
|
||||||
|
wxMessageBox("There is no data in the clipboard in the required format",
|
||||||
|
"Error")
|
||||||
|
|
||||||
|
def OnCopyBitmap(self, evt):
|
||||||
|
dlg = wxFileDialog(self, "Choose a bitmap to copy", wildcard="*.bmp")
|
||||||
|
if dlg.ShowModal() == wxID_OK:
|
||||||
|
bmp = wxBitmap(dlg.GetFilename(), wxBITMAP_TYPE_BMP)
|
||||||
|
bmpdo = wxBitmapDataObject(bmp)
|
||||||
|
wxTheClipboard.Open()
|
||||||
|
wxTheClipboard.SetData(bmpdo)
|
||||||
|
wxTheClipboard.Close()
|
||||||
|
|
||||||
|
wxMessageBox("The bitmap is now in the Clipboard. Switch to a graphics\n"
|
||||||
|
"editor and try pasting it in...")
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class OtherDropTarget(wxPyDropTarget):
|
||||||
|
def __init__(self, window, log):
|
||||||
|
wxPyDropTarget.__init__(self)
|
||||||
|
self.log = log
|
||||||
|
self.do = wxFileDataObject()
|
||||||
|
self.SetDataObject(self.do)
|
||||||
|
|
||||||
|
def OnEnter(self, x, y, d):
|
||||||
|
self.log.WriteText("OnEnter: %d, %d, %d\n" % (x, y, d))
|
||||||
|
return wxDragCopy
|
||||||
|
|
||||||
|
#def OnDragOver(self, x, y, d):
|
||||||
|
# self.log.WriteText("OnDragOver: %d, %d, %d\n" % (x, y, d))
|
||||||
|
# return wxDragCopy
|
||||||
|
|
||||||
|
def OnLeave(self):
|
||||||
|
self.log.WriteText("OnLeave\n")
|
||||||
|
|
||||||
|
def OnDrop(self, x, y):
|
||||||
|
self.log.WriteText("OnDrop: %d %d\n" % (x, y))
|
||||||
|
return true
|
||||||
|
|
||||||
|
def OnData(self, x, y, d):
|
||||||
|
self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
|
||||||
|
self.GetData()
|
||||||
|
self.log.WriteText("%s\n" % self.do.GetFilenames())
|
||||||
|
return d
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class MyFileDropTarget(wxFileDropTarget):
|
||||||
|
def __init__(self, window, log):
|
||||||
|
wxFileDropTarget.__init__(self)
|
||||||
|
self.window = window
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
def OnDropFiles(self, x, y, filenames):
|
||||||
|
self.window.SetInsertionPointEnd()
|
||||||
|
self.window.WriteText("\n%d file(s) dropped at %d,%d:\n" %
|
||||||
|
(len(filenames), x, y))
|
||||||
|
for file in filenames:
|
||||||
|
self.window.WriteText(file + '\n')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class FileDropPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
#self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||||
|
|
||||||
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
sizer.Add(wxStaticText(self, -1, " \nDrag some files here:"),
|
||||||
|
0, wxEXPAND|wxALL, 2)
|
||||||
|
|
||||||
|
self.text = wxTextCtrl(self, -1, "",
|
||||||
|
style = wxTE_MULTILINE|wxHSCROLL|wxTE_READONLY)
|
||||||
|
dt = MyFileDropTarget(self, log)
|
||||||
|
self.text.SetDropTarget(dt)
|
||||||
|
sizer.Add(self.text, 1, wxEXPAND)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
|
|
||||||
|
def WriteText(self, text):
|
||||||
|
self.text.WriteText(text)
|
||||||
|
|
||||||
|
def SetInsertionPointEnd(self):
|
||||||
|
self.text.SetInsertionPointEnd()
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
outsideSizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
|
||||||
|
msg = "Clipboard / Drag-And-Drop"
|
||||||
|
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
|
||||||
|
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||||
|
text.SetLabel(msg)
|
||||||
|
w,h = text.GetTextExtent(msg)
|
||||||
|
text.SetSize(wxSize(w,h+1))
|
||||||
|
text.SetForegroundColour(wxBLUE)
|
||||||
|
outsideSizer.Add(text, 0, wxEXPAND|wxALL, 5)
|
||||||
|
outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
|
||||||
|
|
||||||
|
inSizer = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
inSizer.Add(ClipTextPanel(self, log), 1, wxEXPAND)
|
||||||
|
inSizer.Add(FileDropPanel(self, log), 1, wxEXPAND)
|
||||||
|
|
||||||
|
outsideSizer.Add(inSizer, 1, wxEXPAND)
|
||||||
|
self.SetSizer(outsideSizer)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
This demo shows some examples of data transfer through clipboard or drag and drop. In wxWindows, these two ways to transfer data (either between different applications or inside one and the same) are very similar which allows to implement both of them using almost the same code - or, in other words, if you implement drag and drop support for your application, you get clipboard support for free and vice versa.
|
||||||
|
|
||||||
|
At the heart of both clipboard and drag and drop operations lies the wxDataObject class. The objects of this class (or, to be precise, classes derived from it) represent the data which is being carried by the mouse during drag and drop operation or copied to or pasted from the clipboard. wxDataObject is a "smart" piece of data because it knows which formats it supports (see GetFormatCount and GetAllFormats) and knows how to render itself in any of them (see GetDataHere). It can also receive its value from the outside in a format it supports if it implements the SetData method. Please see the documentation of this class for more details.
|
||||||
|
|
||||||
|
Both clipboard and drag and drop operations have two sides: the source and target, the data provider and the data receiver. These which may be in the same application and even the same window when, for example, you drag some text from one position to another in a word processor. Let us describe what each of them should do.
|
||||||
|
|
||||||
|
"""
|
||||||
47
wxPython/demo/FileBrowseButton.py
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.filebrowsebutton import FileBrowseButton, FileBrowseButtonWithHistory
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, ID, log):
|
||||||
|
wxPanel.__init__(self, parent, ID)
|
||||||
|
self.log = log
|
||||||
|
self.fbb = FileBrowseButton(self, -1, wxPoint(20,20), wxSize(450, -1),
|
||||||
|
changeCallback = self.fbbCallback)
|
||||||
|
self.fbbh = FileBrowseButtonWithHistory(self, -1, wxPoint(20, 50),
|
||||||
|
wxSize(450, -1),
|
||||||
|
#changeCallback = self.fbbhCallback
|
||||||
|
)
|
||||||
|
|
||||||
|
self.fbbh.SetHistory(['You', 'can', 'put', 'some', 'file', 'names', 'here'])
|
||||||
|
|
||||||
|
|
||||||
|
def fbbCallback(self, evt):
|
||||||
|
self.log.write('FileBrowseButton: %s\n' % evt.GetString())
|
||||||
|
|
||||||
|
|
||||||
|
def fbbhCallback(self, evt):
|
||||||
|
if hasattr(self, 'fbbh'):
|
||||||
|
value = evt.GetString()
|
||||||
|
self.log.write('FileBrowseButtonWithHistory: %s\n' % value)
|
||||||
|
history = self.fbbh.GetHistory()
|
||||||
|
history.append(value)
|
||||||
|
self.fbbh.SetHistory(history)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, -1, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = FileBrowseButton.__doc__
|
||||||
61
wxPython/demo/FontEnumerator.py
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
## class MyFontEnumerator(wxFontEnumerator):
|
||||||
|
## def __init__(self, list):
|
||||||
|
## wxFontEnumerator.__init__(self)
|
||||||
|
## self.list = list
|
||||||
|
|
||||||
|
## def OnFacename(self, face):
|
||||||
|
## self.list.append(face)
|
||||||
|
## return true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
## list = []
|
||||||
|
## e = MyFontEnumerator(list)
|
||||||
|
## e.EnumerateFacenames()
|
||||||
|
|
||||||
|
e = wxFontEnumerator()
|
||||||
|
e.EnumerateFacenames()
|
||||||
|
list = e.GetFacenames()
|
||||||
|
|
||||||
|
list.sort()
|
||||||
|
|
||||||
|
wxStaticText(self, -1, "Face names:", wxPoint(15, 50), wxSize(65, 18))
|
||||||
|
self.lb1 = wxListBox(self, 60, wxPoint(80, 50), wxSize(200, 250),
|
||||||
|
list, wxLB_SINGLE)
|
||||||
|
self.lb1.SetSelection(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding.
|
||||||
|
|
||||||
|
"""
|
||||||
92
wxPython/demo/GenericButtons.py
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.buttons import wxGenButton, wxGenBitmapButton, \
|
||||||
|
wxGenToggleButton, wxGenBitmapToggleButton
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
b = wxButton(self, -1, "A real button", (10,10))
|
||||||
|
b.SetDefault()
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||||
|
b = wxButton(self, -1, "non-default", (140, 10))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||||
|
#wxTextCtrl(self, -1, "", (10,40))
|
||||||
|
|
||||||
|
b = wxGenButton(self, -1, 'Hello', (10,65))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||||
|
b = wxGenButton(self, -1, 'disabled', (140,65))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||||
|
b.Enable(false)
|
||||||
|
|
||||||
|
b = wxGenButton(self, -1, 'bigger', (250,50))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||||
|
b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||||
|
b.SetBezelWidth(5)
|
||||||
|
b.SetBestSize()
|
||||||
|
b.SetBackgroundColour(wxNamedColour("Navy"))
|
||||||
|
b.SetForegroundColour(wxWHITE)
|
||||||
|
#b.SetUseFocusIndicator(false)
|
||||||
|
|
||||||
|
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 = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP)
|
||||||
|
mask = wxMaskColour(bmp, wxBLUE)
|
||||||
|
bmp.SetMask(mask)
|
||||||
|
b.SetBitmapLabel(bmp)
|
||||||
|
bmp = wxBitmap('bitmaps/lb2.bmp', wxBITMAP_TYPE_BMP)
|
||||||
|
mask = wxMaskColour(bmp, wxBLUE)
|
||||||
|
bmp.SetMask(mask)
|
||||||
|
b.SetBitmapSelected(bmp)
|
||||||
|
b.SetBestSize()
|
||||||
|
|
||||||
|
b = wxGenToggleButton(self, -1, "Toggle Button", (10, 230))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnToggleButton)
|
||||||
|
|
||||||
|
|
||||||
|
b = wxGenBitmapToggleButton(self, -1, None, (140, 230))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnToggleButton)
|
||||||
|
bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP)
|
||||||
|
mask = wxMaskColour(bmp, wxBLUE)
|
||||||
|
bmp.SetMask(mask)
|
||||||
|
b.SetBitmapLabel(bmp)
|
||||||
|
bmp = wxBitmap('bitmaps/lb2.bmp', wxBITMAP_TYPE_BMP)
|
||||||
|
mask = wxMaskColour(bmp, wxBLUE)
|
||||||
|
bmp.SetMask(mask)
|
||||||
|
b.SetBitmapSelected(bmp)
|
||||||
|
b.SetToggle(true)
|
||||||
|
b.SetBestSize()
|
||||||
|
|
||||||
|
|
||||||
|
def OnButton(self, event):
|
||||||
|
self.log.WriteText("Button Clicked: %d\n" % event.GetId())
|
||||||
|
|
||||||
|
def OnToggleButton(self, event):
|
||||||
|
msg = (event.GetIsDown() and "on") or "off"
|
||||||
|
self.log.WriteText("Button %d Toggled: %s\n" % (event.GetId(), msg))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
import wxPython.lib.buttons
|
||||||
|
overview = wxPython.lib.buttons.__doc__
|
||||||
153
wxPython/demo/GridCustTable.py
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.grid import *
|
||||||
|
|
||||||
|
import string
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class CustomDataTable(wxPyGridTableBase):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, log):
|
||||||
|
wxPyGridTableBase.__init__(self)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
self.colLabels = ['ID', 'Description', 'Severity', 'Priority', 'Platform',
|
||||||
|
'Opened?', 'Fixed?', 'Tested?']
|
||||||
|
|
||||||
|
self.dataTypes = [wxGRID_VALUE_NUMBER,
|
||||||
|
wxGRID_VALUE_STRING,
|
||||||
|
wxGRID_VALUE_CHOICE + ':only in a million years!,wish list,minor,normal,major,critical',
|
||||||
|
wxGRID_VALUE_NUMBER + ':1,5',
|
||||||
|
wxGRID_VALUE_CHOICE + ':all,MSW,GTK,other',
|
||||||
|
wxGRID_VALUE_BOOL,
|
||||||
|
wxGRID_VALUE_BOOL,
|
||||||
|
wxGRID_VALUE_BOOL]
|
||||||
|
|
||||||
|
self.data = [
|
||||||
|
[1010, "The foo doesn't bar", "major", 1, 'MSW', 1, 1, 1],
|
||||||
|
[1011, "I've got a wicket in my wocket", "wish list", 2, 'other', 0, 0, 0],
|
||||||
|
[1012, "Rectangle() returns a triangle", "critical", 5, 'all', 0, 0, 0]
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
#--------------------------------------------------
|
||||||
|
# required methods for the wxPyGridTableBase interface
|
||||||
|
|
||||||
|
def GetNumberRows(self):
|
||||||
|
return len(self.data) + 1
|
||||||
|
|
||||||
|
def GetNumberCols(self):
|
||||||
|
return len(self.data[0])
|
||||||
|
|
||||||
|
def IsEmptyCell(self, row, col):
|
||||||
|
return not self.data[row][col]
|
||||||
|
|
||||||
|
# Get/Set values in the table. The Python version of these
|
||||||
|
# methods can handle any data-type, (as long as the Editor and
|
||||||
|
# Renderer understands the type too,) not just strings as in the
|
||||||
|
# C++ version.
|
||||||
|
def GetValue(self, row, col):
|
||||||
|
try:
|
||||||
|
return self.data[row][col]
|
||||||
|
except IndexError:
|
||||||
|
return ''
|
||||||
|
|
||||||
|
def SetValue(self, row, col, value):
|
||||||
|
try:
|
||||||
|
self.data[row][col] = value
|
||||||
|
except IndexError:
|
||||||
|
# add a new row
|
||||||
|
self.data.append([''] * self.GetNumberCols())
|
||||||
|
self.SetValue(row, col, value)
|
||||||
|
|
||||||
|
# tell the grid we've added a row
|
||||||
|
msg = wxGridTableMessage(self, # The table
|
||||||
|
wxGRIDTABLE_NOTIFY_ROWS_APPENDED, # what we did to it
|
||||||
|
1) # how many
|
||||||
|
|
||||||
|
self.GetView().ProcessTableMessage(msg)
|
||||||
|
|
||||||
|
|
||||||
|
#--------------------------------------------------
|
||||||
|
# Some optional methods
|
||||||
|
|
||||||
|
# Called when the grid needs to display labels
|
||||||
|
def GetColLabelValue(self, col):
|
||||||
|
return self.colLabels[col]
|
||||||
|
|
||||||
|
# Called to determine the kind of editor/renderer to use by
|
||||||
|
# default, doesn't necessarily have to be the same type used
|
||||||
|
# nativly by the editor/renderer if they know how to convert.
|
||||||
|
def GetTypeName(self, row, col):
|
||||||
|
return self.dataTypes[col]
|
||||||
|
|
||||||
|
# Called to determine how the data can be fetched and stored by the
|
||||||
|
# editor and renderer. This allows you to enforce some type-safety
|
||||||
|
# in the grid.
|
||||||
|
def CanGetValueAs(self, row, col, typeName):
|
||||||
|
colType = string.split(self.dataTypes[col], ':')[0]
|
||||||
|
if typeName == colType:
|
||||||
|
return true
|
||||||
|
else:
|
||||||
|
return false
|
||||||
|
|
||||||
|
def CanSetValueAs(self, row, col, typeName):
|
||||||
|
return self.CanGetValueAs(row, col, typeName)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class CustTableGrid(wxGrid):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxGrid.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
table = CustomDataTable(log)
|
||||||
|
|
||||||
|
# The second parameter means that the grid is to take ownership of the
|
||||||
|
# table and will destroy it when done. Otherwise you would need to keep
|
||||||
|
# a reference to it and call it's Destroy method later.
|
||||||
|
self.SetTable(table, true)
|
||||||
|
|
||||||
|
self.SetRowLabelSize(0)
|
||||||
|
self.SetMargins(0,0)
|
||||||
|
self.AutoSizeColumns(false)
|
||||||
|
|
||||||
|
EVT_GRID_CELL_LEFT_DCLICK(self, self.OnLeftDClick)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# I do this because I don't like the default behaviour of not starting the
|
||||||
|
# cell editor on double clicks, but only a second click.
|
||||||
|
def OnLeftDClick(self, evt):
|
||||||
|
if self.CanEnableCellControl():
|
||||||
|
self.EnableCellEditControl()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxFrame.__init__(self, parent, -1, "Custom Table, data driven Grid Demo", size=(640,480))
|
||||||
|
grid = CustTableGrid(self, log)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import sys
|
||||||
|
app = wxPySimpleApp()
|
||||||
|
frame = TestFrame(None, sys.stdout)
|
||||||
|
frame.Show(true)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
71
wxPython/demo/GridHugeTable.py
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.grid import *
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class HugeTable(wxPyGridTableBase):
|
||||||
|
|
||||||
|
"""
|
||||||
|
This is all it takes to make a custom data table to plug into a
|
||||||
|
wxGrid. There are many more methods that can be overridden, but
|
||||||
|
the ones shown below are the required ones. This table simply
|
||||||
|
provides strings containing the row and column values.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, log):
|
||||||
|
wxPyGridTableBase.__init__(self)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
def GetNumberRows(self):
|
||||||
|
return 10000
|
||||||
|
|
||||||
|
def GetNumberCols(self):
|
||||||
|
return 10000
|
||||||
|
|
||||||
|
def IsEmptyCell(self, row, col):
|
||||||
|
return false
|
||||||
|
|
||||||
|
def GetValue(self, row, col):
|
||||||
|
return str( (row, col) )
|
||||||
|
|
||||||
|
def SetValue(self, row, col, value):
|
||||||
|
self.log.write('SetValue(%d, %d, "%s") ignored.\n' % (row, col, value))
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class HugeTableGrid(wxGrid):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxGrid.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
table = HugeTable(log)
|
||||||
|
|
||||||
|
# The second parameter means that the grid is to take ownership of the
|
||||||
|
# table and will destroy it when done. Otherwise you would need to keep
|
||||||
|
# a reference to it and call it's Destroy method later.
|
||||||
|
self.SetTable(table, true)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxFrame.__init__(self, parent, -1, "Huge (virtual) Table Demo", size=(640,480))
|
||||||
|
grid = HugeTableGrid(self, log)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import sys
|
||||||
|
app = wxPySimpleApp()
|
||||||
|
frame = TestFrame(None, sys.stdout)
|
||||||
|
frame.Show(true)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
153
wxPython/demo/GridSimple.py
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.grid import *
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class SimpleGrid(wxGrid):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxGrid.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
self.CreateGrid(25, 25)
|
||||||
|
|
||||||
|
# simple cell formatting
|
||||||
|
self.SetColSize(3, 200)
|
||||||
|
self.SetRowSize(4, 45)
|
||||||
|
self.SetCellValue(0, 0, "First cell")
|
||||||
|
self.SetCellValue(1, 1, "Another cell")
|
||||||
|
self.SetCellValue(2, 2, "Yet another cell")
|
||||||
|
self.SetCellFont(0, 0, wxFont(12, wxROMAN, wxITALIC, wxNORMAL))
|
||||||
|
self.SetCellTextColour(1, 1, wxRED)
|
||||||
|
self.SetCellBackgroundColour(2, 2, wxCYAN)
|
||||||
|
|
||||||
|
# attribute objects let you keep a set of formatting values
|
||||||
|
# in one spot, and reuse them if needed
|
||||||
|
attr = wxGridCellAttr()
|
||||||
|
attr.SetTextColour(wxBLACK)
|
||||||
|
attr.SetBackgroundColour(wxRED)
|
||||||
|
attr.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD))
|
||||||
|
|
||||||
|
# you can set cell attributes for the whole row (or column)
|
||||||
|
self.SetRowAttr(5, attr)
|
||||||
|
|
||||||
|
|
||||||
|
# test all the events
|
||||||
|
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
|
||||||
|
EVT_GRID_CELL_RIGHT_CLICK(self, self.OnCellRightClick)
|
||||||
|
EVT_GRID_CELL_LEFT_DCLICK(self, self.OnCellLeftDClick)
|
||||||
|
EVT_GRID_CELL_RIGHT_DCLICK(self, self.OnCellRightDClick)
|
||||||
|
|
||||||
|
EVT_GRID_LABEL_LEFT_CLICK(self, self.OnLabelLeftClick)
|
||||||
|
EVT_GRID_LABEL_RIGHT_CLICK(self, self.OnLabelRightClick)
|
||||||
|
EVT_GRID_LABEL_LEFT_DCLICK(self, self.OnLabelLeftDClick)
|
||||||
|
EVT_GRID_LABEL_RIGHT_DCLICK(self, self.OnLabelRightDClick)
|
||||||
|
|
||||||
|
EVT_GRID_ROW_SIZE(self, self.OnRowSize)
|
||||||
|
EVT_GRID_COL_SIZE(self, self.OnColSize)
|
||||||
|
|
||||||
|
EVT_GRID_RANGE_SELECT(self, self.OnRangeSelect)
|
||||||
|
EVT_GRID_CELL_CHANGE(self, self.OnCellChange)
|
||||||
|
EVT_GRID_SELECT_CELL(self, self.OnSelectCell)
|
||||||
|
|
||||||
|
EVT_GRID_EDITOR_SHOWN(self, self.OnEditorShown)
|
||||||
|
EVT_GRID_EDITOR_HIDDEN(self, self.OnEditorHidden)
|
||||||
|
|
||||||
|
|
||||||
|
def OnCellLeftClick(self, evt):
|
||||||
|
self.log.write("OnCellLeftClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnCellRightClick(self, evt):
|
||||||
|
self.log.write("OnCellRightClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnCellLeftDClick(self, evt):
|
||||||
|
self.log.write("OnCellLeftDClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnCellRightDClick(self, evt):
|
||||||
|
self.log.write("OnCellRightDClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnLabelLeftClick(self, evt):
|
||||||
|
self.log.write("OnLabelLeftClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnLabelRightClick(self, evt):
|
||||||
|
self.log.write("OnLabelRightClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnLabelLeftDClick(self, evt):
|
||||||
|
self.log.write("OnLabelLeftDClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnLabelRightDClick(self, evt):
|
||||||
|
self.log.write("OnLabelRightDClick: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
|
||||||
|
def OnRowSize(self, evt):
|
||||||
|
self.log.write("OnRowSize: row %d, %s\n" %
|
||||||
|
(evt.GetRowOrCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnColSize(self, evt):
|
||||||
|
self.log.write("OnColSize: col %d, %s\n" %
|
||||||
|
(evt.GetRowOrCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnRangeSelect(self, evt):
|
||||||
|
if evt.Selecting():
|
||||||
|
self.log.write("OnRangeSelect: top-left %s, bottom-right %s\n" %
|
||||||
|
(evt.GetTopLeftCoords(), evt.GetBottomRightCoords()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnCellChange(self, evt):
|
||||||
|
self.log.write("OnCellChange: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnSelectCell(self, evt):
|
||||||
|
self.log.write("OnSelectCell: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnEditorShown(self, evt):
|
||||||
|
self.log.write("OnEditorShown: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
def OnEditorHidden(self, evt):
|
||||||
|
self.log.write("OnEditorHidden: (%d,%d) %s\n" %
|
||||||
|
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxFrame.__init__(self, parent, -1, "Simple Grid Demo", size=(640,480))
|
||||||
|
grid = SimpleGrid(self, log)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import sys
|
||||||
|
app = wxPySimpleApp()
|
||||||
|
frame = TestFrame(None, sys.stdout)
|
||||||
|
frame.Show(true)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
181
wxPython/demo/GridStdEdRend.py
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.grid import *
|
||||||
|
|
||||||
|
import string, random
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyCustomRenderer(wxPyGridCellRenderer):
|
||||||
|
def __init__(self):
|
||||||
|
wxPyGridCellRenderer.__init__(self)
|
||||||
|
|
||||||
|
def Draw(self, grid, attr, dc, rect, row, col, isSelected):
|
||||||
|
dc.SetBackgroundMode(wxSOLID)
|
||||||
|
dc.SetBrush(wxBrush(wxBLACK, wxSOLID))
|
||||||
|
dc.SetPen(wxTRANSPARENT_PEN)
|
||||||
|
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height)
|
||||||
|
|
||||||
|
dc.SetBackgroundMode(wxTRANSPARENT)
|
||||||
|
dc.SetFont(attr.GetFont())
|
||||||
|
|
||||||
|
text = grid.GetCellValue(row, col)
|
||||||
|
colors = [wxRED, wxWHITE, wxCYAN]
|
||||||
|
x = rect.x + 1
|
||||||
|
y = rect.y + 1
|
||||||
|
for ch in text:
|
||||||
|
dc.SetTextForeground(random.choice(colors))
|
||||||
|
dc.DrawText(ch, x, y)
|
||||||
|
w, h = dc.GetTextExtent(ch)
|
||||||
|
x = x + w
|
||||||
|
if x > rect.right - 5:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
def GetBestSize(self, grid, attr, dc, row, col):
|
||||||
|
text = grid.GetCellValue(row, col)
|
||||||
|
dc.SetFont(attr.GetFont())
|
||||||
|
w, h = dc.GetTextExtent(text)
|
||||||
|
return wxSize(w, h)
|
||||||
|
|
||||||
|
|
||||||
|
def Clone(self):
|
||||||
|
return MyCustomRenderer
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
rendererDemoData = [
|
||||||
|
('wxGridCellStringRenderer\n(the default)', 'this is a text value', wxGridCellStringRenderer, ()),
|
||||||
|
('wxGridCellNumberRenderer', '12345', wxGridCellNumberRenderer, ()),
|
||||||
|
('wxGridCellFloatRenderer', '1234.5678', wxGridCellFloatRenderer, (6,2)),
|
||||||
|
('wxGridCellBoolRenderer', '1', wxGridCellBoolRenderer, ()),
|
||||||
|
('MyCustomRenderer', 'This is my renderer', MyCustomRenderer, ()),
|
||||||
|
]
|
||||||
|
|
||||||
|
editorDemoData = [
|
||||||
|
('wxGridCellTextEditor\n(the default)', 'Here is some more text', wxGridCellTextEditor, ()),
|
||||||
|
('wxGridCellNumberEditor\nwith min,max', '101', wxGridCellNumberEditor, (5, 10005)),
|
||||||
|
('wxGridCellNumberEditor\nwithout bounds', '101', wxGridCellNumberEditor, ()),
|
||||||
|
('wxGridCellFloatEditor', '1234.5678', wxGridCellFloatEditor, ()),
|
||||||
|
('wxGridCellBoolEditor', '1', wxGridCellBoolEditor, ()),
|
||||||
|
('wxGridCellChoiceEditor', 'one', wxGridCellChoiceEditor, (['one', 'two', 'three', 'four',
|
||||||
|
'kick', 'Microsoft', 'out the',
|
||||||
|
'door'], false)),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
comboDemoData = [
|
||||||
|
('wxGridCellNumberRenderer\nwxGridCellNumberEditor', '20792', wxGridCellNumberRenderer, wxGridCellNumberEditor),
|
||||||
|
('wxGridCellBoolRenderer\nwxGridCellBoolEditor', '1', wxGridCellBoolRenderer, wxGridCellBoolEditor),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class EditorsAndRenderersGrid(wxGrid):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxGrid.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
self.CreateGrid(25, 8)
|
||||||
|
renCol = 1
|
||||||
|
edCol = 4
|
||||||
|
|
||||||
|
|
||||||
|
self.SetCellValue(0, renCol, '''\
|
||||||
|
Cell Renderers are used to draw
|
||||||
|
the contents of the cell when they
|
||||||
|
need to be refreshed. Different
|
||||||
|
types of Renderers can be plugged in
|
||||||
|
to different cells in the grid, it can
|
||||||
|
even be automatically determined based
|
||||||
|
on the type of data in the cell.
|
||||||
|
''')
|
||||||
|
|
||||||
|
self.SetCellValue(0, edCol, '''\
|
||||||
|
Cell Editors are used when the
|
||||||
|
value of the cell is edited by
|
||||||
|
the user. An editor class is
|
||||||
|
wrapped around a an object
|
||||||
|
derived from wxControl and it
|
||||||
|
implements some methods required
|
||||||
|
to integrate with the grid.
|
||||||
|
''')
|
||||||
|
|
||||||
|
self.SetCellValue(16, renCol, '''\
|
||||||
|
Here are some combinations of Editors and
|
||||||
|
Renderers used together.
|
||||||
|
''')
|
||||||
|
|
||||||
|
row = 2
|
||||||
|
for label, value, renderClass, args in rendererDemoData:
|
||||||
|
renderer = apply(renderClass, args)
|
||||||
|
self.SetCellValue(row, renCol, label)
|
||||||
|
self.SetCellValue(row, renCol+1, value)
|
||||||
|
self.SetCellRenderer(row, renCol+1, renderer)
|
||||||
|
row = row + 2
|
||||||
|
|
||||||
|
|
||||||
|
row = 2
|
||||||
|
for label, value, editorClass, args in editorDemoData:
|
||||||
|
editor = apply(editorClass, args)
|
||||||
|
self.SetCellValue(row, edCol, label)
|
||||||
|
self.SetCellValue(row, edCol+1, value)
|
||||||
|
self.SetCellEditor(row, edCol+1, editor)
|
||||||
|
row = row + 2
|
||||||
|
|
||||||
|
|
||||||
|
row = 18
|
||||||
|
for label, value, renClass, edClass in comboDemoData:
|
||||||
|
self.SetCellValue(row, renCol, label)
|
||||||
|
self.SetCellValue(row, renCol+1, value)
|
||||||
|
editor = apply(edClass, ()) #args)
|
||||||
|
renderer = apply(renClass, ()) #args)
|
||||||
|
self.SetCellEditor(row, renCol+1, editor)
|
||||||
|
self.SetCellRenderer(row, renCol+1, renderer)
|
||||||
|
row = row + 2
|
||||||
|
|
||||||
|
|
||||||
|
font = self.GetFont()
|
||||||
|
font.SetWeight(wxBOLD)
|
||||||
|
attr = wxGridCellAttr()
|
||||||
|
attr.SetFont(font)
|
||||||
|
attr.SetBackgroundColour(wxLIGHT_GREY)
|
||||||
|
attr.SetReadOnly(true)
|
||||||
|
attr.SetAlignment(wxRIGHT, -1)
|
||||||
|
self.SetColAttr(renCol, attr)
|
||||||
|
self.SetColAttr(edCol, attr)
|
||||||
|
|
||||||
|
# There is a bug in wxGTK for this method...
|
||||||
|
if wxPlatform != '__WXGTK__':
|
||||||
|
self.AutoSizeColumns(true)
|
||||||
|
self.AutoSizeRows(true)
|
||||||
|
|
||||||
|
EVT_GRID_CELL_LEFT_DCLICK(self, self.OnLeftDClick)
|
||||||
|
|
||||||
|
|
||||||
|
# I do this because I don't like the default behaviour of not starting the
|
||||||
|
# cell editor on double clicks, but only a second click.
|
||||||
|
def OnLeftDClick(self, evt):
|
||||||
|
if self.CanEnableCellControl():
|
||||||
|
self.EnableCellEditControl()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxFrame.__init__(self, parent, -1, "Editors and Renderers Demo", size=(640,480))
|
||||||
|
grid = EditorsAndRenderersGrid(self, log)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
import sys
|
||||||
|
app = wxPySimpleApp()
|
||||||
|
frame = TestFrame(None, sys.stdout)
|
||||||
|
frame.Show(true)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
62
wxPython/demo/Layoutf.py
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.layoutf import Layoutf
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestLayoutf(wxPanel):
|
||||||
|
def __init__(self, parent):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
EVT_BUTTON(self, 100, self.OnButton)
|
||||||
|
|
||||||
|
self.panelA = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER)
|
||||||
|
self.panelA.SetBackgroundColour(wxBLUE)
|
||||||
|
self.panelA.SetConstraints(Layoutf('t=t10#1;l=l10#1;b=b10#1;r%r50#1',(self,)))
|
||||||
|
|
||||||
|
self.panelB = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER)
|
||||||
|
self.panelB.SetBackgroundColour(wxRED)
|
||||||
|
self.panelB.SetConstraints(Layoutf('t=t10#1;r=r10#1;b%b30#1;l>10#2', (self,self.panelA)))
|
||||||
|
|
||||||
|
self.panelC = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER)
|
||||||
|
self.panelC.SetBackgroundColour(wxWHITE)
|
||||||
|
self.panelC.SetConstraints(Layoutf('t_10#3;r=r10#1;b=b10#1;l>10#2', (self,self.panelA,self.panelB)))
|
||||||
|
|
||||||
|
b = wxButton(self.panelA, 100, ' Panel A ')
|
||||||
|
b.SetConstraints(Layoutf('X=X#1;Y=Y#1;h*;w%w50#1', (self.panelA,)))
|
||||||
|
|
||||||
|
b = wxButton(self.panelB, 100, ' Panel B ')
|
||||||
|
b.SetConstraints(Layoutf('t=t2#1;r=r4#1;h*;w*', (self.panelB,)))
|
||||||
|
|
||||||
|
self.panelD = wxWindow(self.panelC, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER)
|
||||||
|
self.panelD.SetBackgroundColour(wxGREEN)
|
||||||
|
self.panelD.SetConstraints(Layoutf('b%h50#1;r%w50#1;h=h#2;w=w#2', (self.panelC, b)))
|
||||||
|
|
||||||
|
b = wxButton(self.panelC, 100, ' Panel C ')
|
||||||
|
b.SetConstraints(Layoutf('t_#1;l>#1;h*;w*', (self.panelD,)))
|
||||||
|
|
||||||
|
wxStaticText(self.panelD, -1, "Panel D", wxPoint(4, 4)).SetBackgroundColour(wxGREEN)
|
||||||
|
|
||||||
|
def OnButton(self, event):
|
||||||
|
wxBell()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestLayoutf(nb)
|
||||||
|
return win
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = Layoutf.__doc__
|
||||||
54
wxPython/demo/MDIDemo.py
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxScrolledWindow import MyCanvas
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyParentFrame(wxMDIParentFrame):
|
||||||
|
def __init__(self):
|
||||||
|
wxMDIParentFrame.__init__(self, None, -1, "MDI Parent", size=(600,400))
|
||||||
|
|
||||||
|
self.winCount = 0
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(5000, "&New Window")
|
||||||
|
menu.AppendSeparator()
|
||||||
|
menu.Append(5001, "E&xit")
|
||||||
|
|
||||||
|
menubar = wxMenuBar()
|
||||||
|
menubar.Append(menu, "&File")
|
||||||
|
self.SetMenuBar(menubar)
|
||||||
|
|
||||||
|
#self.CreateStatusBar()
|
||||||
|
|
||||||
|
EVT_MENU(self, 5000, self.OnNewWindow)
|
||||||
|
EVT_MENU(self, 5001, self.OnExit)
|
||||||
|
|
||||||
|
|
||||||
|
def OnExit(self, evt):
|
||||||
|
self.Close(true)
|
||||||
|
|
||||||
|
|
||||||
|
def OnNewWindow(self, evt):
|
||||||
|
self.winCount = self.winCount + 1
|
||||||
|
win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount)
|
||||||
|
cs = win.GetClientSize()
|
||||||
|
canvas = MyCanvas(win, size=cs)
|
||||||
|
win.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
frame = MyParentFrame()
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
app = MyApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
519
wxPython/demo/Main.py
Normal file
@@ -0,0 +1,519 @@
|
|||||||
|
#!/bin/env python
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Name: Main.py
|
||||||
|
# Purpose: Testing lots of stuff, controls, window types, etc.
|
||||||
|
#
|
||||||
|
# Author: Robin Dunn
|
||||||
|
#
|
||||||
|
# Created: A long time ago, in a galaxy far, far away...
|
||||||
|
# RCS-ID: $Id$
|
||||||
|
# Copyright: (c) 1999 by Total Control Software
|
||||||
|
# Licence: wxWindows license
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import sys, os
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.splashscreen import SplashScreen
|
||||||
|
from wxPython.html import wxHtmlWindow
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
_useSplitter = true
|
||||||
|
_useNestedSplitter = true
|
||||||
|
|
||||||
|
_treeList = [
|
||||||
|
('New since last release', ['wxGrid',
|
||||||
|
'wxStyledTextCtrl_1', 'wxStyledTextCtrl_2',
|
||||||
|
'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE',
|
||||||
|
'FileBrowseButton', 'wxCalendar']),
|
||||||
|
|
||||||
|
('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']),
|
||||||
|
|
||||||
|
('Non-Managed Windows', ['wxGrid', 'wxSashWindow',
|
||||||
|
'wxScrolledWindow', 'wxSplitterWindow',
|
||||||
|
'wxStatusBar', 'wxNotebook',
|
||||||
|
'wxHtmlWindow']),
|
||||||
|
|
||||||
|
('Common Dialogs', ['wxColourDialog', 'wxDirDialog', 'wxFileDialog',
|
||||||
|
'wxSingleChoiceDialog', 'wxTextEntryDialog',
|
||||||
|
'wxFontDialog', 'wxPageSetupDialog', 'wxPrintDialog',
|
||||||
|
'wxMessageDialog', 'wxProgressDialog']),
|
||||||
|
|
||||||
|
('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice',
|
||||||
|
'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl',
|
||||||
|
'wxTreeCtrl', 'wxSpinButton', 'wxStaticText', 'wxStaticBitmap',
|
||||||
|
'wxRadioBox', 'wxSlider', 'wxToolBar', #'wxToggleButton'
|
||||||
|
]),
|
||||||
|
|
||||||
|
('Window Layout', ['wxLayoutConstraints', 'Sizers', 'OldSizers']),
|
||||||
|
|
||||||
|
('Miscellaneous', [ 'DragAndDrop', 'CustomDragAndDrop', 'FontEnumerator',
|
||||||
|
'wxTimer', 'wxValidator', 'wxGLCanvas', 'DialogUnits',
|
||||||
|
'wxImage', 'wxMask', 'PrintFramework', 'wxOGL',
|
||||||
|
'PythonEvents', 'Threads']),
|
||||||
|
|
||||||
|
('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
|
||||||
|
'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
|
||||||
|
'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
|
||||||
|
'FileBrowseButton', 'GenericButtons', 'wxEditor']),
|
||||||
|
|
||||||
|
('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']),
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxPythonDemo(wxFrame):
|
||||||
|
def __init__(self, parent, id, title):
|
||||||
|
wxFrame.__init__(self, parent, -1, title, size = (800, 600),
|
||||||
|
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
|
|
||||||
|
self.cwd = os.getcwd()
|
||||||
|
|
||||||
|
if wxPlatform == '__WXMSW__':
|
||||||
|
self.icon = wxIcon('bitmaps/mondrian.ico', wxBITMAP_TYPE_ICO)
|
||||||
|
self.SetIcon(self.icon)
|
||||||
|
|
||||||
|
self.otherWin = None
|
||||||
|
EVT_IDLE(self, self.OnIdle)
|
||||||
|
|
||||||
|
self.Centre(wxBOTH)
|
||||||
|
self.CreateStatusBar(1, wxST_SIZEGRIP)
|
||||||
|
|
||||||
|
if _useSplitter:
|
||||||
|
splitter = wxSplitterWindow(self, -1, style=wxNO_3D|wxSP_3D)
|
||||||
|
if _useNestedSplitter:
|
||||||
|
splitter2 = wxSplitterWindow(splitter, -1, style=wxNO_3D|wxSP_3D)
|
||||||
|
logParent = nbParent = splitter2
|
||||||
|
else:
|
||||||
|
nbParent = splitter
|
||||||
|
logParent = wxFrame(self, -1, "wxPython Demo: log window",
|
||||||
|
(0,0), (500, 150))
|
||||||
|
logParent.Show(true)
|
||||||
|
else:
|
||||||
|
nbParent = self
|
||||||
|
logParent = wxFrame(self, -1, "wxPython Demo: log window",
|
||||||
|
(0,0), (500, 150))
|
||||||
|
logParent.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent TreeCtrl from displaying all items after destruction
|
||||||
|
self.dying = false
|
||||||
|
|
||||||
|
# Make a File menu
|
||||||
|
self.mainmenu = wxMenuBar()
|
||||||
|
menu = wxMenu()
|
||||||
|
exitID = wxNewId()
|
||||||
|
menu.Append(exitID, 'E&xit\tAlt-X', 'Get the heck outta here!')
|
||||||
|
EVT_MENU(self, exitID, self.OnFileExit)
|
||||||
|
self.mainmenu.Append(menu, '&File')
|
||||||
|
|
||||||
|
# Make a Demo menu
|
||||||
|
menu = wxMenu()
|
||||||
|
for item in _treeList:
|
||||||
|
submenu = wxMenu()
|
||||||
|
for childItem in item[1]:
|
||||||
|
mID = wxNewId()
|
||||||
|
submenu.Append(mID, childItem)
|
||||||
|
EVT_MENU(self, mID, self.OnDemoMenu)
|
||||||
|
menu.AppendMenu(wxNewId(), item[0], submenu)
|
||||||
|
self.mainmenu.Append(menu, '&Demo')
|
||||||
|
|
||||||
|
|
||||||
|
# Make a Help menu
|
||||||
|
helpID = wxNewId()
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(helpID, '&About\tCtrl-H', 'wxPython RULES!!!')
|
||||||
|
EVT_MENU(self, helpID, self.OnHelpAbout)
|
||||||
|
self.mainmenu.Append(menu, '&Help')
|
||||||
|
self.SetMenuBar(self.mainmenu)
|
||||||
|
|
||||||
|
# set the menu accellerator table...
|
||||||
|
aTable = wxAcceleratorTable([(wxACCEL_ALT, ord('X'), exitID),
|
||||||
|
(wxACCEL_CTRL, ord('H'), helpID)])
|
||||||
|
self.SetAcceleratorTable(aTable)
|
||||||
|
|
||||||
|
|
||||||
|
# Create a TreeCtrl
|
||||||
|
if _useSplitter:
|
||||||
|
tID = wxNewId()
|
||||||
|
self.treeMap = {}
|
||||||
|
self.tree = wxTreeCtrl(splitter, tID,
|
||||||
|
style=wxTR_HAS_BUTTONS |
|
||||||
|
wxTR_EDIT_LABELS |
|
||||||
|
wxTR_HAS_VARIABLE_ROW_HEIGHT |
|
||||||
|
wxSUNKEN_BORDER)
|
||||||
|
#self.tree.SetBackgroundColour(wxNamedColour("Pink"))
|
||||||
|
root = self.tree.AddRoot("Overview")
|
||||||
|
firstChild = None
|
||||||
|
for item in _treeList:
|
||||||
|
child = self.tree.AppendItem(root, item[0])
|
||||||
|
if not firstChild: firstChild = child
|
||||||
|
for childItem in item[1]:
|
||||||
|
theDemo = self.tree.AppendItem(child, childItem)
|
||||||
|
self.treeMap[childItem] = theDemo
|
||||||
|
|
||||||
|
self.tree.Expand(root)
|
||||||
|
self.tree.Expand(firstChild)
|
||||||
|
EVT_TREE_ITEM_EXPANDED (self.tree, tID, self.OnItemExpanded)
|
||||||
|
EVT_TREE_ITEM_COLLAPSED (self.tree, tID, self.OnItemCollapsed)
|
||||||
|
EVT_TREE_SEL_CHANGED (self.tree, tID, self.OnSelChanged)
|
||||||
|
EVT_LEFT_DOWN (self.tree, self.OnTreeLeftDown)
|
||||||
|
|
||||||
|
# Create a Notebook
|
||||||
|
self.nb = wxNotebook(nbParent, -1)
|
||||||
|
|
||||||
|
# Set up a TextCtrl on the Overview Notebook page
|
||||||
|
self.ovr = wxHtmlWindow(self.nb, -1)
|
||||||
|
self.nb.AddPage(self.ovr, "Overview")
|
||||||
|
|
||||||
|
|
||||||
|
# Set up a TextCtrl on the Demo Code Notebook page
|
||||||
|
self.txt = wxTextCtrl(self.nb, -1,
|
||||||
|
style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
|
||||||
|
self.txt.SetFont(wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false))
|
||||||
|
self.nb.AddPage(self.txt, "Demo Code")
|
||||||
|
|
||||||
|
|
||||||
|
# Set up a log on the View Log Notebook page
|
||||||
|
self.log = wxTextCtrl(logParent, -1,
|
||||||
|
style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
|
||||||
|
(w, self.charHeight) = self.log.GetTextExtent('X')
|
||||||
|
self.WriteText('wxPython Demo Log:\n')
|
||||||
|
|
||||||
|
self.Show(true)
|
||||||
|
|
||||||
|
# add the windows to the splitter and split it.
|
||||||
|
if _useSplitter:
|
||||||
|
if _useNestedSplitter:
|
||||||
|
splitter2.SplitHorizontally(self.nb, self.log)
|
||||||
|
splitter2.SetSashPosition(450, true)
|
||||||
|
splitter2.SetMinimumPaneSize(20)
|
||||||
|
|
||||||
|
splitter.SplitVertically(self.tree, splitter2)
|
||||||
|
else:
|
||||||
|
splitter.SplitVertically(self.tree, self.nb)
|
||||||
|
|
||||||
|
splitter.SetSashPosition(180, true)
|
||||||
|
splitter.SetMinimumPaneSize(20)
|
||||||
|
|
||||||
|
|
||||||
|
# make our log window be stdout
|
||||||
|
#sys.stdout = self
|
||||||
|
|
||||||
|
# select initial items
|
||||||
|
self.nb.SetSelection(0)
|
||||||
|
if _useSplitter:
|
||||||
|
self.tree.SelectItem(root)
|
||||||
|
|
||||||
|
if len(sys.argv) == 2:
|
||||||
|
try:
|
||||||
|
selectedDemo = self.treeMap[sys.argv[1]]
|
||||||
|
except:
|
||||||
|
selectedDemo = None
|
||||||
|
if selectedDemo and _useSplitter:
|
||||||
|
self.tree.SelectItem(selectedDemo)
|
||||||
|
self.tree.EnsureVisible(selectedDemo)
|
||||||
|
|
||||||
|
|
||||||
|
self.WriteText('window handle: %s\n' % self.GetHandle())
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def WriteText(self, text):
|
||||||
|
self.log.WriteText(text)
|
||||||
|
w, h = self.log.GetClientSizeTuple()
|
||||||
|
numLines = h/self.charHeight
|
||||||
|
x, y = self.log.PositionToXY(self.log.GetLastPosition())
|
||||||
|
if y > numLines:
|
||||||
|
self.log.ShowPosition(self.log.XYToPosition(x, y-numLines))
|
||||||
|
##self.log.ShowPosition(self.log.GetLastPosition())
|
||||||
|
self.log.SetInsertionPointEnd()
|
||||||
|
|
||||||
|
def write(self, txt):
|
||||||
|
self.WriteText(txt)
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnItemExpanded(self, event):
|
||||||
|
item = event.GetItem()
|
||||||
|
self.log.WriteText("OnItemExpanded: %s\n" % self.tree.GetItemText(item))
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnItemCollapsed(self, event):
|
||||||
|
item = event.GetItem()
|
||||||
|
self.log.WriteText("OnItemCollapsed: %s\n" % self.tree.GetItemText(item))
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnTreeLeftDown(self, event):
|
||||||
|
pt = event.GetPosition();
|
||||||
|
item, flags = self.tree.HitTest(pt)
|
||||||
|
if item == self.tree.GetSelection():
|
||||||
|
self.SetOverview(self.tree.GetItemText(item), self.curOverview)
|
||||||
|
else:
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnSelChanged(self, event):
|
||||||
|
if self.dying:
|
||||||
|
return
|
||||||
|
|
||||||
|
item = event.GetItem()
|
||||||
|
itemText = self.tree.GetItemText(item)
|
||||||
|
self.RunDemo(itemText)
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def RunDemo(self, itemText):
|
||||||
|
os.chdir(self.cwd)
|
||||||
|
if self.nb.GetPageCount() == 3:
|
||||||
|
if self.nb.GetSelection() == 2:
|
||||||
|
self.nb.SetSelection(0)
|
||||||
|
self.nb.DeletePage(2)
|
||||||
|
|
||||||
|
if itemText == 'Overview':
|
||||||
|
self.GetDemoFile('Main.py')
|
||||||
|
self.SetOverview('Overview', overview)
|
||||||
|
self.nb.Refresh();
|
||||||
|
self.window = None
|
||||||
|
|
||||||
|
else:
|
||||||
|
if os.path.exists(itemText + '.py'):
|
||||||
|
wxBeginBusyCursor()
|
||||||
|
try:
|
||||||
|
self.GetDemoFile(itemText + '.py')
|
||||||
|
module = __import__(itemText, globals())
|
||||||
|
self.SetOverview(itemText, module.overview)
|
||||||
|
finally:
|
||||||
|
wxEndBusyCursor()
|
||||||
|
|
||||||
|
# in case runTest is modal, make sure things look right...
|
||||||
|
self.nb.Refresh();
|
||||||
|
wxYield()
|
||||||
|
|
||||||
|
self.window = module.runTest(self, self.nb, self)
|
||||||
|
if self.window:
|
||||||
|
self.nb.AddPage(self.window, 'Demo')
|
||||||
|
wxYield()
|
||||||
|
self.nb.SetSelection(2)
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.ovr.SetPage("")
|
||||||
|
self.txt.Clear()
|
||||||
|
self.window = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
# Get the Demo files
|
||||||
|
def GetDemoFile(self, filename):
|
||||||
|
self.txt.Clear()
|
||||||
|
#if not self.txt.LoadFile(filename):
|
||||||
|
# self.txt.WriteText("Cannot open %s file." % filename)
|
||||||
|
try:
|
||||||
|
self.txt.SetValue(open(filename).read())
|
||||||
|
except IOError:
|
||||||
|
self.txt.WriteText("Cannot open %s file." % filename)
|
||||||
|
|
||||||
|
|
||||||
|
self.txt.SetInsertionPoint(0)
|
||||||
|
self.txt.ShowPosition(0)
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def SetOverview(self, name, text):
|
||||||
|
self.curOverview = text
|
||||||
|
lead = text[:6]
|
||||||
|
if lead != '<html>' and lead != '<HTML':
|
||||||
|
text = string.join(string.split(text, '\n'), '<br>')
|
||||||
|
#text = '<font size="-1"><pre>' + text + '</pre></font>'
|
||||||
|
self.ovr.SetPage(text)
|
||||||
|
self.nb.SetPageText(0, name)
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
# Menu methods
|
||||||
|
def OnFileExit(self, event):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
|
||||||
|
def OnHelpAbout(self, event):
|
||||||
|
#about = wxMessageDialog(self,
|
||||||
|
# "wxPython is a Python extension module that\n"
|
||||||
|
# "encapsulates the wxWindows GUI classes.\n\n"
|
||||||
|
# "This demo shows off some of the capabilities\n"
|
||||||
|
# "of wxPython.\n\n"
|
||||||
|
# " Developed by Robin Dunn",
|
||||||
|
# "About wxPython", wxOK)
|
||||||
|
from About import MyAboutBox
|
||||||
|
about = MyAboutBox(self)
|
||||||
|
about.ShowModal()
|
||||||
|
about.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.dying = true
|
||||||
|
self.window = None
|
||||||
|
self.mainmenu = None
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnIdle(self, event):
|
||||||
|
if self.otherWin:
|
||||||
|
self.otherWin.Raise()
|
||||||
|
self.window = self.otherWin
|
||||||
|
self.otherWin = None
|
||||||
|
|
||||||
|
#---------------------------------------------
|
||||||
|
def OnDemoMenu(self, event):
|
||||||
|
if _useSplitter:
|
||||||
|
try:
|
||||||
|
selectedDemo = self.treeMap[self.mainmenu.GetLabel(event.GetId())]
|
||||||
|
except:
|
||||||
|
selectedDemo = None
|
||||||
|
if selectedDemo:
|
||||||
|
self.tree.SelectItem(selectedDemo)
|
||||||
|
self.tree.EnsureVisible(selectedDemo)
|
||||||
|
else:
|
||||||
|
self.RunDemo(self.mainmenu.GetLabel(event.GetId()))
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
wxImage_AddHandler(wxJPEGHandler())
|
||||||
|
wxImage_AddHandler(wxPNGHandler())
|
||||||
|
wxImage_AddHandler(wxGIFHandler())
|
||||||
|
|
||||||
|
self.splash = SplashScreen(None, bitmapfile='bitmaps/splash.gif',
|
||||||
|
duration=4000, callback=self.AfterSplash)
|
||||||
|
self.splash.Show(true)
|
||||||
|
wxYield()
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
def AfterSplash(self):
|
||||||
|
self.splash.Close(true)
|
||||||
|
frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
self.ShowTip(frame)
|
||||||
|
|
||||||
|
|
||||||
|
def ShowTip(self, frame):
|
||||||
|
try:
|
||||||
|
showTipText = open("data/showTips").read()
|
||||||
|
showTip, index = eval(showTipText)
|
||||||
|
except IOError:
|
||||||
|
showTip, index = (1, 0)
|
||||||
|
if showTip:
|
||||||
|
tp = wxCreateFileTipProvider("data/tips.txt", index)
|
||||||
|
showTip = wxShowTip(frame, tp)
|
||||||
|
index = tp.GetCurrentTip()
|
||||||
|
open("data/showTips", "w").write(str( (showTip, index) ))
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def main():
|
||||||
|
try:
|
||||||
|
demoPath = os.path.split(__file__)[0]
|
||||||
|
os.chdir(demoPath)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
app = MyApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """<html><body>
|
||||||
|
<h2>Python</h2>
|
||||||
|
|
||||||
|
Python is an interpreted, interactive, object-oriented programming
|
||||||
|
language often compared to Tcl, Perl, Scheme, or Java.
|
||||||
|
|
||||||
|
<p> Python combines remarkable power with very clear syntax. It has
|
||||||
|
modules, classes, exceptions, very high level dynamic data types, and
|
||||||
|
dynamic typing. There are interfaces to many system calls and
|
||||||
|
libraries, and new built-in modules are easily written in C or
|
||||||
|
C++. Python is also usable as an extension language for applications
|
||||||
|
that need a programmable interface. <p>
|
||||||
|
|
||||||
|
<h2>wxWindows</h2>
|
||||||
|
|
||||||
|
wxWindows is a free C++ framework designed to make cross-platform
|
||||||
|
programming child's play. Well, almost. wxWindows 2 supports Windows
|
||||||
|
3.1/95/98/NT, Unix with GTK/Motif/Lesstif, with a Mac version
|
||||||
|
underway. Other ports are under consideration. <p>
|
||||||
|
|
||||||
|
wxWindows is a set of libraries that allows C++ applications to
|
||||||
|
compile and run on several different types of computers, with minimal
|
||||||
|
source code changes. There is one library per supported GUI (such as
|
||||||
|
Motif, or Windows). As well as providing a common API (Application
|
||||||
|
Programming Interface) for GUI functionality, it provides
|
||||||
|
functionality for accessing some commonly-used operating system
|
||||||
|
facilities, such as copying or deleting files. wxWindows is a
|
||||||
|
'framework' in the sense that it provides a lot of built-in
|
||||||
|
functionality, which the application can use or replace as required,
|
||||||
|
thus saving a great deal of coding effort. Basic data structures such
|
||||||
|
as strings, linked lists and hash tables are also supported.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<h2>wxPython</h2>
|
||||||
|
|
||||||
|
wxPython is a Python extension module that encapsulates the wxWindows
|
||||||
|
GUI classes. Currently it is only available for the Win32 and GTK
|
||||||
|
ports of wxWindows, but as soon as the other ports are brought up to
|
||||||
|
the same level as Win32 and GTK, it should be fairly trivial to
|
||||||
|
enable wxPython to be used with the new GUI.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
The wxPython extension module attempts to mirror the class heiarchy
|
||||||
|
of wxWindows as closely as possible. This means that there is a
|
||||||
|
wxFrame class in wxPython that looks, smells, tastes and acts almost
|
||||||
|
the same as the wxFrame class in the C++ version. Unfortunately,
|
||||||
|
because of differences in the languages, wxPython doesn't match
|
||||||
|
wxWindows exactly, but the differences should be easy to absorb
|
||||||
|
because they are natural to Python. For example, some methods that
|
||||||
|
return multiple values via argument pointers in C++ will return a
|
||||||
|
tuple of values in Python.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
There is still much to be done for wxPython, many classes still need
|
||||||
|
to be mirrored. Also, wxWindows is still somewhat of a moving target
|
||||||
|
so it is a bit of an effort just keeping wxPython up to date. On the
|
||||||
|
other hand, there are enough of the core classes completed that
|
||||||
|
useful applications can be written.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
wxPython is close enough to the C++ version that the majority of
|
||||||
|
the wxPython documentation is actually just notes attached to the C++
|
||||||
|
documents that describe the places where wxPython is different. There
|
||||||
|
is also a series of sample programs included, and a series of
|
||||||
|
documentation pages that assist the programmer in getting started
|
||||||
|
with wxPython.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
400
wxPython/demo/OldSizers.py
Normal file
@@ -0,0 +1,400 @@
|
|||||||
|
#----------------------------------------------------------------------
|
||||||
|
# sizer test code
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.sizers import *
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox1(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox2(win):
|
||||||
|
box = wxBoxSizer(wxVERTICAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox3(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox4(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 1)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 1)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox5(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 3)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 1)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox6(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL, wxSize(250, 50))
|
||||||
|
box.Add(wxButton(win, 1010, "10"), 10)
|
||||||
|
box.Add(wxButton(win, 1010, "20"), 20)
|
||||||
|
box.Add(wxButton(win, 1010, "30"), 30)
|
||||||
|
box.Add(wxButton(win, 1010, "15"), 15)
|
||||||
|
box.Add(wxButton(win, 1010, "5"), 5)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBorder1(win):
|
||||||
|
bdr = wxBorderSizer(wxALL)
|
||||||
|
btn = wxButton(win, 1010, "border")
|
||||||
|
btn.SetSize(wxSize(80, 80))
|
||||||
|
bdr.Add(btn, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBorder2(win):
|
||||||
|
bdr = wxBorderSizer(wxEAST | wxWEST)
|
||||||
|
btn = wxButton(win, 1010, "border")
|
||||||
|
btn.SetSize(wxSize(80, 80))
|
||||||
|
bdr.Add(btn, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBorder3(win):
|
||||||
|
bdr = wxBorderSizer(wxNORTH | wxWEST)
|
||||||
|
btn = wxButton(win, 1010, "border")
|
||||||
|
btn.SetSize(wxSize(80, 80))
|
||||||
|
bdr.Add(btn, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeShapes(win):
|
||||||
|
box =wxBoxSizer(wxVERTICAL)
|
||||||
|
box.Add(wxStaticLine(win, -1), 0)
|
||||||
|
for line in (
|
||||||
|
(wxANCHOR_NW, "NorthWest"),
|
||||||
|
(wxANCHOR_NORTH, "North"),
|
||||||
|
(wxANCHOR_NE, "NorthEast")
|
||||||
|
), (
|
||||||
|
(wxANCHOR_WEST, "West"),
|
||||||
|
(wxANCHOR_NONE, "Center"),
|
||||||
|
(wxANCHOR_EAST, "East")
|
||||||
|
), (
|
||||||
|
(wxANCHOR_SW, "SouthWest"),
|
||||||
|
(wxANCHOR_SOUTH, "South"),
|
||||||
|
(wxANCHOR_SE, "SouthEast")
|
||||||
|
):
|
||||||
|
linebox =wxBoxSizer(wxHORIZONTAL)
|
||||||
|
linebox.Add(wxStaticLine(win, -1, style=wxVERTICAL), 0)
|
||||||
|
for (anchor, label) in line:
|
||||||
|
sizer =wxShapeSizer(anchor)
|
||||||
|
sizer.Add(wxButton(win, -1, label, size=wxSize(100, 50)))
|
||||||
|
linebox.Add(sizer, 1)
|
||||||
|
linebox.Add(wxStaticLine(win, -1, style=wxVERTICAL), 0)
|
||||||
|
box.Add(linebox, 1)
|
||||||
|
box.Add(wxStaticLine(win, -1), 0)
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeBoxInBox(win):
|
||||||
|
box = wxBoxSizer(wxVERTICAL)
|
||||||
|
|
||||||
|
box.Add(wxButton(win, 1010, "one"))
|
||||||
|
|
||||||
|
box2 = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box2.AddMany([ wxButton(win, 1010, "two"),
|
||||||
|
wxButton(win, 1010, "three"),
|
||||||
|
wxButton(win, 1010, "four"),
|
||||||
|
wxButton(win, 1010, "five"),
|
||||||
|
])
|
||||||
|
|
||||||
|
box3 = wxBoxSizer(wxVERTICAL)
|
||||||
|
box3.AddMany([ (wxButton(win, 1010, "six"), 0),
|
||||||
|
(wxButton(win, 1010, "seven"), 2),
|
||||||
|
(wxButton(win, 1010, "eight"), 1),
|
||||||
|
(wxButton(win, 1010, "nine"), 1),
|
||||||
|
])
|
||||||
|
|
||||||
|
box2.Add(box3, 1)
|
||||||
|
box.Add(box2, 1)
|
||||||
|
|
||||||
|
box.Add(wxButton(win, 1010, "ten"))
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeBoxInBorder(win):
|
||||||
|
bdr = wxBorderSizer(wxALL)
|
||||||
|
box = makeSimpleBox3(win)
|
||||||
|
bdr.Add(box, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeBorderInBox(win):
|
||||||
|
insideBox = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
|
||||||
|
box2 = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box2.AddMany([ wxButton(win, 1010, "one"),
|
||||||
|
wxButton(win, 1010, "two"),
|
||||||
|
wxButton(win, 1010, "three"),
|
||||||
|
wxButton(win, 1010, "four"),
|
||||||
|
wxButton(win, 1010, "five"),
|
||||||
|
])
|
||||||
|
|
||||||
|
insideBox.Add(box2, 0)
|
||||||
|
|
||||||
|
bdr = wxBorderSizer(wxALL)
|
||||||
|
bdr.Add(wxButton(win, 1010, "border"), 20)
|
||||||
|
insideBox.Add(bdr, 1)
|
||||||
|
|
||||||
|
box3 = wxBoxSizer(wxVERTICAL)
|
||||||
|
box3.AddMany([ (wxButton(win, 1010, "six"), 0),
|
||||||
|
(wxButton(win, 1010, "seven"), 2),
|
||||||
|
(wxButton(win, 1010, "eight"), 1),
|
||||||
|
(wxButton(win, 1010, "nine"), 1),
|
||||||
|
])
|
||||||
|
insideBox.Add(box3, 1)
|
||||||
|
|
||||||
|
outsideBox = wxBoxSizer(wxVERTICAL)
|
||||||
|
outsideBox.Add(wxButton(win, 1010, "top"))
|
||||||
|
outsideBox.Add(insideBox, 1)
|
||||||
|
outsideBox.Add(wxButton(win, 1010, "bottom"))
|
||||||
|
|
||||||
|
return outsideBox
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
theTests = [
|
||||||
|
("Simple horizontal boxes", makeSimpleBox1,
|
||||||
|
"This is a HORIZONTAL box sizer with four non-stretchable buttons held "
|
||||||
|
"within it. Notice that the buttons are added and aligned in the horizontal "
|
||||||
|
"dimension. Also notice that they are fixed size in the horizontal dimension, "
|
||||||
|
"but will stretch vertically."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Simple vertical boxes", makeSimpleBox2,
|
||||||
|
"Exactly the same as the previous sample but using a VERTICAL box sizer "
|
||||||
|
"instead of a HORIZONTAL one."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Add a stretchable", makeSimpleBox3,
|
||||||
|
"We've added one more button with the strechable flag turned on. Notice "
|
||||||
|
"how it grows to fill the extra space in the otherwise fixed dimension."
|
||||||
|
),
|
||||||
|
|
||||||
|
("More than one stretchable", makeSimpleBox4,
|
||||||
|
"Here there are several items that are stretchable, they all divide up the "
|
||||||
|
"extra space evenly."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Weighting factor", makeSimpleBox5,
|
||||||
|
"This one shows more than one strechable, but one of them has a weighting "
|
||||||
|
"factor so it gets more of the free space."
|
||||||
|
),
|
||||||
|
|
||||||
|
# ("Percent Sizer", makeSimpleBox6,
|
||||||
|
# "You can use the wxBoxSizer like a Percent Sizer. Just make sure that all "
|
||||||
|
# "the weighting factors add up to 100!"
|
||||||
|
# ),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
("Simple border sizer", makeSimpleBorder1,
|
||||||
|
"The wxBorderSizer leaves empty space around its contents. This one "
|
||||||
|
"gives a border all the way around."
|
||||||
|
),
|
||||||
|
|
||||||
|
("East and West border", makeSimpleBorder2,
|
||||||
|
"You can pick and choose which sides have borders."
|
||||||
|
),
|
||||||
|
|
||||||
|
("North and West border", makeSimpleBorder3,
|
||||||
|
"You can pick and choose which sides have borders."
|
||||||
|
),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
|
||||||
|
("Proportional resize", makeShapes,
|
||||||
|
"The wxShapeSizer preserves the original proportions of the window."
|
||||||
|
),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
("Boxes inside of boxes", makeBoxInBox,
|
||||||
|
"This one shows nesting of boxes within boxes within boxes, using both "
|
||||||
|
"orientations. Notice also that button seven has a greater weighting "
|
||||||
|
"factor than its siblings."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Boxes inside a Border", makeBoxInBorder,
|
||||||
|
"Sizers of different types can be nested withing each other as well. "
|
||||||
|
"Here is a box sizer with several buttons embedded within a border sizer."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Border in a Box", makeBorderInBox,
|
||||||
|
"Another nesting example. This one has Boxes and a Border inside another Box."
|
||||||
|
),
|
||||||
|
|
||||||
|
]
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, title, sizerFunc):
|
||||||
|
wxFrame.__init__(self, parent, -1, title)
|
||||||
|
EVT_BUTTON(self, 1010, self.OnButton)
|
||||||
|
|
||||||
|
self.sizer = sizerFunc(self)
|
||||||
|
self.CreateStatusBar()
|
||||||
|
self.SetStatusText("Resize this frame to see how the sizers respond...")
|
||||||
|
self.sizer.FitWindow(self)
|
||||||
|
|
||||||
|
|
||||||
|
def OnSize(self, event):
|
||||||
|
size = self.GetClientSize()
|
||||||
|
self.sizer.Layout(size)
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.MakeModal(false)
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
def OnButton(self, event):
|
||||||
|
self.Close(true)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class TestSelectionPanel(wxPanel):
|
||||||
|
def __init__(self, parent, frame=NULL):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.frame = frame
|
||||||
|
|
||||||
|
self.list = wxListBox(self, 401,
|
||||||
|
wxDLG_PNT(self, 10, 10), wxDLG_SZE(self, 100, 60),
|
||||||
|
[])
|
||||||
|
EVT_LISTBOX(self, 401, self.OnSelect)
|
||||||
|
EVT_LISTBOX_DCLICK(self, 401, self.OnDClick)
|
||||||
|
|
||||||
|
wxButton(self, 402, "Try it!", wxDLG_PNT(self, 120, 10)).SetDefault()
|
||||||
|
EVT_BUTTON(self, 402, self.OnDClick)
|
||||||
|
|
||||||
|
self.text = wxTextCtrl(self, -1, "",
|
||||||
|
wxDLG_PNT(self, 10, 80),
|
||||||
|
wxDLG_SZE(self, 200, 60),
|
||||||
|
wxTE_MULTILINE | wxTE_READONLY)
|
||||||
|
|
||||||
|
for item in theTests:
|
||||||
|
self.list.Append(item[0])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def OnSelect(self, event):
|
||||||
|
pos = self.list.GetSelection()
|
||||||
|
self.text.SetValue(theTests[pos][2])
|
||||||
|
|
||||||
|
|
||||||
|
def OnDClick(self, event):
|
||||||
|
pos = self.list.GetSelection()
|
||||||
|
title = theTests[pos][0]
|
||||||
|
func = theTests[pos][1]
|
||||||
|
|
||||||
|
if func:
|
||||||
|
win = TestFrame(self, title, func)
|
||||||
|
win.CentreOnParent(wxBOTH)
|
||||||
|
win.Show(true)
|
||||||
|
win.MakeModal(true)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestSelectionPanel(nb, frame)
|
||||||
|
return win
|
||||||
|
|
||||||
|
overview = wxSizer.__doc__ + '\n' + '-' * 80 + '\n' + \
|
||||||
|
wxBoxSizer.__doc__ + '\n' + '-' * 80 + '\n' + \
|
||||||
|
wxBorderSizer.__doc__
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
class MainFrame(wxFrame):
|
||||||
|
def __init__(self):
|
||||||
|
wxFrame.__init__(self, NULL, -1, "Testing...")
|
||||||
|
|
||||||
|
self.CreateStatusBar()
|
||||||
|
mainmenu = wxMenuBar()
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(200, 'E&xit', 'Get the heck outta here!')
|
||||||
|
mainmenu.Append(menu, "&File")
|
||||||
|
self.SetMenuBar(mainmenu)
|
||||||
|
EVT_MENU(self, 200, self.OnExit)
|
||||||
|
self.panel = TestSelectionPanel(self, self)
|
||||||
|
self.SetSize(wxSize(400, 380))
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
def OnExit(self, event):
|
||||||
|
self.Close(true)
|
||||||
|
|
||||||
|
|
||||||
|
class TestApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
frame = MainFrame()
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
return true
|
||||||
|
|
||||||
|
app = TestApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
176
wxPython/demo/PrintFramework.py
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxScrolledWindow import MyCanvas
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyPrintout(wxPrintout):
|
||||||
|
def __init__(self, canvas, log):
|
||||||
|
wxPrintout.__init__(self)
|
||||||
|
self.canvas = canvas
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
def OnBeginDocument(self, start, end):
|
||||||
|
self.log.WriteText("wxPrintout.OnBeginDocument\n")
|
||||||
|
return self.base_OnBeginDocument(start, end)
|
||||||
|
|
||||||
|
def OnEndDocument(self):
|
||||||
|
self.log.WriteText("wxPrintout.OnEndDocument\n")
|
||||||
|
self.base_OnEndDocument()
|
||||||
|
|
||||||
|
def OnBeginPrinting(self):
|
||||||
|
self.log.WriteText("wxPrintout.OnBeginPrinting\n")
|
||||||
|
self.base_OnBeginPrinting()
|
||||||
|
|
||||||
|
def OnEndPrinting(self):
|
||||||
|
self.log.WriteText("wxPrintout.OnEndPrinting\n")
|
||||||
|
self.base_OnEndPrinting()
|
||||||
|
|
||||||
|
def OnPreparePrinting(self):
|
||||||
|
self.log.WriteText("wxPrintout.OnPreparePrinting\n")
|
||||||
|
self.base_OnPreparePrinting()
|
||||||
|
|
||||||
|
def HasPage(self, page):
|
||||||
|
self.log.WriteText("wxPrintout.HasPage\n")
|
||||||
|
if page == 1:
|
||||||
|
return true
|
||||||
|
else:
|
||||||
|
return false
|
||||||
|
|
||||||
|
def GetPageInfo(self):
|
||||||
|
self.log.WriteText("wxPrintout.GetPageInfo\n")
|
||||||
|
return (1, 1, 1, 1)
|
||||||
|
|
||||||
|
def OnPrintPage(self, page):
|
||||||
|
self.log.WriteText("wxPrintout.OnPrintPage\n")
|
||||||
|
dc = self.GetDC()
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# One possible method of setting scaling factors...
|
||||||
|
|
||||||
|
maxX = self.canvas.getWidth()
|
||||||
|
maxY = self.canvas.getHeight()
|
||||||
|
|
||||||
|
# Let's have at least 50 device units margin
|
||||||
|
marginX = 50
|
||||||
|
marginY = 50
|
||||||
|
|
||||||
|
# Add the margin to the graphic size
|
||||||
|
maxX = maxX + (2 * marginX)
|
||||||
|
maxY = maxY + (2 * marginY)
|
||||||
|
|
||||||
|
# Get the size of the DC in pixels
|
||||||
|
(w, h) = dc.GetSizeTuple()
|
||||||
|
|
||||||
|
# Calculate a suitable scaling factor
|
||||||
|
scaleX = float(w) / maxX
|
||||||
|
scaleY = float(h) / maxY
|
||||||
|
|
||||||
|
# Use x or y scaling factor, whichever fits on the DC
|
||||||
|
actualScale = min(scaleX, scaleY)
|
||||||
|
|
||||||
|
# Calculate the position on the DC for centring the graphic
|
||||||
|
posX = (w - (self.canvas.getWidth() * actualScale)) / 2.0
|
||||||
|
posY = (h - (self.canvas.getHeight() * actualScale)) / 2.0
|
||||||
|
|
||||||
|
# Set the scale and origin
|
||||||
|
dc.SetUserScale(actualScale, actualScale)
|
||||||
|
dc.SetDeviceOrigin(int(posX), int(posY))
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
|
||||||
|
self.canvas.DoDrawing(dc)
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class TestPrintPanel(wxPanel):
|
||||||
|
def __init__(self, parent, frame, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
self.frame = frame
|
||||||
|
|
||||||
|
|
||||||
|
self.printData = wxPrintData()
|
||||||
|
self.printData.SetPaperId(wxPAPER_LETTER)
|
||||||
|
|
||||||
|
self.box = wxBoxSizer(wxVERTICAL)
|
||||||
|
self.canvas = MyCanvas(self)
|
||||||
|
self.box.Add(self.canvas, 1, wxGROW)
|
||||||
|
|
||||||
|
subbox = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
btn = wxButton(self, 1201, "Print Setup")
|
||||||
|
EVT_BUTTON(self, 1201, self.OnPrintSetup)
|
||||||
|
subbox.Add(btn, 1, wxGROW | wxALL, 2)
|
||||||
|
|
||||||
|
btn = wxButton(self, 1202, "Print Preview")
|
||||||
|
EVT_BUTTON(self, 1202, self.OnPrintPreview)
|
||||||
|
subbox.Add(btn, 1, wxGROW | wxALL, 2)
|
||||||
|
|
||||||
|
btn = wxButton(self, 1203, "Print")
|
||||||
|
EVT_BUTTON(self, 1203, self.OnDoPrint)
|
||||||
|
subbox.Add(btn, 1, wxGROW | wxALL, 2)
|
||||||
|
|
||||||
|
self.box.Add(subbox, 0, wxGROW)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
self.SetSizer(self.box)
|
||||||
|
|
||||||
|
|
||||||
|
def OnPrintSetup(self, event):
|
||||||
|
printerDialog = wxPrintDialog(self)
|
||||||
|
printerDialog.GetPrintDialogData().SetPrintData(self.printData)
|
||||||
|
printerDialog.GetPrintDialogData().SetSetupDialog(true)
|
||||||
|
printerDialog.ShowModal();
|
||||||
|
self.printData = printerDialog.GetPrintDialogData().GetPrintData()
|
||||||
|
printerDialog.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
def OnPrintPreview(self, event):
|
||||||
|
self.log.WriteText("OnPrintPreview\n")
|
||||||
|
printout = MyPrintout(self.canvas, self.log)
|
||||||
|
printout2 = MyPrintout(self.canvas, self.log)
|
||||||
|
self.preview = wxPrintPreview(printout, printout2, self.printData)
|
||||||
|
if not self.preview.Ok():
|
||||||
|
self.log.WriteText("Houston, we have a problem...\n")
|
||||||
|
return
|
||||||
|
|
||||||
|
frame = wxPreviewFrame(self.preview, self.frame, "This is a print preview")
|
||||||
|
|
||||||
|
frame.Initialize()
|
||||||
|
frame.SetPosition(self.frame.GetPosition())
|
||||||
|
frame.SetSize(self.frame.GetSize())
|
||||||
|
frame.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def OnDoPrint(self, event):
|
||||||
|
pdd = wxPrintDialogData()
|
||||||
|
pdd.SetPrintData(self.printData)
|
||||||
|
printer = wxPrinter(pdd)
|
||||||
|
printout = MyPrintout(self.canvas, self.log)
|
||||||
|
if not printer.Print(self.frame, printout):
|
||||||
|
wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK)
|
||||||
|
else:
|
||||||
|
self.printData = printer.GetPrintDialogData().GetPrintData()
|
||||||
|
printout.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPrintPanel(nb, frame, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
"""
|
||||||
|
|
||||||
20
wxPython/demo/PyShell.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.shell import PyShell
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = PyShell(nb)
|
||||||
|
win.Show(true)
|
||||||
|
return win
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
overview = """
|
||||||
|
A simple GUI version of the interactive interpreter.
|
||||||
|
"""
|
||||||
|
|
||||||
85
wxPython/demo/PythonEvents.py
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
import sys
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
myEVT_BUTTON_CLICKPOS = 5015
|
||||||
|
|
||||||
|
def EVT_BUTTON_CLICKPOS(win, id, func):
|
||||||
|
win.Connect(id, -1, myEVT_BUTTON_CLICKPOS, func)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class MyEvent(wxPyCommandEvent):
|
||||||
|
def __init__(self, evtType, id):
|
||||||
|
wxPyCommandEvent.__init__(self, evtType, id)
|
||||||
|
self.myVal = None
|
||||||
|
|
||||||
|
#def __del__(self):
|
||||||
|
# print '__del__'
|
||||||
|
# wxPyCommandEvent.__del__(self)
|
||||||
|
|
||||||
|
def SetMyVal(self, val):
|
||||||
|
self.myVal = val
|
||||||
|
|
||||||
|
def GetMyVal(self):
|
||||||
|
return self.myVal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class MyButton(wxButton):
|
||||||
|
def __init__(self, parent, id, txt, pos):
|
||||||
|
wxButton.__init__(self, parent, id, txt, pos)
|
||||||
|
EVT_LEFT_DOWN(self, self.OnLeftDown)
|
||||||
|
|
||||||
|
def OnLeftDown(self, event):
|
||||||
|
pt = event.GetPosition()
|
||||||
|
evt = MyEvent(myEVT_BUTTON_CLICKPOS, self.GetId())
|
||||||
|
evt.SetMyVal(pt)
|
||||||
|
#print id(evt), sys.getrefcount(evt)
|
||||||
|
self.GetEventHandler().ProcessEvent(evt)
|
||||||
|
#print id(evt), sys.getrefcount(evt)
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class TestPanel(wxPanel):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
b = MyButton(self, -1, " Click me ", wxPoint(30,30))
|
||||||
|
EVT_BUTTON(self, b.GetId(), self.OnClick)
|
||||||
|
EVT_BUTTON_CLICKPOS(self, b.GetId(), self.OnMyEvent)
|
||||||
|
|
||||||
|
wxStaticText(self, -1, "Please see the Overview and Demo Code for details...",
|
||||||
|
wxPoint(30, 80))
|
||||||
|
|
||||||
|
|
||||||
|
def OnClick(self, event):
|
||||||
|
self.log.WriteText("OnClick\n")
|
||||||
|
|
||||||
|
def OnMyEvent(self, event):
|
||||||
|
#print id(event), sys.getrefcount(event)
|
||||||
|
self.log.WriteText("MyEvent: %s\n" % (event.GetMyVal(), ) )
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestPanel(nb, log)
|
||||||
|
return win
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
This demo is a contrived example of defining an event class in wxPython and sending it up the containment heirachy for processing.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
7
wxPython/demo/README.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
To run the main demo in this directory, execute demo.py. In other
|
||||||
|
words, one of the following commands should do it:
|
||||||
|
|
||||||
|
demo.py
|
||||||
|
python demo.py
|
||||||
|
pythonw demo.py
|
||||||
|
|
||||||
585
wxPython/demo/Sizers.py
Normal file
@@ -0,0 +1,585 @@
|
|||||||
|
#----------------------------------------------------------------------
|
||||||
|
# sizer test code
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxPython.lib.grids import wxGridSizer, wxFlexGridSizer
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox1(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox2(win):
|
||||||
|
box = wxBoxSizer(wxVERTICAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox3(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox4(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 1, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 1, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox5(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 3, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 1, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox6(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 1, wxALIGN_TOP)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 1, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 1, wxALIGN_CENTER)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 1, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1, wxALIGN_BOTTOM)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox7(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND)
|
||||||
|
box.Add(60, 20, 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBox8(win):
|
||||||
|
box = wxBoxSizer(wxVERTICAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(0,0, 1)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxALIGN_CENTER)
|
||||||
|
box.Add(0,0, 1)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0, wxEXPAND)
|
||||||
|
# box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBorder1(win):
|
||||||
|
bdr = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
btn = wxButton(win, 1010, "border")
|
||||||
|
btn.SetSize(wxSize(80, 80))
|
||||||
|
bdr.Add(btn, 1, wxEXPAND|wxALL, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBorder2(win):
|
||||||
|
bdr = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
btn = wxButton(win, 1010, "border")
|
||||||
|
btn.SetSize(wxSize(80, 80))
|
||||||
|
bdr.Add(btn, 1, wxEXPAND | wxEAST | wxWEST, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBorder3(win):
|
||||||
|
bdr = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
btn = wxButton(win, 1010, "border")
|
||||||
|
btn.SetSize(wxSize(80, 80))
|
||||||
|
bdr.Add(btn, 1, wxEXPAND | wxNORTH | wxWEST, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeBoxInBox(win):
|
||||||
|
box = wxBoxSizer(wxVERTICAL)
|
||||||
|
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
|
||||||
|
box2 = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box2.AddMany([ (wxButton(win, 1010, "two"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "three"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "four"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "five"), 0, wxEXPAND),
|
||||||
|
])
|
||||||
|
|
||||||
|
box3 = wxBoxSizer(wxVERTICAL)
|
||||||
|
box3.AddMany([ (wxButton(win, 1010, "six"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "seven"), 2, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "eight"), 1, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "nine"), 1, wxEXPAND),
|
||||||
|
])
|
||||||
|
|
||||||
|
box2.Add(box3, 1, wxEXPAND)
|
||||||
|
box.Add(box2, 1, wxEXPAND)
|
||||||
|
|
||||||
|
box.Add(wxButton(win, 1010, "ten"), 0, wxEXPAND)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeBoxInBorder(win):
|
||||||
|
bdr = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box = makeSimpleBox3(win)
|
||||||
|
bdr.Add(box, 1, wxEXPAND | wxALL, 15)
|
||||||
|
|
||||||
|
return bdr
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeBorderInBox(win):
|
||||||
|
insideBox = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
|
||||||
|
box2 = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box2.AddMany([ (wxButton(win, 1010, "one"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "two"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "three"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "four"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "five"), 0, wxEXPAND),
|
||||||
|
])
|
||||||
|
|
||||||
|
insideBox.Add(box2, 0, wxEXPAND)
|
||||||
|
|
||||||
|
bdr = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
bdr.Add(wxButton(win, 1010, "border"), 1, wxEXPAND | wxALL)
|
||||||
|
insideBox.Add(bdr, 1, wxEXPAND | wxALL, 20)
|
||||||
|
|
||||||
|
box3 = wxBoxSizer(wxVERTICAL)
|
||||||
|
box3.AddMany([ (wxButton(win, 1010, "six"), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "seven"), 2, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "eight"), 1, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, "nine"), 1, wxEXPAND),
|
||||||
|
])
|
||||||
|
insideBox.Add(box3, 1, wxEXPAND)
|
||||||
|
|
||||||
|
outsideBox = wxBoxSizer(wxVERTICAL)
|
||||||
|
outsideBox.Add(wxButton(win, 1010, "top"), 0, wxEXPAND)
|
||||||
|
outsideBox.Add(insideBox, 1, wxEXPAND)
|
||||||
|
outsideBox.Add(wxButton(win, 1010, "bottom"), 0, wxEXPAND)
|
||||||
|
|
||||||
|
return outsideBox
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeGrid1(win):
|
||||||
|
gs = wxGridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
|
||||||
|
|
||||||
|
gs.AddMany([ (wxButton(win, 1010, 'one'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'two'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'three'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'four'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'five'), 0, wxEXPAND),
|
||||||
|
#(75, 50),
|
||||||
|
(wxButton(win, 1010, 'six'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'seven'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'eight'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'nine'), 0, wxEXPAND),
|
||||||
|
])
|
||||||
|
|
||||||
|
return gs
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeGrid2(win):
|
||||||
|
gs = wxGridSizer(3, 3) # rows, cols, hgap, vgap
|
||||||
|
|
||||||
|
box = wxBoxSizer(wxVERTICAL)
|
||||||
|
box.Add(wxButton(win, 1010, 'A'), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, 'B'), 1, wxEXPAND)
|
||||||
|
|
||||||
|
gs2 = wxGridSizer(2,2, 4, 4)
|
||||||
|
gs2.AddMany([ (wxButton(win, 1010, 'C'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'E'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'F'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'G'), 0, wxEXPAND)])
|
||||||
|
|
||||||
|
gs.AddMany([ (wxButton(win, 1010, 'one'), 0, wxALIGN_RIGHT | wxALIGN_BOTTOM),
|
||||||
|
(wxButton(win, 1010, 'two'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'three'), 0, wxALIGN_LEFT | wxALIGN_BOTTOM),
|
||||||
|
(wxButton(win, 1010, 'four'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'five'), 0, wxALIGN_CENTER),
|
||||||
|
(wxButton(win, 1010, 'six'), 0, wxEXPAND),
|
||||||
|
(box, 0, wxEXPAND | wxALL, 10),
|
||||||
|
(wxButton(win, 1010, 'eight'), 0, wxEXPAND),
|
||||||
|
(gs2, 0, wxEXPAND | wxALL, 4),
|
||||||
|
])
|
||||||
|
|
||||||
|
return gs
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeGrid3(win):
|
||||||
|
gs = wxFlexGridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
|
||||||
|
|
||||||
|
gs.AddMany([ (wxButton(win, 1010, 'one'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'two'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'three'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'four'), 0, wxEXPAND),
|
||||||
|
#(wxButton(win, 1010, 'five'), 0, wxEXPAND),
|
||||||
|
(175, 50),
|
||||||
|
(wxButton(win, 1010, 'six'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'seven'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'eight'), 0, wxEXPAND),
|
||||||
|
(wxButton(win, 1010, 'nine'), 0, wxEXPAND),
|
||||||
|
])
|
||||||
|
|
||||||
|
gs.AddGrowableRow(0)
|
||||||
|
gs.AddGrowableRow(2)
|
||||||
|
gs.AddGrowableCol(1)
|
||||||
|
return gs
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeGrid4(win):
|
||||||
|
bpos = wxDefaultPosition
|
||||||
|
bsize = wxSize(100, 50)
|
||||||
|
gs = wxGridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
|
||||||
|
|
||||||
|
gs.AddMany([ (wxButton(win, 1010, 'one', bpos, bsize),
|
||||||
|
0, wxALIGN_TOP | wxALIGN_LEFT ),
|
||||||
|
(wxButton(win, 1010, 'two', bpos, bsize),
|
||||||
|
0, wxALIGN_TOP | wxALIGN_CENTER_HORIZONTAL ),
|
||||||
|
(wxButton(win, 1010, 'three', bpos, bsize),
|
||||||
|
0, wxALIGN_TOP | wxALIGN_RIGHT ),
|
||||||
|
(wxButton(win, 1010, 'four', bpos, bsize),
|
||||||
|
0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT ),
|
||||||
|
(wxButton(win, 1010, 'five', bpos, bsize),
|
||||||
|
0, wxALIGN_CENTER ),
|
||||||
|
(wxButton(win, 1010, 'six', bpos, bsize),
|
||||||
|
0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT ),
|
||||||
|
(wxButton(win, 1010, 'seven', bpos, bsize),
|
||||||
|
0, wxALIGN_BOTTOM | wxALIGN_LEFT ),
|
||||||
|
(wxButton(win, 1010, 'eight', bpos, bsize),
|
||||||
|
0, wxALIGN_BOTTOM | wxALIGN_CENTER_HORIZONTAL ),
|
||||||
|
(wxButton(win, 1010, 'nine', bpos, bsize),
|
||||||
|
0, wxALIGN_BOTTOM | wxALIGN_RIGHT ),
|
||||||
|
])
|
||||||
|
|
||||||
|
return gs
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeShapes(win):
|
||||||
|
bpos = wxDefaultPosition
|
||||||
|
bsize = wxSize(100, 50)
|
||||||
|
gs = wxGridSizer(3, 3, 2, 2) # rows, cols, hgap, vgap
|
||||||
|
|
||||||
|
gs.AddMany([ (wxButton(win, 1010, 'one', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_TOP | wxALIGN_LEFT ),
|
||||||
|
(wxButton(win, 1010, 'two', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_TOP | wxALIGN_CENTER_HORIZONTAL ),
|
||||||
|
(wxButton(win, 1010, 'three', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_TOP | wxALIGN_RIGHT ),
|
||||||
|
(wxButton(win, 1010, 'four', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT ),
|
||||||
|
(wxButton(win, 1010, 'five', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_CENTER ),
|
||||||
|
(wxButton(win, 1010, 'six', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT ),
|
||||||
|
(wxButton(win, 1010, 'seven', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_BOTTOM | wxALIGN_LEFT ),
|
||||||
|
(wxButton(win, 1010, 'eight', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_BOTTOM | wxALIGN_CENTER_HORIZONTAL ),
|
||||||
|
(wxButton(win, 1010, 'nine', bpos, bsize),
|
||||||
|
0, wxSHAPED | wxALIGN_BOTTOM | wxALIGN_RIGHT ),
|
||||||
|
])
|
||||||
|
|
||||||
|
return gs
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def makeSimpleBoxShaped(win):
|
||||||
|
box = wxBoxSizer(wxHORIZONTAL)
|
||||||
|
box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "four"), 0, wxEXPAND)
|
||||||
|
box.Add(wxButton(win, 1010, "five"), 1, wxSHAPED)
|
||||||
|
|
||||||
|
return box
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
theTests = [
|
||||||
|
("Simple horizontal boxes", makeSimpleBox1,
|
||||||
|
"This is a HORIZONTAL box sizer with four non-stretchable buttons held "
|
||||||
|
"within it. Notice that the buttons are added and aligned in the horizontal "
|
||||||
|
"dimension. Also notice that they are fixed size in the horizontal dimension, "
|
||||||
|
"but will stretch vertically."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Simple vertical boxes", makeSimpleBox2,
|
||||||
|
"Exactly the same as the previous sample but using a VERTICAL box sizer "
|
||||||
|
"instead of a HORIZONTAL one."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Add a stretchable", makeSimpleBox3,
|
||||||
|
"We've added one more button with the strechable flag turned on. Notice "
|
||||||
|
"how it grows to fill the extra space in the otherwise fixed dimension."
|
||||||
|
),
|
||||||
|
|
||||||
|
("More than one stretchable", makeSimpleBox4,
|
||||||
|
"Here there are several items that are stretchable, they all divide up the "
|
||||||
|
"extra space evenly."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Weighting factor", makeSimpleBox5,
|
||||||
|
"This one shows more than one strechable, but one of them has a weighting "
|
||||||
|
"factor so it gets more of the free space."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Edge Affinity", makeSimpleBox6,
|
||||||
|
"For items that don't completly fill their allotted space, and don't "
|
||||||
|
"stretch, you can specify which side (or the center) they should stay "
|
||||||
|
"attached to."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Spacer", makeSimpleBox7,
|
||||||
|
"You can add empty space to be managed by a Sizer just as if it were a "
|
||||||
|
"window or another Sizer."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Centering in available space", makeSimpleBox8,
|
||||||
|
"This one shows an item that does not expand to fill it's space, but rather"
|
||||||
|
"stays centered within it."
|
||||||
|
),
|
||||||
|
|
||||||
|
# ("Percent Sizer", makeSimpleBox6,
|
||||||
|
# "You can use the wxBoxSizer like a Percent Sizer. Just make sure that all "
|
||||||
|
# "the weighting factors add up to 100!"
|
||||||
|
# ),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
("Simple border sizer", makeSimpleBorder1,
|
||||||
|
"The wxBoxSizer can leave empty space around its contents. This one "
|
||||||
|
"gives a border all the way around."
|
||||||
|
),
|
||||||
|
|
||||||
|
("East and West border", makeSimpleBorder2,
|
||||||
|
"You can pick and choose which sides have borders."
|
||||||
|
),
|
||||||
|
|
||||||
|
("North and West border", makeSimpleBorder3,
|
||||||
|
"You can pick and choose which sides have borders."
|
||||||
|
),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
("Boxes inside of boxes", makeBoxInBox,
|
||||||
|
"This one shows nesting of boxes within boxes within boxes, using both "
|
||||||
|
"orientations. Notice also that button seven has a greater weighting "
|
||||||
|
"factor than its siblings."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Boxes inside a Border", makeBoxInBorder,
|
||||||
|
"Sizers of different types can be nested withing each other as well. "
|
||||||
|
"Here is a box sizer with several buttons embedded within a border sizer."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Border in a Box", makeBorderInBox,
|
||||||
|
"Another nesting example. This one has Boxes and a Border inside another Box."
|
||||||
|
),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
("Simple Grid", makeGrid1,
|
||||||
|
"This is an example of the wxGridSizer. In this case all row heights "
|
||||||
|
"and column widths are kept the same as all the others and all items "
|
||||||
|
"fill their available space. The horzontal and vertical gaps are set to "
|
||||||
|
"2 pixels each."
|
||||||
|
),
|
||||||
|
|
||||||
|
("More Grid Features", makeGrid2,
|
||||||
|
"This is another example of the wxGridSizer. This one has no gaps in the grid, "
|
||||||
|
"but various cells are given different alignment options and some of them "
|
||||||
|
"hold nested sizers."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Flexible Grid", makeGrid3,
|
||||||
|
"This grid allows the rows to have different heights and the columns to have "
|
||||||
|
"different widths. You can also specify rows and columns that are growable, "
|
||||||
|
"which we have done for the first and last row and the middle column for "
|
||||||
|
"this example.\n"
|
||||||
|
"\nThere is also a spacer in the middle cell instead of an actual window."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Grid with Alignment", makeGrid4,
|
||||||
|
"New alignment flags allow for the positioning of items in any corner or centered "
|
||||||
|
"position."
|
||||||
|
),
|
||||||
|
|
||||||
|
("", None, ""),
|
||||||
|
|
||||||
|
("Proportional resize", makeSimpleBoxShaped,
|
||||||
|
"Managed items can preserve their original aspect ratio. The last item has the "
|
||||||
|
"wxSHAPED flag set and will resize proportional to its origingal size."
|
||||||
|
),
|
||||||
|
|
||||||
|
("Proportional resize with Alignments", makeShapes,
|
||||||
|
"This one shows various alignments as well as proportional resizing for all items."
|
||||||
|
),
|
||||||
|
|
||||||
|
]
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, title, sizerFunc):
|
||||||
|
wxFrame.__init__(self, parent, -1, title)
|
||||||
|
EVT_BUTTON(self, 1010, self.OnButton)
|
||||||
|
|
||||||
|
self.sizer = sizerFunc(self)
|
||||||
|
self.CreateStatusBar()
|
||||||
|
self.SetStatusText("Resize this frame to see how the sizers respond...")
|
||||||
|
self.sizer.Fit(self)
|
||||||
|
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
self.SetSizer(self.sizer)
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.MakeModal(false)
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
def OnButton(self, event):
|
||||||
|
self.Close(true)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class TestSelectionPanel(wxPanel):
|
||||||
|
def __init__(self, parent, frame):
|
||||||
|
wxPanel.__init__(self, parent, -1)
|
||||||
|
self.frame = frame
|
||||||
|
|
||||||
|
self.list = wxListBox(self, 401,
|
||||||
|
wxDLG_PNT(self, 10, 10), wxDLG_SZE(self, 100, 100),
|
||||||
|
[])
|
||||||
|
EVT_LISTBOX(self, 401, self.OnSelect)
|
||||||
|
EVT_LISTBOX_DCLICK(self, 401, self.OnDClick)
|
||||||
|
|
||||||
|
self.btn = wxButton(self, 402, "Try it!", wxDLG_PNT(self, 120, 10)).SetDefault()
|
||||||
|
EVT_BUTTON(self, 402, self.OnDClick)
|
||||||
|
|
||||||
|
self.text = wxTextCtrl(self, -1, "",
|
||||||
|
wxDLG_PNT(self, 10, 115),
|
||||||
|
wxDLG_SZE(self, 200, 50),
|
||||||
|
wxTE_MULTILINE | wxTE_READONLY)
|
||||||
|
|
||||||
|
for item in theTests:
|
||||||
|
self.list.Append(item[0])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def OnSelect(self, event):
|
||||||
|
pos = self.list.GetSelection()
|
||||||
|
self.text.SetValue(theTests[pos][2])
|
||||||
|
|
||||||
|
|
||||||
|
def OnDClick(self, event):
|
||||||
|
pos = self.list.GetSelection()
|
||||||
|
title = theTests[pos][0]
|
||||||
|
func = theTests[pos][1]
|
||||||
|
|
||||||
|
if func:
|
||||||
|
win = TestFrame(self, title, func)
|
||||||
|
win.CentreOnParent(wxBOTH)
|
||||||
|
win.Show(true)
|
||||||
|
win.MakeModal(true)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestSelectionPanel(nb, frame)
|
||||||
|
return win
|
||||||
|
|
||||||
|
overview = ""
|
||||||
|
#wxSizer.__doc__ + '\n' + '-' * 80 + '\n' + \
|
||||||
|
#wxBoxSizer.__doc__ + '\n' + '-' * 80 + '\n' + \
|
||||||
|
#wxBorderSizer.__doc__
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
class MainFrame(wxFrame):
|
||||||
|
def __init__(self):
|
||||||
|
wxFrame.__init__(self, NULL, -1, "Testing...")
|
||||||
|
|
||||||
|
self.CreateStatusBar()
|
||||||
|
mainmenu = wxMenuBar()
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(200, 'E&xit', 'Get the heck outta here!')
|
||||||
|
mainmenu.Append(menu, "&File")
|
||||||
|
self.SetMenuBar(mainmenu)
|
||||||
|
EVT_MENU(self, 200, self.OnExit)
|
||||||
|
self.panel = TestSelectionPanel(self, self)
|
||||||
|
self.SetSize(wxSize(400, 380))
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
def OnExit(self, event):
|
||||||
|
self.Close(true)
|
||||||
|
|
||||||
|
|
||||||
|
class TestApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
frame = MainFrame()
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
return true
|
||||||
|
|
||||||
|
app = TestApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
377
wxPython/demo/SlashDot.py
Normal file
@@ -0,0 +1,377 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
"""This is SlashDot 1.2
|
||||||
|
|
||||||
|
It's the obligatory Slashdot.org headlines reader that
|
||||||
|
any modern widget set/library must have in order to be taken
|
||||||
|
seriously :-)
|
||||||
|
|
||||||
|
Usage is quite simple; wxSlash attempts to download the
|
||||||
|
'ultramode.txt' file from http://slashdot.org, which
|
||||||
|
contains the headlines in a computer friendly format. It
|
||||||
|
then displays said headlines in a wxWindows list control.
|
||||||
|
|
||||||
|
You can read articles using either Python's html library
|
||||||
|
or an external browser. Uncheck the 'browser->internal' menu
|
||||||
|
item to use the latter option. Use the settings dialog box
|
||||||
|
to set which external browser is started.
|
||||||
|
|
||||||
|
This code is available under the wxWindows license, see
|
||||||
|
elsewhere. If you modify this code, be aware of the fact
|
||||||
|
that slashdot.org's maintainer, CmdrTaco, explicitly asks
|
||||||
|
'ultramode.txt' downloaders not to do this automatically
|
||||||
|
more than twice per hour. If this feature is abused,
|
||||||
|
CmdrTaco may remove the ultramode file completely and that
|
||||||
|
will make a *lot* of people unhappy.
|
||||||
|
|
||||||
|
I want to thank Alex Shnitman whose slashes.pl
|
||||||
|
(Perl/GTK) script gave me the idea for this applet.
|
||||||
|
|
||||||
|
Have fun with it,
|
||||||
|
|
||||||
|
Harm van der Heijden (H.v.d.Heijden@phys.tue.nl)
|
||||||
|
"""
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from httplib import HTTP
|
||||||
|
from htmllib import HTMLParser
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import formatter
|
||||||
|
|
||||||
|
class HTMLTextView(wxFrame):
|
||||||
|
def __init__(self, parent, id, title='HTMLTextView', url=None):
|
||||||
|
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition,
|
||||||
|
wxSize(600,400))
|
||||||
|
|
||||||
|
self.mainmenu = wxMenuBar()
|
||||||
|
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(201, '&Open URL...', 'Open URL')
|
||||||
|
EVT_MENU(self, 201, self.OnFileOpen)
|
||||||
|
menu.Append(209, 'E&xit', 'Exit viewer')
|
||||||
|
EVT_MENU(self, 209, self.OnFileExit)
|
||||||
|
|
||||||
|
self.mainmenu.Append(menu, '&File')
|
||||||
|
self.SetMenuBar(self.mainmenu)
|
||||||
|
self.CreateStatusBar(1)
|
||||||
|
|
||||||
|
self.text = wxTextCtrl(self, -1, "", wxPyDefaultPosition,
|
||||||
|
wxPyDefaultSize, wxTE_MULTILINE | wxTE_READONLY)
|
||||||
|
|
||||||
|
if (url):
|
||||||
|
self.OpenURL(url)
|
||||||
|
|
||||||
|
def logprint(self, x):
|
||||||
|
self.SetStatusText(x)
|
||||||
|
|
||||||
|
def OpenURL(self, url):
|
||||||
|
self.url = url
|
||||||
|
m = re.match('file:(\S+)\s*', url)
|
||||||
|
if m:
|
||||||
|
f = open(m.groups()[0],'r')
|
||||||
|
else:
|
||||||
|
m = re.match('http://([^/]+)(/\S*)\s*', url)
|
||||||
|
if m:
|
||||||
|
host = m.groups()[0]
|
||||||
|
path = m.groups()[1]
|
||||||
|
else:
|
||||||
|
m = re.match('http://(\S+)\s*', url)
|
||||||
|
if not m:
|
||||||
|
# Invalid URL
|
||||||
|
self.logprint("Invalid or unsupported URL: %s" % (url))
|
||||||
|
return
|
||||||
|
host = m.groups()[0]
|
||||||
|
path = ''
|
||||||
|
f = RetrieveAsFile(host,path,self.logprint)
|
||||||
|
if not f:
|
||||||
|
self.logprint("Could not open %s" % (url))
|
||||||
|
return
|
||||||
|
self.logprint("Receiving data...")
|
||||||
|
data = f.read()
|
||||||
|
tmp = open('tmphtml.txt','w')
|
||||||
|
fmt = formatter.AbstractFormatter(formatter.DumbWriter(tmp))
|
||||||
|
p = HTMLParser(fmt)
|
||||||
|
self.logprint("Parsing data...")
|
||||||
|
p.feed(data)
|
||||||
|
p.close()
|
||||||
|
tmp.close()
|
||||||
|
tmp = open('tmphtml.txt', 'r')
|
||||||
|
self.text.SetValue(tmp.read())
|
||||||
|
self.SetTitle(url)
|
||||||
|
self.logprint(url)
|
||||||
|
|
||||||
|
def OnFileOpen(self, event):
|
||||||
|
dlg = wxTextEntryDialog(self, "Enter URL to open:", "")
|
||||||
|
if dlg.ShowModal() == wxID_OK:
|
||||||
|
url = dlg.GetValue()
|
||||||
|
else:
|
||||||
|
url = None
|
||||||
|
if url:
|
||||||
|
self.OpenURL(url)
|
||||||
|
|
||||||
|
def OnFileExit(self, event):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
def ParseSlashdot(f):
|
||||||
|
art_sep = re.compile('%%\r?\n')
|
||||||
|
line_sep = re.compile('\r?\n')
|
||||||
|
data = f.read()
|
||||||
|
list = art_sep.split(data)
|
||||||
|
art_list = []
|
||||||
|
for i in range(1,len(list)-1):
|
||||||
|
art_list.append(line_sep.split(list[i]))
|
||||||
|
return art_list
|
||||||
|
|
||||||
|
def myprint(x):
|
||||||
|
print x
|
||||||
|
|
||||||
|
def RetrieveAsFile(host, path='', logprint = myprint):
|
||||||
|
try:
|
||||||
|
h = HTTP(host)
|
||||||
|
except:
|
||||||
|
logprint("Failed to create HTTP connection to %s... is the network available?" % (host))
|
||||||
|
return None
|
||||||
|
h.putrequest('GET',path)
|
||||||
|
h.putheader('Accept','text/html')
|
||||||
|
h.putheader('Accept','text/plain')
|
||||||
|
h.endheaders()
|
||||||
|
errcode, errmsg, headers = h.getreply()
|
||||||
|
if errcode != 200:
|
||||||
|
logprint("HTTP error code %d: %s" % (errcode, errmsg))
|
||||||
|
return None
|
||||||
|
f = h.getfile()
|
||||||
|
# f = open('/home/harm/ultramode.txt','r')
|
||||||
|
return f
|
||||||
|
|
||||||
|
|
||||||
|
class AppStatusBar(wxStatusBar):
|
||||||
|
def __init__(self, parent):
|
||||||
|
wxStatusBar.__init__(self,parent, -1)
|
||||||
|
self.SetFieldsCount(2)
|
||||||
|
self.SetStatusWidths([-1, 100])
|
||||||
|
self.but = wxButton(self, 1001, "Refresh")
|
||||||
|
EVT_BUTTON(self, 1001, parent.OnViewRefresh)
|
||||||
|
self.OnSize(None)
|
||||||
|
|
||||||
|
def logprint(self,x):
|
||||||
|
self.SetStatusText(x,0)
|
||||||
|
|
||||||
|
def OnSize(self, event):
|
||||||
|
rect = self.GetFieldRect(1)
|
||||||
|
self.but.SetPosition(wxPoint(rect.x+2, rect.y+2))
|
||||||
|
self.but.SetSize(wxSize(rect.width-4, rect.height-4))
|
||||||
|
|
||||||
|
# This is a simple timer class to start a function after a short delay;
|
||||||
|
class QuickTimer(wxTimer):
|
||||||
|
def __init__(self, func, wait=100):
|
||||||
|
wxTimer.__init__(self)
|
||||||
|
self.callback = func
|
||||||
|
self.Start(wait); # wait .1 second (.001 second doesn't work. why?)
|
||||||
|
def Notify(self):
|
||||||
|
self.Stop();
|
||||||
|
apply(self.callback, ());
|
||||||
|
|
||||||
|
class AppFrame(wxFrame):
|
||||||
|
def __init__(self, parent, id, title):
|
||||||
|
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition,
|
||||||
|
wxSize(650, 250))
|
||||||
|
|
||||||
|
# if the window manager closes the window:
|
||||||
|
EVT_CLOSE(self, self.OnCloseWindow);
|
||||||
|
|
||||||
|
# Now Create the menu bar and items
|
||||||
|
self.mainmenu = wxMenuBar()
|
||||||
|
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(209, 'E&xit', 'Enough of this already!')
|
||||||
|
EVT_MENU(self, 209, self.OnFileExit)
|
||||||
|
self.mainmenu.Append(menu, '&File')
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(210, '&Refresh', 'Refresh headlines')
|
||||||
|
EVT_MENU(self, 210, self.OnViewRefresh)
|
||||||
|
menu.Append(211, '&Slashdot Index', 'View Slashdot index')
|
||||||
|
EVT_MENU(self, 211, self.OnViewIndex)
|
||||||
|
menu.Append(212, 'Selected &Article', 'View selected article')
|
||||||
|
EVT_MENU(self, 212, self.OnViewArticle)
|
||||||
|
self.mainmenu.Append(menu, '&View')
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(220, '&Internal', 'Use internal text browser',TRUE)
|
||||||
|
menu.Check(220, true)
|
||||||
|
self.UseInternal = 1;
|
||||||
|
EVT_MENU(self, 220, self.OnBrowserInternal)
|
||||||
|
menu.Append(222, '&Settings...', 'External browser Settings')
|
||||||
|
EVT_MENU(self, 222, self.OnBrowserSettings)
|
||||||
|
self.mainmenu.Append(menu, '&Browser')
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(230, '&About', 'Some documentation');
|
||||||
|
EVT_MENU(self, 230, self.OnAbout)
|
||||||
|
self.mainmenu.Append(menu, '&Help')
|
||||||
|
|
||||||
|
self.SetMenuBar(self.mainmenu)
|
||||||
|
|
||||||
|
if wxPlatform == '__WXGTK__':
|
||||||
|
# I like lynx. Also Netscape 4.5 doesn't react to my cmdline opts
|
||||||
|
self.BrowserSettings = "xterm -e lynx %s &"
|
||||||
|
elif wxPlatform == '__WXMSW__':
|
||||||
|
# netscape 4.x likes to hang out here...
|
||||||
|
self.BrowserSettings = '\\progra~1\\Netscape\\Communicator\\Program\\netscape.exe %s'
|
||||||
|
else:
|
||||||
|
# a wild guess...
|
||||||
|
self.BrowserSettings = 'netscape %s'
|
||||||
|
|
||||||
|
# A status bar to tell people what's happening
|
||||||
|
self.sb = AppStatusBar(self)
|
||||||
|
self.SetStatusBar(self.sb)
|
||||||
|
|
||||||
|
self.list = wxListCtrl(self, 1100, style=wxLC_REPORT)
|
||||||
|
self.list.InsertColumn(0, 'Subject')
|
||||||
|
self.list.InsertColumn(1, 'Date')
|
||||||
|
self.list.InsertColumn(2, 'Posted by')
|
||||||
|
self.list.InsertColumn(3, 'Comments')
|
||||||
|
self.list.SetColumnWidth(0, 300)
|
||||||
|
self.list.SetColumnWidth(1, 150)
|
||||||
|
self.list.SetColumnWidth(2, 100)
|
||||||
|
self.list.SetColumnWidth(3, 100)
|
||||||
|
|
||||||
|
EVT_LIST_ITEM_SELECTED(self, 1100, self.OnItemSelected)
|
||||||
|
EVT_LEFT_DCLICK(self.list, self.OnLeftDClick)
|
||||||
|
|
||||||
|
self.logprint("Connecting to slashdot... Please wait.")
|
||||||
|
# wxYield doesn't yet work here. That's why we use a timer
|
||||||
|
# to make sure that we see some GUI stuff before the slashdot
|
||||||
|
# file is transfered.
|
||||||
|
self.timer = QuickTimer(self.DoRefresh, 1000)
|
||||||
|
|
||||||
|
def logprint(self, x):
|
||||||
|
self.sb.logprint(x)
|
||||||
|
|
||||||
|
def OnFileExit(self, event):
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
def DoRefresh(self):
|
||||||
|
f = RetrieveAsFile('slashdot.org','/ultramode.txt',self.sb.logprint)
|
||||||
|
art_list = ParseSlashdot(f)
|
||||||
|
self.list.DeleteAllItems()
|
||||||
|
self.url = []
|
||||||
|
self.current = -1
|
||||||
|
i = 0;
|
||||||
|
for article in art_list:
|
||||||
|
self.list.InsertStringItem(i, article[0])
|
||||||
|
self.list.SetStringItem(i, 1, article[2])
|
||||||
|
self.list.SetStringItem(i, 2, article[3])
|
||||||
|
self.list.SetStringItem(i, 3, article[6])
|
||||||
|
self.url.append(article[1])
|
||||||
|
i = i + 1
|
||||||
|
self.logprint("File retrieved OK.")
|
||||||
|
|
||||||
|
def OnViewRefresh(self, event):
|
||||||
|
self.logprint("Connecting to slashdot... Please wait.");
|
||||||
|
wxYield()
|
||||||
|
self.DoRefresh()
|
||||||
|
|
||||||
|
def DoViewIndex(self):
|
||||||
|
if self.UseInternal:
|
||||||
|
self.view = HTMLTextView(self, -1, 'slashdot.org',
|
||||||
|
'http://slashdot.org')
|
||||||
|
self.view.Show(true)
|
||||||
|
else:
|
||||||
|
self.logprint(self.BrowserSettings % ('http://slashdot.org'))
|
||||||
|
#os.system(self.BrowserSettings % ('http://slashdot.org'))
|
||||||
|
wxExecute(self.BrowserSettings % ('http://slashdot.org'))
|
||||||
|
self.logprint("OK")
|
||||||
|
|
||||||
|
def OnViewIndex(self, event):
|
||||||
|
self.logprint("Starting browser... Please wait.")
|
||||||
|
wxYield()
|
||||||
|
self.DoViewIndex()
|
||||||
|
|
||||||
|
def DoViewArticle(self):
|
||||||
|
if self.current<0: return
|
||||||
|
url = self.url[self.current]
|
||||||
|
if self.UseInternal:
|
||||||
|
self.view = HTMLTextView(self, -1, url, url)
|
||||||
|
self.view.Show(true)
|
||||||
|
else:
|
||||||
|
self.logprint(self.BrowserSettings % (url))
|
||||||
|
os.system(self.BrowserSettings % (url))
|
||||||
|
self.logprint("OK")
|
||||||
|
|
||||||
|
def OnViewArticle(self, event):
|
||||||
|
self.logprint("Starting browser... Please wait.")
|
||||||
|
wxYield()
|
||||||
|
self.DoViewArticle()
|
||||||
|
|
||||||
|
def OnBrowserInternal(self, event):
|
||||||
|
if self.mainmenu.Checked(220):
|
||||||
|
self.UseInternal = 1
|
||||||
|
else:
|
||||||
|
self.UseInternal = 0
|
||||||
|
|
||||||
|
def OnBrowserSettings(self, event):
|
||||||
|
dlg = wxTextEntryDialog(self, "Enter command to view URL.\nUse %s as a placeholder for the URL.", "", self.BrowserSettings);
|
||||||
|
if dlg.ShowModal() == wxID_OK:
|
||||||
|
self.BrowserSettings = dlg.GetValue()
|
||||||
|
|
||||||
|
def OnAbout(self, event):
|
||||||
|
dlg = wxMessageDialog(self, __doc__, "wxSlash", wxOK | wxICON_INFORMATION)
|
||||||
|
dlg.ShowModal()
|
||||||
|
|
||||||
|
def OnItemSelected(self, event):
|
||||||
|
self.current = event.m_itemIndex
|
||||||
|
self.logprint("URL: %s" % (self.url[self.current]))
|
||||||
|
|
||||||
|
def OnLeftDClick(self, event):
|
||||||
|
(x,y) = event.Position();
|
||||||
|
# Actually, we should convert x,y to logical coords using
|
||||||
|
# a dc, but only for a wxScrolledWindow widget.
|
||||||
|
# Now wxGTK derives wxListCtrl from wxScrolledWindow,
|
||||||
|
# and wxMSW from wxControl... So that doesn't work.
|
||||||
|
#dc = wxClientDC(self.list)
|
||||||
|
##self.list.PrepareDC(dc)
|
||||||
|
#x = dc.DeviceToLogicalX( event.GetX() )
|
||||||
|
#y = dc.DeviceToLogicalY( event.GetY() )
|
||||||
|
id = self.list.HitTest(wxPoint(x,y))
|
||||||
|
#print "Double click at %d %d" % (x,y), id
|
||||||
|
# Okay, we got a double click. Let's assume it's the current selection
|
||||||
|
wxYield()
|
||||||
|
self.OnViewArticle(event)
|
||||||
|
|
||||||
|
def OnCloseWindow(self, event):
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# if running standalone
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
class MyApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
frame = AppFrame(NULL, -1, "Slashdot Breaking News")
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
return true
|
||||||
|
|
||||||
|
app = MyApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# if running as part of the Demo Framework...
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = AppFrame(NULL, -1, "Slashdot Breaking News")
|
||||||
|
frame.otherWin = win
|
||||||
|
win.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
overview = __doc__
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
240
wxPython/demo/Threads.py
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
import thread
|
||||||
|
import time
|
||||||
|
from whrandom import random
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxEVT_UPDATE_BARGRAPH = 25015
|
||||||
|
|
||||||
|
def EVT_UPDATE_BARGRAPH(win, func):
|
||||||
|
win.Connect(-1, -1, wxEVT_UPDATE_BARGRAPH, func)
|
||||||
|
|
||||||
|
|
||||||
|
class UpdateBarEvent(wxPyEvent):
|
||||||
|
def __init__(self, barNum, value):
|
||||||
|
wxPyEvent.__init__(self)
|
||||||
|
self.SetEventType(wxEVT_UPDATE_BARGRAPH)
|
||||||
|
self.barNum = barNum
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class CalcBarThread:
|
||||||
|
def __init__(self, win, barNum, val):
|
||||||
|
self.win = win
|
||||||
|
self.barNum = barNum
|
||||||
|
self.val = val
|
||||||
|
|
||||||
|
def Start(self):
|
||||||
|
self.keepGoing = self.running = true
|
||||||
|
thread.start_new_thread(self.Run, ())
|
||||||
|
|
||||||
|
def Stop(self):
|
||||||
|
self.keepGoing = false
|
||||||
|
|
||||||
|
def IsRunning(self):
|
||||||
|
return self.running
|
||||||
|
|
||||||
|
def Run(self):
|
||||||
|
while self.keepGoing:
|
||||||
|
evt = UpdateBarEvent(self.barNum, int(self.val))
|
||||||
|
wxPostEvent(self.win, evt)
|
||||||
|
del evt
|
||||||
|
|
||||||
|
sleeptime = (random() * 2) + 0.5
|
||||||
|
#print self.barNum, 'sleeping for', sleeptime
|
||||||
|
time.sleep(sleeptime)
|
||||||
|
|
||||||
|
sleeptime = sleeptime * 5
|
||||||
|
if int(random() * 2):
|
||||||
|
self.val = self.val + sleeptime
|
||||||
|
else:
|
||||||
|
self.val = self.val - sleeptime
|
||||||
|
|
||||||
|
if self.val < 0: self.val = 0
|
||||||
|
if self.val > 300: self.val = 300
|
||||||
|
|
||||||
|
self.running = false
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class GraphWindow(wxWindow):
|
||||||
|
def __init__(self, parent, labels):
|
||||||
|
wxWindow.__init__(self, parent, -1)
|
||||||
|
|
||||||
|
self.values = []
|
||||||
|
for label in labels:
|
||||||
|
self.values.append((label, 0))
|
||||||
|
|
||||||
|
self.font = wxFont(12, wxSWISS, wxNORMAL, wxBOLD)
|
||||||
|
self.SetFont(self.font)
|
||||||
|
|
||||||
|
self.colors = [ wxRED, wxGREEN, wxBLUE, wxCYAN,
|
||||||
|
wxNamedColour("Yellow"), wxNamedColor("Navy") ]
|
||||||
|
|
||||||
|
|
||||||
|
def SetValue(self, index, value):
|
||||||
|
assert index < len(self.values)
|
||||||
|
cur = self.values[index]
|
||||||
|
self.values[index:index+1] = [(cur[0], value)]
|
||||||
|
|
||||||
|
|
||||||
|
def SetFont(self, font):
|
||||||
|
wxWindow.SetFont(self, font)
|
||||||
|
wmax = hmax = 0
|
||||||
|
for label, val in self.values:
|
||||||
|
w,h = self.GetTextExtent(label)
|
||||||
|
if w > wmax: wmax = w
|
||||||
|
if h > hmax: hmax = h
|
||||||
|
self.linePos = wmax + 10
|
||||||
|
self.barHeight = hmax
|
||||||
|
|
||||||
|
|
||||||
|
def Draw(self, dc, size):
|
||||||
|
dc.SetFont(self.font)
|
||||||
|
dc.SetTextForeground(wxBLUE)
|
||||||
|
dc.SetBackground(wxBrush(self.GetBackgroundColour()))
|
||||||
|
dc.Clear()
|
||||||
|
dc.SetPen(wxPen(wxBLACK, 3, wxSOLID))
|
||||||
|
dc.DrawLine(self.linePos, 0, self.linePos, size.height-10)
|
||||||
|
|
||||||
|
bh = ypos = self.barHeight
|
||||||
|
for x in range(len(self.values)):
|
||||||
|
label, val = self.values[x]
|
||||||
|
dc.DrawText(label, 5, ypos)
|
||||||
|
|
||||||
|
if val:
|
||||||
|
color = self.colors[ x % len(self.colors) ]
|
||||||
|
dc.SetPen(wxPen(color))
|
||||||
|
dc.SetBrush(wxBrush(color))
|
||||||
|
dc.DrawRectangle(self.linePos+3, ypos, val, bh)
|
||||||
|
|
||||||
|
ypos = ypos + 2*bh
|
||||||
|
if ypos > size.height-10:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
def OnPaint(self, evt):
|
||||||
|
size = self.GetSize()
|
||||||
|
bmp = wxEmptyBitmap(size.width, size.height)
|
||||||
|
dc = wxMemoryDC()
|
||||||
|
dc.SelectObject(bmp)
|
||||||
|
self.Draw(dc, size)
|
||||||
|
|
||||||
|
wdc = wxPaintDC(self)
|
||||||
|
wdc.BeginDrawing()
|
||||||
|
wdc.Blit(0,0, size.width, size.height, dc, 0,0)
|
||||||
|
wdc.EndDrawing()
|
||||||
|
|
||||||
|
dc.SelectObject(wxNullBitmap)
|
||||||
|
|
||||||
|
|
||||||
|
def OnEraseBackground(self, evt):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestFrame(wxFrame):
|
||||||
|
def __init__(self, parent, log):
|
||||||
|
wxFrame.__init__(self, parent, -1, "Thread Test", size=(450,300))
|
||||||
|
self.log = log
|
||||||
|
|
||||||
|
#self.CenterOnParent()
|
||||||
|
|
||||||
|
panel = wxPanel(self, -1)
|
||||||
|
panel.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD))
|
||||||
|
wxStaticText(panel, -1,
|
||||||
|
"This demo shows multiple threads interacting with this\n"
|
||||||
|
"window by sending events to it.", wxPoint(5,5))
|
||||||
|
panel.Fit()
|
||||||
|
|
||||||
|
self.graph = GraphWindow(self, ['Zero', 'One', 'Two', 'Three', 'Four',
|
||||||
|
'Five', 'Six', 'Seven'])
|
||||||
|
|
||||||
|
sizer = wxBoxSizer(wxVERTICAL)
|
||||||
|
sizer.Add(panel, 0, wxEXPAND)
|
||||||
|
sizer.Add(self.graph, 1, wxEXPAND)
|
||||||
|
|
||||||
|
self.SetSizer(sizer)
|
||||||
|
self.SetAutoLayout(true)
|
||||||
|
|
||||||
|
#self.graph.SetValue(0, 25)
|
||||||
|
#self.graph.SetValue(1, 50)
|
||||||
|
#self.graph.SetValue(2, 75)
|
||||||
|
#self.graph.SetValue(3, 100)
|
||||||
|
|
||||||
|
EVT_UPDATE_BARGRAPH(self, self.OnUpdate)
|
||||||
|
self.threads = []
|
||||||
|
self.threads.append(CalcBarThread(self, 0, 50))
|
||||||
|
self.threads.append(CalcBarThread(self, 1, 75))
|
||||||
|
self.threads.append(CalcBarThread(self, 2, 100))
|
||||||
|
self.threads.append(CalcBarThread(self, 3, 150))
|
||||||
|
self.threads.append(CalcBarThread(self, 4, 225))
|
||||||
|
self.threads.append(CalcBarThread(self, 5, 300))
|
||||||
|
self.threads.append(CalcBarThread(self, 6, 250))
|
||||||
|
self.threads.append(CalcBarThread(self, 7, 175))
|
||||||
|
|
||||||
|
for t in self.threads:
|
||||||
|
t.Start()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def OnUpdate(self, evt):
|
||||||
|
self.graph.SetValue(evt.barNum, evt.value)
|
||||||
|
self.graph.Refresh(false)
|
||||||
|
|
||||||
|
|
||||||
|
def OnCloseWindow(self, evt):
|
||||||
|
busy = wxBusyInfo("One moment please, waiting for threads to die...")
|
||||||
|
for t in self.threads:
|
||||||
|
t.Stop()
|
||||||
|
running = 1
|
||||||
|
while running:
|
||||||
|
running = 0
|
||||||
|
for t in self.threads:
|
||||||
|
running = running + t.IsRunning()
|
||||||
|
time.sleep(0.1)
|
||||||
|
self.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = TestFrame(frame, log)
|
||||||
|
frame.otherWin = win
|
||||||
|
win.Show(true)
|
||||||
|
return None
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
The main issue with multi-threaded GUI programming is the thread safty
|
||||||
|
of the GUI itself. On most platforms the GUI is not thread safe and
|
||||||
|
so any cross platform GUI Toolkit and applications written with it
|
||||||
|
need to take that into account.
|
||||||
|
|
||||||
|
The solution is to only allow interaction with the GUI from a single
|
||||||
|
thread, but this often severly limits what can be done in an
|
||||||
|
application and makes it difficult to use additional threads at all.
|
||||||
|
|
||||||
|
Since wxPython already makes extensive use of event handlers, it is a
|
||||||
|
logical extension to allow events to be sent to GUI objects from
|
||||||
|
alternate threads. A function called wxPostEvent allows you to do
|
||||||
|
this. It accepts an event and an event handler (window) and instead
|
||||||
|
of sending the event immediately in the current context like
|
||||||
|
ProcessEvent does, it processes it later from the context of the GUI
|
||||||
|
thread.
|
||||||
|
|
||||||
|
"""
|
||||||
67
wxPython/demo/XMLtreeview.py
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
import string
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
try:
|
||||||
|
from xml.parsers import pyexpat
|
||||||
|
haveXML = true
|
||||||
|
except ImportError:
|
||||||
|
haveXML = false
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
if not haveXML:
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
dlg = wxMessageDialog(frame, 'This demo requires the XML package. See http://www.python.org/sigs/xml-sig/',
|
||||||
|
'Sorry', wxOK | wxICON_INFORMATION)
|
||||||
|
dlg.ShowModal()
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
class XMLTree(wxTreeCtrl):
|
||||||
|
def __init__(self, parent, ID):
|
||||||
|
wxTreeCtrl.__init__(self, parent, ID)
|
||||||
|
self.nodeStack = [self.AddRoot("Root")]
|
||||||
|
|
||||||
|
# Define a handler for start element events
|
||||||
|
def StartElement(self, name, attrs ):
|
||||||
|
id = self.AppendItem(self.nodeStack[-1], name)
|
||||||
|
self.nodeStack.append(id)
|
||||||
|
|
||||||
|
def EndElement(self, name ):
|
||||||
|
self.nodeStack = self.nodeStack[:-1]
|
||||||
|
|
||||||
|
def CharacterData(self, data ):
|
||||||
|
if string.strip(data):
|
||||||
|
self.AppendItem(self.nodeStack[-1], data)
|
||||||
|
|
||||||
|
|
||||||
|
def LoadTree(self, filename):
|
||||||
|
# Create a parser
|
||||||
|
Parser = pyexpat.ParserCreate()
|
||||||
|
|
||||||
|
# Tell the parser what the start element handler is
|
||||||
|
Parser.StartElementHandler = self.StartElement
|
||||||
|
Parser.EndElementHandler = self.EndElement
|
||||||
|
Parser.CharacterDataHandler = self.CharacterData
|
||||||
|
|
||||||
|
# Parse the XML File
|
||||||
|
ParserStatus = Parser.Parse(open(filename,'r').read(), 1)
|
||||||
|
|
||||||
|
|
||||||
|
def runTest(frame, nb, log):
|
||||||
|
win = XMLTree(nb, -1)
|
||||||
|
win.LoadTree("paper.xml")
|
||||||
|
return win
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
overview = """\
|
||||||
|
"""
|
||||||
|
|
||||||
1
wxPython/demo/bitmaps/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
new.bmp.test
|
||||||
BIN
wxPython/demo/bitmaps/Calend.bmp
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
wxPython/demo/bitmaps/DbDec.bmp
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
wxPython/demo/bitmaps/DbInc.bmp
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
wxPython/demo/bitmaps/Dec.bmp
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
wxPython/demo/bitmaps/Inc.bmp
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
wxPython/demo/bitmaps/Pt.bmp
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
wxPython/demo/bitmaps/copy.bmp
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
wxPython/demo/bitmaps/image.bmp
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
wxPython/demo/bitmaps/image.gif
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
wxPython/demo/bitmaps/image.jpg
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
wxPython/demo/bitmaps/image.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
wxPython/demo/bitmaps/lb1.bmp
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
wxPython/demo/bitmaps/lb2.bmp
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
wxPython/demo/bitmaps/mondrian.ico
Normal file
|
After Width: | Height: | Size: 766 B |
BIN
wxPython/demo/bitmaps/new.bmp
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
wxPython/demo/bitmaps/open.bmp
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
wxPython/demo/bitmaps/paste.bmp
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
wxPython/demo/bitmaps/smiles.bmp
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
wxPython/demo/bitmaps/smiles.ico
Normal file
|
After Width: | Height: | Size: 766 B |
BIN
wxPython/demo/bitmaps/splash.gif
Normal file
|
After Width: | Height: | Size: 89 KiB |
BIN
wxPython/demo/bitmaps/test2.bmp
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
wxPython/demo/bitmaps/test_image.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |