//--------------------------------------------------------------------------- // This file is generated by wxPython's SIP generator. Do not edit by hand. // // Copyright: (c) 2018 by Total Control Software // License: wxWindows License // // This file will be included by _core.sip // //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- enum wxPenStyle { wxPENSTYLE_INVALID, wxPENSTYLE_SOLID, wxPENSTYLE_DOT, wxPENSTYLE_LONG_DASH, wxPENSTYLE_SHORT_DASH, wxPENSTYLE_DOT_DASH, wxPENSTYLE_USER_DASH, wxPENSTYLE_TRANSPARENT, wxPENSTYLE_STIPPLE_MASK_OPAQUE, wxPENSTYLE_STIPPLE_MASK, wxPENSTYLE_STIPPLE, wxPENSTYLE_BDIAGONAL_HATCH, wxPENSTYLE_CROSSDIAG_HATCH, wxPENSTYLE_FDIAGONAL_HATCH, wxPENSTYLE_CROSS_HATCH, wxPENSTYLE_HORIZONTAL_HATCH, wxPENSTYLE_VERTICAL_HATCH, wxPENSTYLE_FIRST_HATCH, wxPENSTYLE_LAST_HATCH }; enum wxPenJoin { wxJOIN_INVALID, wxJOIN_BEVEL, wxJOIN_MITER, wxJOIN_ROUND }; enum wxPenCap { wxCAP_INVALID, wxCAP_ROUND, wxCAP_PROJECTING, wxCAP_BUTT }; class wxPen : wxGDIObject { %Docstring Pen() Pen(colour, width=1, style=PENSTYLE_SOLID) Pen(pen) A pen is a drawing tool for drawing outlines. %End %TypeHeaderCode #include %End %TypeHeaderCode #include "arrayholder.h" %End public: wxPen(); wxPen( const wxColour & colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); %PreMethodCode if (!wxPyCheckForApp()) return NULL; %End wxPen( const wxPen & pen ); %PreMethodCode if (!wxPyCheckForApp()) return NULL; %End ~wxPen(); void SetColour( wxColour & colour ); %Docstring SetColour(colour) SetColour(red, green, blue) The pen's colour is changed to the given colour. %End void SetColour( unsigned char red, unsigned char green, unsigned char blue ); wxPenCap GetCap() const; %Docstring GetCap() -> PenCap Returns the pen cap style, which may be one of wxCAP_ROUND, wxCAP_PROJECTING and wxCAP_BUTT. %End wxColour GetColour() const; %Docstring GetColour() -> Colour Returns a reference to the pen colour. %End wxArrayInt* GetDashes( ) const /Factory/; %Docstring GetDashes() -> ArrayInt Gets an array of dashes (defined as char in X, DWORD under Windows). %End %MethodCode PyErr_Clear(); Py_BEGIN_ALLOW_THREADS sipRes = _wxPen_GetDashes(sipCpp); Py_END_ALLOW_THREADS if (PyErr_Occurred()) sipIsErr = 1; %End %TypeCode wxArrayInt* _wxPen_GetDashes(const wxPen* self) { wxArrayInt* arr = new wxArrayInt; wxDash* dashes; int num = self->GetDashes(&dashes); for (int i=0; iAdd(dashes[i]); return arr; } %End wxPenJoin GetJoin() const; %Docstring GetJoin() -> PenJoin Returns the pen join style, which may be one of wxJOIN_BEVEL, wxJOIN_ROUND and wxJOIN_MITER. %End wxBitmap * GetStipple() const; %Docstring GetStipple() -> Bitmap Gets a pointer to the stipple bitmap. %End wxPenStyle GetStyle() const; %Docstring GetStyle() -> PenStyle Returns the pen style. %End int GetWidth() const; %Docstring GetWidth() -> int Returns the pen width. %End bool IsOk() const; %Docstring IsOk() -> bool Returns true if the pen is initialised. %End bool IsNonTransparent() const; %Docstring IsNonTransparent() -> bool Returns true if the pen is a valid non-transparent pen. %End bool IsTransparent() const; %Docstring IsTransparent() -> bool Returns true if the pen is transparent. %End void SetCap( wxPenCap capStyle ); %Docstring SetCap(capStyle) Sets the pen cap style, which may be one of wxCAP_ROUND, wxCAP_PROJECTING and wxCAP_BUTT. %End void SetDashes( const wxArrayInt& dashes ); %Docstring SetDashes(dashes) Associates an array of dash values (defined as char in X, DWORD under Windows) with the pen. %End %MethodCode size_t len = dashes->GetCount(); wxDashCArrayHolder* holder = new wxDashCArrayHolder; holder->m_array = new wxDash[len]; for (int idx=0; idxm_array[idx] = (*dashes)[idx]; } // Make a PyObject for the holder, and transfer its ownership to self. PyObject* pyHolder = sipConvertFromNewType( (void*)holder, sipType_wxDashCArrayHolder, (PyObject*)sipSelf); Py_DECREF(pyHolder); sipCpp->SetDashes(len, holder->m_array); %End void SetJoin( wxPenJoin join_style ); %Docstring SetJoin(join_style) Sets the pen join style, which may be one of wxJOIN_BEVEL, wxJOIN_ROUND and wxJOIN_MITER. %End void SetStipple( const wxBitmap & stipple ); %Docstring SetStipple(stipple) Sets the bitmap for stippling. %End void SetStyle( wxPenStyle style ); %Docstring SetStyle(style) Set the pen style. %End void SetWidth( int width ); %Docstring SetWidth(width) Sets the pen width. %End bool operator!=( const wxPen & pen ) const; bool operator==( const wxPen & pen ) const; public: %Property(name=Cap, get=GetCap, set=SetCap) %Property(name=Colour, get=GetColour, set=SetColour) %Property(name=Dashes, get=GetDashes, set=SetDashes) %Property(name=Join, get=GetJoin, set=SetJoin) %Property(name=Stipple, get=GetStipple, set=SetStipple) %Property(name=Style, get=GetStyle, set=SetStyle) %Property(name=Width, get=GetWidth, set=SetWidth) void _copyFrom(const wxPen* other); %Docstring _copyFrom(other) For internal use only. %End %MethodCode PyErr_Clear(); Py_BEGIN_ALLOW_THREADS _wxPen__copyFrom(sipCpp, other); Py_END_ALLOW_THREADS if (PyErr_Occurred()) sipIsErr = 1; %End %TypeCode void _wxPen__copyFrom(wxPen* self, const wxPen* other) { *self = *other; } %End }; // end of class wxPen class wxPenList { %Docstring PenList() There is only one instance of this class: wxThePenList. %End %TypeHeaderCode #include %End public: wxPenList(); wxPen * FindOrCreatePen( const wxColour & colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); %Docstring FindOrCreatePen(colour, width=1, style=PENSTYLE_SOLID) -> Pen Finds a pen with the specified attributes and returns it, else creates a new pen, adds it to the pen list, and returns it. %End }; // end of class wxPenList wxPen wxNullPen; %Extract(id=pycode_core) # These stock pens will be initialized when the wx.App object is created. RED_PEN = Pen() BLUE_PEN = Pen() CYAN_PEN = Pen() GREEN_PEN = Pen() YELLOW_PEN = Pen() BLACK_PEN = Pen() WHITE_PEN = Pen() TRANSPARENT_PEN = Pen() BLACK_DASHED_PEN = Pen() GREY_PEN = Pen() MEDIUM_GREY_PEN = Pen() LIGHT_GREY_PEN = Pen() %End %Extract(id=pycode_core) wx.SOLID = int(wx.PENSTYLE_SOLID) wx.DOT = int(wx.PENSTYLE_DOT) wx.LONG_DASH = int(wx.PENSTYLE_LONG_DASH) wx.SHORT_DASH = int(wx.PENSTYLE_SHORT_DASH) wx.DOT_DASH = int(wx.PENSTYLE_DOT_DASH) wx.USER_DASH = int(wx.PENSTYLE_USER_DASH) wx.TRANSPARENT = int(wx.PENSTYLE_TRANSPARENT) %End //---------------------------------------------------------------------------