⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _oglshapes2.i

📁 Wxpython Implemented on Windows CE, Source code
💻 I
📖 第 1 页 / 共 2 页
字号:
/////////////////////////////////////////////////////////////////////////////
// Name:        oglshapes2.i
// Purpose:     SWIG definitions for the wxWindows Object Graphics Library
//
// Author:      Robin Dunn
//
// Created:     3-Sept-1999
// RCS-ID:      $Id: _oglshapes2.i,v 1.10 2005/03/09 22:28:49 RD Exp $
// Copyright:   (c) 1998 by Total Control Software
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////


// not a %module


//---------------------------------------------------------------------------

%{
    WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
%}

class wxPyEllipseShape : public wxPyShape {
public:
    %pythonAppend wxPyEllipseShape "self._setOORandCallbackInfo(PyEllipseShape)"
    
    wxPyEllipseShape(double width = 0.0, double height = 0.0);

    void _setCallbackInfo(PyObject* self, PyObject* _class);

    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:
    %pythonAppend wxPyCircleShape "self._setOORandCallbackInfo(PyCircleShape)"
    
    wxPyCircleShape(double width = 0.0);

    void _setCallbackInfo(PyObject* self, PyObject* _class);

    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 wxObject {
public:
    wxArrowHead(int type = 0,
                int end = 0,
                double size = 0.0,
                double dist = 0.0,
                const wxString& name = wxPyEmptyString,
                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:
    %pythonAppend wxPyLineShape "self._setOORandCallbackInfo(PyLineShape)"
    
    wxPyLineShape();

    void _setCallbackInfo(PyObject* self, PyObject* _class);

    void AddArrow(int type, int end = ARROW_POSITION_END,
                  double arrowSize = 10.0, double xOffset = 0.0,
                  const wxString& name = wxPyEmptyString, wxPseudoMetaFile *mf = NULL,
                  long arrowId = -1);

    //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
    %extend {
        void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
            wxList* list = wxPy_wxListHelper(referenceList, wxT("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);
    %Rename(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);
    %Rename(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);
    wxRealPoint * GetNextControlPoint(wxPyShape *shape);
    wxPyShape * GetTo();
    void Initialise();
    void InsertLineControlPoint(wxDC* dc);
    bool IsEnd(wxPyShape *shape);
    bool IsSpline();
    void MakeLineControlPoints(int n);

    //   inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
    %extend {
        PyObject* GetLineControlPoints() {
            wxList* list = self->GetLineControlPoints();
            return wxPy_ConvertRealPointList(list);
        }

        // part of Patch# 893337
        void SetLineControlPoints(PyObject* list) {
            wxList* real_point_list = wxPy_wxRealPoint_ListHelper(list);
            self->MakeLineControlPoints((int)(real_point_list->GetCount()));
            wxList* old_control_points = self->GetLineControlPoints();
            wxNode* old_node = old_control_points->GetFirst();
            wxNode* real_node = real_point_list->GetFirst();
            while(old_node)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -