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 3737 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 3756 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 4200 of file pcbnew.py.

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

void EDA_TEXT::Empty() 

Definition at line 4191 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

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 4398 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 4000 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

Return the distance between two lines of text.

Calculates the distance (pitch) between two lines of text. This
distance includes the interline distance plus room for characters like
j, {, and [. It also used for single line text, 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 4337 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 4376 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 3786 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 3772 of file pcbnew.py.

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

double
EDA_TEXT::GetTextAngle() const 

Definition at line 3861 of file pcbnew.py.

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

double
EDA_TEXT::GetTextAngleDegrees() const 

Definition at line 3871 of file pcbnew.py.

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

double
EDA_TEXT::GetTextAngleRadians() const 

Definition at line 3881 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 4302 of file pcbnew.py.

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

int
EDA_TEXT::GetTextHeight() const 

Definition at line 4131 of file pcbnew.py.

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

const wxPoint&
EDA_TEXT::GetTextPos() const 

Definition at line 4151 of file pcbnew.py.

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

const wxSize&
EDA_TEXT::GetTextSize() const 

Definition at line 4091 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 4362 of file pcbnew.py.

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

int
EDA_TEXT::GetTextWidth() const 

Definition at line 4111 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 3839 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 4010 of file pcbnew.py.

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

bool EDA_TEXT::IsBold()
const 

Definition at line 3921 of file pcbnew.py.

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

bool
EDA_TEXT::IsDefaultFormatting() const 

Definition at line 4071 of file pcbnew.py.

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

bool EDA_TEXT::IsItalic()
const 

Definition at line 3901 of file pcbnew.py.

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

bool
EDA_TEXT::IsMirrored() const 

Definition at line 3961 of file pcbnew.py.

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

bool
EDA_TEXT::IsMultilineAllowed() const 

Definition at line 3990 of file pcbnew.py.

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

bool
EDA_TEXT::IsVisible() const 

Definition at line 3941 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 4282 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 4181 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 3911 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 4040 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 4020 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 3891 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 3951 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 3971 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 3812 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 3851 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 4121 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 4141 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 4081 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 4101 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 4161 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 4171 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 3822 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 4030 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 3931 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 3800 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 4055 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 4253 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 4234 of file pcbnew.py.

Member Data Documentation

pcbnew.EDA_TEXT.this

Definition at line 3768 of file pcbnew.py.


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