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

📄 _oglshapes2.i

📁 Wxpython Implemented on Windows CE, Source code
💻 I
📖 第 1 页 / 共 2 页
字号:
            {
                wxRealPoint* old_point = (wxRealPoint*)old_node->GetData();
                wxRealPoint* new_point = (wxRealPoint*)real_node->GetData();
                old_point->x = new_point->x;
                old_point->y = new_point->y;
                old_node = old_node->GetNext();
                real_node = real_node->GetNext();
            }
            self->ClearPointList(*real_point_list);
            delete real_point_list;
        }
    }

    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 SetAlignmentOrientation(bool isEnd, bool isHoriz);
    void SetAlignmentType(bool isEnd, int alignType);
    bool GetAlignmentOrientation(bool isEnd);
    int GetAlignmentType(bool isEnd);
    int GetAlignmentStart() const;
    int GetAlignmentEnd() const;

    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:
    %pythonAppend wxPyPolygonShape "self._setOORandCallbackInfo(PyPolygonShape)"
    
    wxPyPolygonShape();

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


    // void Create(wxList* points);
    %extend {
        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();
    %extend {
        PyObject* GetPoints() {
            wxList* list = self->GetPoints();
            return wxPy_ConvertRealPointList(list);
        }

        PyObject* GetOriginalPoints() {
            wxList* list = self->GetOriginalPoints();
            PyObject*   pyList;
            PyObject*   pyObj;
            wxObject*   wxObj;
            wxNode*     node = list->GetFirst();

            wxPyBlock_t blocked = wxPyBeginBlockThreads();
            pyList = PyList_New(0);
            while (node) {
                wxObj = node->GetData();
                pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0);
                PyList_Append(pyList, pyObj);
                node = node->GetNext();
            }
            wxPyEndBlockThreads(blocked);
            return pyList;
        }        
    }

    double GetOriginalWidth() const;
    double GetOriginalHeight() const;

    void SetOriginalWidth(double w);
    void SetOriginalHeight(double h);

    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:
    %pythonAppend wxPyTextShape "self._setOORandCallbackInfo(PyTextShape)"
    
    wxPyTextShape(double width = 0.0, double height = 0.0);

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

    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);

};
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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