mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-26 01:28:38 +08:00
wxPython module for OGL added.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
Makefile
|
||||
oglc.exp
|
||||
oglc.ilk
|
||||
oglc.pch
|
||||
oglc.pyd
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
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
|
||||
|
||||
|
||||
# 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
|
||||
@@ -0,0 +1,61 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 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 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;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- python -*-
|
||||
|
||||
MODULE = 'oglc'
|
||||
SWIGFILES = ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i', 'oglcanvas.i']
|
||||
SOURCES = ['oglhelpers.cpp']
|
||||
|
||||
|
||||
OTHERCFLAGS = '-I$(WXWIN)/utils/ogl/src'
|
||||
OTHERLIBS = '$(WXWIN)/lib/ogl$(LIBEXT).lib'
|
||||
|
||||
#OTHERSWIGFLAGS = '-stat'
|
||||
SWIGDEPS = '_ogldefs.i'
|
||||
OTHERDEPS = 'oglhelpers.h $(WXPSRCDIR)/helpers.h'
|
||||
|
||||
|
||||
# There are no platform differences so we don't need separate code directories
|
||||
GENCODEDIR='.'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,179 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 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 <ogl.h>
|
||||
#include <basicp.h>
|
||||
#include <constrnt.h>
|
||||
#include <bmpshape.h>
|
||||
#include <drawn.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";
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -0,0 +1,154 @@
|
||||
# This file was created automatically by SWIG.
|
||||
import oglc
|
||||
|
||||
from misc import *
|
||||
|
||||
from misc2 import *
|
||||
|
||||
from windows import *
|
||||
|
||||
from gdi 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 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
|
||||
|
||||
|
||||
# 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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,380 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 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 *x, double *y);
|
||||
void GetProportion(double *x, double *y);
|
||||
void GetSize(double *x, double *y);
|
||||
void GetPosition(double *xp, double *yp);
|
||||
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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
%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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
%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() ;
|
||||
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 *regionId);
|
||||
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 *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
|
||||
int GetNumberOfAttachments();
|
||||
bool AttachmentIsValid(int attachment);
|
||||
bool GetAttachmentPositionEdge(int attachment, double *x, double *y,
|
||||
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");
|
||||
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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
EXPORTS
|
||||
initoglc
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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 *x, double *y);
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
%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 *attachment,
|
||||
wxClassInfo *info = NULL, wxPyShape* notImage = NULL);
|
||||
|
||||
wxPyShape * FindFirstSensitiveShape(double x1, double y, int *attachment, 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 *x, double *y);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
# This file was created automatically by SWIG.
|
||||
import oglcanvasc
|
||||
|
||||
from misc import *
|
||||
|
||||
from misc2 import *
|
||||
|
||||
from windows import *
|
||||
|
||||
from gdi 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 *
|
||||
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)
|
||||
if val: val = wxPyShapePtr(val)
|
||||
return val
|
||||
def FindFirstSensitiveShape(self, *_args, **_kwargs):
|
||||
val = apply(oglcanvasc.wxPyShapeCanvas_FindFirstSensitiveShape,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapePtr(val)
|
||||
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)
|
||||
wx._StdWindowCallbacks(self)
|
||||
wx._StdOnScrollCallbacks(self)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
|
||||
|
||||
|
||||
#-------------- VARIABLE WRAPPERS ------------------
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert a wxList to a Python List
|
||||
|
||||
#include <ogl.h>
|
||||
|
||||
PyObject* wxPy_ConvertList(wxList* list, char* className) {
|
||||
PyObject* pyList;
|
||||
PyObject* pyObj;
|
||||
wxObject* wxObj;
|
||||
wxNode* node = list->First();
|
||||
|
||||
bool doSave = wxPyRestoreThread();
|
||||
pyList = PyList_New(0);
|
||||
while (node) {
|
||||
wxObj = node->Data();
|
||||
// printf("%s class at %x : %x\n", wxObj->GetClassInfo()->GetClassName(), (void*)wxObj, (void*)((wxShape*)wxObj)->GetParent());
|
||||
pyObj = wxPyConstructObject(wxObj, className);
|
||||
PyList_Append(pyList, pyObj);
|
||||
node = node->Next();
|
||||
}
|
||||
// for (int x=0; x<PyList_Size(pyList); x++) {
|
||||
// PyObject* obj = PyList_GetItem(pyList, x);
|
||||
// char* attr = PyString_AsString(PyObject_GetAttrString(obj, "this"));
|
||||
// PyObject* par = PyObject_CallMethod(obj, "GetParent", NULL);
|
||||
// char* parent;
|
||||
// if (par != Py_None)
|
||||
// parent = PyString_AsString(PyObject_GetAttrString(par, "this"));
|
||||
// else
|
||||
// parent = "None";
|
||||
// printf("obj.this = %s obj.GetParent().this = %s\n", attr, parent);
|
||||
// }
|
||||
// printf("--------\n");
|
||||
wxPySaveThread(doSave);
|
||||
return pyList;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 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 <ogl.h>
|
||||
#include <basicp.h>
|
||||
#include <constrnt.h>
|
||||
#include <bmpshape.h>
|
||||
#include <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);
|
||||
|
||||
PyObject* wxPy_ConvertList(wxList* list, char* className);
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// 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 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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
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");
|
||||
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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
|
||||
// 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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
%pragma(python) addtomethod = "__init__:self._setSelf(self)"
|
||||
|
||||
|
||||
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(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
|
||||
void base_OnSizingEndDragLeft(wxControlPoint* 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);
|
||||
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user