KiCAD pcbnew scripting
Public Member Functions | Public Attributes | List of all members
pcbnew.EDA_TEXT Class Reference
Inheritance diagram for pcbnew.EDA_TEXT:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args)
 
def GetText (self)
 
def GetShownText (self)
 
def ShortenedShownText (self)
 
def SetText (self, aText)
 
def SetThickness (self, aNewThickness)
 
def GetThickness (self)
 
def SetTextAngle (self, aAngle)
 
def GetTextAngle (self)
 
def GetTextAngleDegrees (self)
 
def GetTextAngleRadians (self)
 
def SetItalic (self, isItalic)
 
def IsItalic (self)
 
def SetBold (self, aBold)
 
def IsBold (self)
 
def SetVisible (self, aVisible)
 
def IsVisible (self)
 
def SetMirrored (self, isMirrored)
 
def IsMirrored (self)
 
def SetMultilineAllowed (self, aAllow)
 
def IsMultilineAllowed (self)
 
def GetHorizJustify (self)
 
def GetVertJustify (self)
 
def SetHorizJustify (self, aType)
 
def SetVertJustify (self, aType)
 
def SetEffects (self, aSrc)
 
def SwapEffects (self, aTradingPartner)
 
def IsDefaultFormatting (self)
 
def SetTextSize (self, aNewSize)
 
def GetTextSize (self)
 
def SetTextWidth (self, aWidth)
 
def GetTextWidth (self)
 
def SetTextHeight (self, aHeight)
 
def GetTextHeight (self)
 
def SetTextPos (self, aPoint)
 
def GetTextPos (self)
 
def SetTextX (self, aX)
 
def SetTextY (self, aY)
 
def Offset (self, aOffset)
 
def Empty (self)
 
def Draw (self, args)
 
def TransformTextShapeToSegmentList (self, aCornerBuffer)
 
def TextHitTest (self, args)
 
def LenSize (self, aLine)
 
def GetTextBox
 
def GetInterline
 
def GetTextStyleName (self)
 
def GetPositionsOfLinesOfMultilineText (self, aPositions, aLineCount)
 
def Format (self, aFormatter, aNestLevel, aControlBits)
 

Public Attributes

 this
 

Detailed Description

Class EDA_TEXT is a mix-in class (via multiple inheritance) that
handles texts such as labels, parts, components, or footprints.

Because it's a mix-in class, care is used to provide function names
(accessors) that to not collide with function names likely to be seen
in the combined derived classes.

C++ includes: eda_text.h 

Definition at line 3685 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.EDA_TEXT.__init__ (   self,
  args 
)
__init__(EDA_TEXT self, wxString text) -> EDA_TEXT
__init__(EDA_TEXT self) -> EDA_TEXT

EDA_TEXT::EDA_TEXT(const
wxString &text=wxEmptyString) 

Definition at line 3704 of file pcbnew.py.

Member Function Documentation

def pcbnew.EDA_TEXT.Draw (   self,
  args 
)
Draw(EDA_TEXT self, EDA_RECT aClipBox, wxDC * aDC, wxPoint aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode=FILLED, COLOR4D aAnchor_color)
Draw(EDA_TEXT self, EDA_RECT aClipBox, wxDC * aDC, wxPoint aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode=FILLED)
Draw(EDA_TEXT self, EDA_RECT aClipBox, wxDC * aDC, wxPoint aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode)

void EDA_TEXT::Draw(EDA_RECT
*aClipBox, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor,
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aDisplay_mode=FILLED, COLOR4D
aAnchor_color=COLOR4D::UNSPECIFIED)

Function Draw.

Parameters:
-----------

aClipBox:  = the clipping rect, or NULL if no clipping

aDC:  = the current Device Context

aOffset:  = draw offset (usually (0,0))

aColor:  = text color

aDrawMode:  = GR_OR, GR_XOR.., -1 to use the current mode.

aDisplay_mode:  = FILLED or SKETCH

aAnchor_color:  = anchor color ( COLOR4D::UNSPECIFIED = do not draw
anchor ). 

Definition at line 4148 of file pcbnew.py.

def pcbnew.EDA_TEXT.Empty (   self)
Empty(EDA_TEXT self)

void EDA_TEXT::Empty() 

Definition at line 4139 of file pcbnew.py.

def pcbnew.EDA_TEXT.Format (   self,
  aFormatter,
  aNestLevel,
  aControlBits 
)
Format(EDA_TEXT self, OUTPUTFORMATTER * aFormatter, int aNestLevel, int aControlBits)

void
EDA_TEXT::Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int
aControlBits) const  throw ( IO_ERROR ) Function Format outputs the
object to aFormatter in s-expression form.

Parameters:
-----------

aFormatter:  The OUTPUTFORMATTER object to write to.

aNestLevel:  The indentation next level.

aControlBits:  The control bit definition for object specific
formatting.

Parameters:
-----------

???:  on write error. 

Definition at line 4347 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetHorizJustify (   self)
GetHorizJustify(EDA_TEXT self) -> EDA_TEXT_HJUSTIFY_T

EDA_TEXT_HJUSTIFY_T
EDA_TEXT::GetHorizJustify() const 

Definition at line 3948 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetInterline (   self,
  aTextThickness = -1 
)
GetInterline(EDA_TEXT self, int aTextThickness=-1) -> int
GetInterline(EDA_TEXT self) -> int

int
EDA_TEXT::GetInterline(int aTextThickness=-1) const

Function GetInterline return the distance between 2 text lines has
meaning only for multiline texts.

Calculates the distance (pitch) between 2 text lines the distance
includes the interline + room for chars like j { and [ Is used for
multiline texts, but also for single line texts, to calculate the text
bounding box

Parameters:
-----------

aTextThickness:  Overrides the current thickness when greater than 0.
this is needed when the current m_Thickness is 0 and a default line
thickness is used 

Definition at line 4285 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetPositionsOfLinesOfMultilineText (   self,
  aPositions,
  aLineCount 
)
GetPositionsOfLinesOfMultilineText(EDA_TEXT self, wxPoint_Vector aPositions, int aLineCount)

void EDA_TEXT::GetPositionsOfLinesOfMultilineText(std::vector< wxPoint
> &aPositions, int aLineCount) const

Function GetPositionsOfLinesOfMultilineText Populates aPositions with
the position of each line of a multiline text, according to the
vertical justification and the rotation of the whole text.

Parameters:
-----------

aPositions:  is the list to populate by the wxPoint positions

aLineCount:  is the number of lines (not recalculated here for
efficiency reasons 

Definition at line 4325 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetShownText (   self)
GetShownText(EDA_TEXT self) -> wxString

virtual wxString
EDA_TEXT::GetShownText() const

Returns the string actually shown after processing of the base text.

Default is no processing 

Definition at line 3734 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetText (   self)
GetText(EDA_TEXT self) -> wxString

const wxString&
EDA_TEXT::GetText() const

Function GetText returns the string associated with the text object.

a const wxString reference containing the string of the item. 

Definition at line 3720 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextAngle (   self)
GetTextAngle(EDA_TEXT self) -> double

double
EDA_TEXT::GetTextAngle() const 

Definition at line 3809 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextAngleDegrees (   self)
GetTextAngleDegrees(EDA_TEXT self) -> double

double
EDA_TEXT::GetTextAngleDegrees() const 

Definition at line 3819 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextAngleRadians (   self)
GetTextAngleRadians(EDA_TEXT self) -> double

double
EDA_TEXT::GetTextAngleRadians() const 

Definition at line 3829 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextBox (   self,
  aLine = -1,
  aThickness = -1,
  aInvertY = False 
)
GetTextBox(EDA_TEXT self, int aLine=-1, int aThickness=-1, bool aInvertY=False) -> EDA_RECT
GetTextBox(EDA_TEXT self, int aLine=-1, int aThickness=-1) -> EDA_RECT
GetTextBox(EDA_TEXT self, int aLine=-1) -> EDA_RECT
GetTextBox(EDA_TEXT self) -> EDA_RECT

EDA_RECT
EDA_TEXT::GetTextBox(int aLine=-1, int aThickness=-1, bool
aInvertY=false) const

Function GetTextBox useful in multiline texts to calculate the full
text or a line area (for zones filling, locate functions....)

the rect containing the line of text (i.e. the position and the size
of one line) this rectangle is calculated for 0 orient text. If
orientation is not 0 the rect must be rotated to match the physical
area

Parameters:
-----------

aLine:  The line of text to consider. for single line text, aLine is
unused If aLine == -1, the full area (considering all lines) is
returned

aThickness:  Overrides the current penwidth when greater than 0. This
is needed when the current penwidth is 0 and a default penwidth is
used.

aInvertY:  Invert the Y axis when calculating bounding box. 

Definition at line 4250 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextHeight (   self)
GetTextHeight(EDA_TEXT self) -> int

int
EDA_TEXT::GetTextHeight() const 

Definition at line 4079 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextPos (   self)
GetTextPos(EDA_TEXT self) -> wxPoint

const wxPoint&
EDA_TEXT::GetTextPos() const 

Definition at line 4099 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextSize (   self)
GetTextSize(EDA_TEXT self) -> wxSize

const wxSize&
EDA_TEXT::GetTextSize() const 

Definition at line 4039 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextStyleName (   self)
GetTextStyleName(EDA_TEXT self) -> wxString

wxString
EDA_TEXT::GetTextStyleName()

Function GetTextStyleName.

a wxString with the style name( Normal, Italic, Bold, Bold+Italic) 

Definition at line 4311 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetTextWidth (   self)
GetTextWidth(EDA_TEXT self) -> int

int
EDA_TEXT::GetTextWidth() const 

Definition at line 4059 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetThickness (   self)
GetThickness(EDA_TEXT self) -> int

int
EDA_TEXT::GetThickness() const

Function GetThickness returns pen width. 

Definition at line 3787 of file pcbnew.py.

def pcbnew.EDA_TEXT.GetVertJustify (   self)
GetVertJustify(EDA_TEXT self) -> EDA_TEXT_VJUSTIFY_T

EDA_TEXT_VJUSTIFY_T
EDA_TEXT::GetVertJustify() const 

Definition at line 3958 of file pcbnew.py.

def pcbnew.EDA_TEXT.IsBold (   self)
IsBold(EDA_TEXT self) -> bool

bool EDA_TEXT::IsBold()
const 

Definition at line 3869 of file pcbnew.py.

def pcbnew.EDA_TEXT.IsDefaultFormatting (   self)
IsDefaultFormatting(EDA_TEXT self) -> bool

bool
EDA_TEXT::IsDefaultFormatting() const 

Definition at line 4019 of file pcbnew.py.

def pcbnew.EDA_TEXT.IsItalic (   self)
IsItalic(EDA_TEXT self) -> bool

bool EDA_TEXT::IsItalic()
const 

Definition at line 3849 of file pcbnew.py.

def pcbnew.EDA_TEXT.IsMirrored (   self)
IsMirrored(EDA_TEXT self) -> bool

bool
EDA_TEXT::IsMirrored() const 

Definition at line 3909 of file pcbnew.py.

def pcbnew.EDA_TEXT.IsMultilineAllowed (   self)
IsMultilineAllowed(EDA_TEXT self) -> bool

bool
EDA_TEXT::IsMultilineAllowed() const 

Definition at line 3938 of file pcbnew.py.

def pcbnew.EDA_TEXT.IsVisible (   self)
IsVisible(EDA_TEXT self) -> bool

bool
EDA_TEXT::IsVisible() const 

Definition at line 3889 of file pcbnew.py.

def pcbnew.EDA_TEXT.LenSize (   self,
  aLine 
)
LenSize(EDA_TEXT self, wxString aLine) -> int

int EDA_TEXT::LenSize(const
wxString &aLine) const

Function LenSize.

the text length in internal units

Parameters:
-----------

aLine:  : the line of text to consider. For single line text, this
parameter is always m_Text 

Definition at line 4230 of file pcbnew.py.

def pcbnew.EDA_TEXT.Offset (   self,
  aOffset 
)
Offset(EDA_TEXT self, wxPoint aOffset)

void EDA_TEXT::Offset(const
wxPoint &aOffset) 

Definition at line 4129 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetBold (   self,
  aBold 
)
SetBold(EDA_TEXT self, bool aBold)

void EDA_TEXT::SetBold(bool
aBold) 

Definition at line 3859 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetEffects (   self,
  aSrc 
)
SetEffects(EDA_TEXT self, EDA_TEXT aSrc)

void
EDA_TEXT::SetEffects(const EDA_TEXT &aSrc)

Function SetEffects sets the text effects from another instance.

( TEXT_EFFECTS is not exposed in the public API, but includes
everything except the actual text string itself.) 

Definition at line 3988 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetHorizJustify (   self,
  aType 
)
SetHorizJustify(EDA_TEXT self, EDA_TEXT_HJUSTIFY_T aType)

void
EDA_TEXT::SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType) 

Definition at line 3968 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetItalic (   self,
  isItalic 
)
SetItalic(EDA_TEXT self, bool isItalic)

void
EDA_TEXT::SetItalic(bool isItalic) 

Definition at line 3839 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetMirrored (   self,
  isMirrored 
)
SetMirrored(EDA_TEXT self, bool isMirrored)

void
EDA_TEXT::SetMirrored(bool isMirrored) 

Definition at line 3899 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetMultilineAllowed (   self,
  aAllow 
)
SetMultilineAllowed(EDA_TEXT self, bool aAllow)

void
EDA_TEXT::SetMultilineAllowed(bool aAllow)

Function SetMultiLineAllowed.

Parameters:
-----------

aAllow:  true if ok to use multiline option, false if ok to use only
single line text. (Single line is faster in calculations than
multiline.) 

Definition at line 3919 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetText (   self,
  aText 
)
SetText(EDA_TEXT self, wxString aText)

virtual void
EDA_TEXT::SetText(const wxString &aText) 

Definition at line 3760 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextAngle (   self,
  aAngle 
)
SetTextAngle(EDA_TEXT self, double aAngle)

void
EDA_TEXT::SetTextAngle(double aAngle) 

Definition at line 3799 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextHeight (   self,
  aHeight 
)
SetTextHeight(EDA_TEXT self, int aHeight)

void
EDA_TEXT::SetTextHeight(int aHeight) 

Definition at line 4069 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextPos (   self,
  aPoint 
)
SetTextPos(EDA_TEXT self, wxPoint aPoint)

void
EDA_TEXT::SetTextPos(const wxPoint &aPoint) 

Definition at line 4089 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextSize (   self,
  aNewSize 
)
SetTextSize(EDA_TEXT self, wxSize aNewSize)

void
EDA_TEXT::SetTextSize(const wxSize &aNewSize) 

Definition at line 4029 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextWidth (   self,
  aWidth 
)
SetTextWidth(EDA_TEXT self, int aWidth)

void
EDA_TEXT::SetTextWidth(int aWidth) 

Definition at line 4049 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextX (   self,
  aX 
)
SetTextX(EDA_TEXT self, int aX)

void
EDA_TEXT::SetTextX(int aX) 

Definition at line 4109 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetTextY (   self,
  aY 
)
SetTextY(EDA_TEXT self, int aY)

void
EDA_TEXT::SetTextY(int aY) 

Definition at line 4119 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetThickness (   self,
  aNewThickness 
)
SetThickness(EDA_TEXT self, int aNewThickness)

void
EDA_TEXT::SetThickness(int aNewThickness)

Function SetThickness sets pen width.

Parameters:
-----------

aNewThickness:  is the new pen width 

Definition at line 3770 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetVertJustify (   self,
  aType 
)
SetVertJustify(EDA_TEXT self, EDA_TEXT_VJUSTIFY_T aType)

void
EDA_TEXT::SetVertJustify(EDA_TEXT_VJUSTIFY_T aType) 

Definition at line 3978 of file pcbnew.py.

def pcbnew.EDA_TEXT.SetVisible (   self,
  aVisible 
)
SetVisible(EDA_TEXT self, bool aVisible)

void
EDA_TEXT::SetVisible(bool aVisible) 

Definition at line 3879 of file pcbnew.py.

def pcbnew.EDA_TEXT.ShortenedShownText (   self)
ShortenedShownText(EDA_TEXT self) -> wxString

wxString
EDA_TEXT::ShortenedShownText() const

Returns a shortened version (max 15 characters) of the shown text. 

Definition at line 3748 of file pcbnew.py.

def pcbnew.EDA_TEXT.SwapEffects (   self,
  aTradingPartner 
)
SwapEffects(EDA_TEXT self, EDA_TEXT aTradingPartner)

void
EDA_TEXT::SwapEffects(EDA_TEXT &aTradingPartner)

Function SwapEffects swaps the text effects of the two involved
instances.

(TEXT_EFECTS is not exposed in the public API, but includes everything
except the actual text string itself.) 

Definition at line 4003 of file pcbnew.py.

def pcbnew.EDA_TEXT.TextHitTest (   self,
  args 
)
TextHitTest(EDA_TEXT self, wxPoint aPoint, int aAccuracy=0) -> bool
TextHitTest(EDA_TEXT self, wxPoint aPoint) -> bool
TextHitTest(EDA_TEXT self, EDA_RECT aRect, bool aContains=False, int aAccuracy=0) -> bool
TextHitTest(EDA_TEXT self, EDA_RECT aRect, bool aContains=False) -> bool
TextHitTest(EDA_TEXT self, EDA_RECT aRect) -> bool

bool
EDA_TEXT::TextHitTest(const EDA_RECT &aRect, bool aContains=false, int
aAccuracy=0) const

Function TextHitTest (overloaded) Tests if object bounding box is
contained within or intersects aRect.

Parameters:
-----------

aRect:  - Rect to test against.

aContains:  - Test for containment instead of intersection if true.

aAccuracy:  - Amount to inflate the bounding box.

bool - true if a hit, else false 

Definition at line 4201 of file pcbnew.py.

def pcbnew.EDA_TEXT.TransformTextShapeToSegmentList (   self,
  aCornerBuffer 
)
TransformTextShapeToSegmentList(EDA_TEXT self, wxPoint_Vector aCornerBuffer)

void EDA_TEXT::TransformTextShapeToSegmentList(std::vector< wxPoint >
&aCornerBuffer) const

Convert the text shape to a list of segment each segment is stored as
2 wxPoints: the starting point and the ending point there are
therefore 2*n points.

Parameters:
-----------

aCornerBuffer:  = a buffer to store the polygon 

Definition at line 4182 of file pcbnew.py.

Member Data Documentation

pcbnew.EDA_TEXT.this

Definition at line 3716 of file pcbnew.py.


The documentation for this class was generated from the following file: