KiCad PCB EDA Suite
lib_field.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <fctsys.h>
26 #include <pgm_base.h>
27 #include <gr_basic.h>
28 #include <base_struct.h>
29 #include <gr_text.h>
30 #include <kicad_string.h>
31 #include <sch_draw_panel.h>
32 #include <plotter.h>
33 #include <trigo.h>
34 #include <base_units.h>
35 #include <msgpanel.h>
36 #include <bitmaps.h>
37 #include <general.h>
38 #include <class_libentry.h>
39 #include <transform.h>
40 #include <lib_field.h>
41 #include <template_fieldnames.h>
42 
43 
44 LIB_FIELD::LIB_FIELD(LIB_PART * aParent, int idfield ) :
45  LIB_ITEM( LIB_FIELD_T, aParent )
46 {
47  Init( idfield );
48 }
49 
50 
51 LIB_FIELD::LIB_FIELD( int idfield ) :
53 {
54  Init( idfield );
55 }
56 
57 
58 LIB_FIELD::LIB_FIELD( int aID, wxString& aName ) :
60 {
61  Init( aID );
62  m_name = aName;
63 }
64 
65 
67 {
68 }
69 
70 
72 {
73  m_id = field.m_id;
74  m_name = field.m_name;
75  m_Parent = field.m_Parent;
76 
77  SetText( field.GetText() );
78  SetEffects( field );
79 
80  return *this;
81 }
82 
83 
84 void LIB_FIELD::Init( int id )
85 {
86  m_id = id;
87 
90 
91  SetTextAngle( TEXT_ANGLE_HORIZ ); // constructor already did this.
92 
93  // Fields in RAM must always have names, because we are trying to get less dependent on
94  // field ids and more dependent on names. Plus assumptions are made in the field editors.
96 
97  // By contrast, VALUE and REFERENCE are are always constructed as initially visible, and
98  // template fieldsnames' initial visibility is controlled by the template fieldname config.
99  if( id == DATASHEET || id == FOOTPRINT )
100  SetVisible( false );
101 }
102 
103 
105 {
106  int pensize = GetThickness();
107 
108  if( pensize == 0 ) // Use default values for pen size
109  {
110  if( IsBold() )
111  pensize = GetPenSizeForBold( GetTextWidth() );
112  else
113  pensize = GetDefaultLineThickness();
114  }
115 
116  // Clip pen size for small texts:
117  pensize = Clamp_Text_PenSize( pensize, GetTextSize(), IsBold() );
118  return pensize;
119 }
120 
121 
122 void LIB_FIELD::print( wxDC* aDC, const wxPoint& aOffset, void* aData,
123  const TRANSFORM& aTransform )
124 {
126  int linewidth = GetPenSize();
127  wxPoint text_pos = aTransform.TransformCoordinate( GetTextPos() ) + aOffset;
128  wxString text = aData ? *static_cast<wxString*>( aData ) : GetText();
129 
130  GRText( aDC, text_pos, color, text, GetTextAngle(), GetTextSize(), GetHorizJustify(),
131  GetVertJustify(), linewidth, IsItalic(), IsBold() );
132 }
133 
134 
135 bool LIB_FIELD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
136 {
137  // Because HitTest is mainly used to select the field return false if it is empty
138  if( GetText().IsEmpty() )
139  return false;
140 
141  // Build a temporary copy of the text for hit testing
142  EDA_TEXT tmp_text( *this );
143 
144  // Reference designator text has one or 2 additional character (displays U? or U?A)
145  if( m_id == REFERENCE )
146  {
147  wxString extended_text = tmp_text.GetText();
148  extended_text.Append('?');
149  const LIB_PART* parent = static_cast<const LIB_PART*>( m_Parent );
150 
151  if ( parent && ( parent->GetUnitCount() > 1 ) )
152  extended_text.Append('A');
153  tmp_text.SetText( extended_text );
154  }
155 
157 
158  // The text orientation may need to be flipped if the transformation matrix causes xy axes
159  // to be flipped. This simple algo works only for schematic matrix (rot 90 or/and mirror)
160  bool t1 = ( DefaultTransform.x1 != 0 ) ^ ( GetTextAngle() != 0 );
161  tmp_text.SetTextAngle( t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT );
162 
163  return tmp_text.TextHitTest( aPosition, aAccuracy );
164 }
165 
166 
168 {
169  LIB_FIELD* newfield = new LIB_FIELD( m_id );
170 
171  Copy( newfield );
172 
173  return (EDA_ITEM*) newfield;
174 }
175 
176 
177 void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
178 {
179  aTarget->m_name = m_name;
180 
181  aTarget->CopyText( *this );
182  aTarget->SetEffects( *this );
183  aTarget->SetParent( m_Parent );
184 }
185 
186 
187 int LIB_FIELD::compare( const LIB_ITEM& other ) const
188 {
189  wxASSERT( other.Type() == LIB_FIELD_T );
190 
191  const LIB_FIELD* tmp = ( LIB_FIELD* ) &other;
192 
193  if( m_id != tmp->m_id )
194  return m_id - tmp->m_id;
195 
196  int result = GetText().CmpNoCase( tmp->GetText() );
197 
198  if( result != 0 )
199  return result;
200 
201  if( GetTextPos().x != tmp->GetTextPos().x )
202  return GetTextPos().x - tmp->GetTextPos().x;
203 
204  if( GetTextPos().y != tmp->GetTextPos().y )
205  return GetTextPos().y - tmp->GetTextPos().y;
206 
207  if( GetTextWidth() != tmp->GetTextWidth() )
208  return GetTextWidth() - tmp->GetTextWidth();
209 
210  if( GetTextHeight() != tmp->GetTextHeight() )
211  return GetTextHeight() - tmp->GetTextHeight();
212 
213  return 0;
214 }
215 
216 
217 void LIB_FIELD::Offset( const wxPoint& aOffset )
218 {
219  EDA_TEXT::Offset( aOffset );
220 }
221 
222 
223 bool LIB_FIELD::Inside( EDA_RECT& rect ) const
224 {
225  return rect.Intersects( GetBoundingBox() );
226 }
227 
228 
229 void LIB_FIELD::MoveTo( const wxPoint& newPosition )
230 {
231  EDA_TEXT::SetTextPos( newPosition );
232 }
233 
234 
236 {
237  int x = GetTextPos().x;
238 
239  x -= center.x;
240  x *= -1;
241  x += center.x;
242 
243  SetTextX( x );
244 }
245 
246 
247 void LIB_FIELD::MirrorVertical( const wxPoint& center )
248 {
249  int y = GetTextPos().y;
250 
251  y -= center.y;
252  y *= -1;
253  y += center.y;
254 
255  SetTextY( y );
256 }
257 
258 
259 void LIB_FIELD::Rotate( const wxPoint& center, bool aRotateCCW )
260 {
261  int rot_angle = aRotateCCW ? -900 : 900;
262 
263  wxPoint pt = GetTextPos();
264  RotatePoint( &pt, center, rot_angle );
265  SetTextPos( pt );
266 
267  SetTextAngle( GetTextAngle() != 0.0 ? 0 : 900 );
268 }
269 
270 
271 void LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
272  const TRANSFORM& aTransform )
273 {
274  if( GetText().IsEmpty() )
275  return;
276 
277  // Calculate the text orientation, according to the component orientation/mirror
278  int orient = (int) GetTextAngle();
279 
280  if( aTransform.y1 ) // Rotate component 90 deg.
281  {
282  if( orient == TEXT_ANGLE_HORIZ )
283  orient = TEXT_ANGLE_VERT;
284  else
285  orient = TEXT_ANGLE_HORIZ;
286  }
287 
288  EDA_RECT BoundaryBox = GetBoundingBox();
289  BoundaryBox.RevertYAxis();
290 
293  wxPoint textpos = aTransform.TransformCoordinate( BoundaryBox.Centre() ) + aOffset;
294 
295  aPlotter->Text( textpos, GetDefaultColor(), GetShownText(), orient, GetTextSize(),
296  hjustify, vjustify, GetPenSize(), IsItalic(), IsBold() );
297 }
298 
299 
300 wxString LIB_FIELD::GetFullText( int unit ) const
301 {
302  if( m_id != REFERENCE )
303  return GetText();
304 
305  wxString text = GetText();
306  text << wxT( "?" );
307 
308  if( GetParent()->IsMulti() )
309  text << LIB_PART::SubReference( unit );
310 
311  return text;
312 }
313 
314 
316 {
317  /* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when
318  * calling GetTextBox() that works using top to bottom Y axis orientation.
319  */
320  EDA_RECT rect = GetTextBox( -1, -1, true, GetTextMarkupFlags() );
321  rect.RevertYAxis();
322 
323  // We are using now a bottom to top Y axis.
324  wxPoint orig = rect.GetOrigin();
325  wxPoint end = rect.GetEnd();
326 
327  RotatePoint( &orig, GetTextPos(), -GetTextAngle() );
328  RotatePoint( &end, GetTextPos(), -GetTextAngle() );
329 
330  rect.SetOrigin( orig );
331  rect.SetEnd( end );
332 
333  // We are using now a top to bottom Y axis:
334  rect.RevertYAxis();
335 
336  return rect;
337 }
338 
339 
340 void LIB_FIELD::ViewGetLayers( int aLayers[], int& aCount ) const
341 {
342  aCount = 2;
343 
344  switch( m_id )
345  {
346  case REFERENCE: aLayers[0] = LAYER_REFERENCEPART; break;
347  case VALUE: aLayers[0] = LAYER_VALUEPART; break;
348  default: aLayers[0] = LAYER_FIELDS; break;
349  }
350 
351  aLayers[1] = LAYER_SELECTION_SHADOWS;
352 }
353 
354 
356 {
357  switch( m_id )
358  {
360  case VALUE: return GetLayerColor( LAYER_VALUEPART );
361  default: return GetLayerColor( LAYER_FIELDS );
362  }
363 }
364 
365 
366 wxString LIB_FIELD::GetName( bool aTranslate ) const
367 {
368  wxString name;
369 
370  switch( m_id )
371  {
372  case REFERENCE: return aTranslate ? _( "Reference" ) : wxT( "Reference" );
373  case VALUE: return aTranslate ? _( "Value" ) : wxT( "Value" );
374  case FOOTPRINT: return aTranslate ? _( "Footprint" ) : wxT( "Footprint" );
375  case DATASHEET: return aTranslate ? _( "Datasheet" ) : wxT( "Datasheet" );
376 
377  default:
378  if( m_name.IsEmpty() )
379  {
380  return aTranslate ? wxString::Format( _( "Field%d" ), m_id )
381  : wxString::Format( wxT( "Field%d" ), m_id );
382  }
383  else
384  {
385  return m_name;
386  }
387  }
388 }
389 
390 
391 void LIB_FIELD::SetName( const wxString& aName )
392 {
393  // Mandatory field names are fixed.
394 
395  // So what? Why should the low level code be in charge of such a policy issue?
396  // Besides, m_id is a relic that is untrustworthy now.
397  if( m_id >=0 && m_id < MANDATORY_FIELDS )
398  {
399  DBG(printf( "trying to set a MANDATORY_FIELD's name\n" );)
400  return;
401  }
402 
403  if( m_name != aName )
404  {
405  m_name = aName;
406  SetModified();
407  }
408 }
409 
410 
411 wxString LIB_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const
412 {
413  return wxString::Format( _( "Field %s \"%s\"" ), GetName(), ShortenedShownText() );
414 }
415 
416 
417 void LIB_FIELD::BeginEdit( const wxPoint aPosition )
418 {
419  SetTextPos( aPosition );
420 }
421 
422 
423 void LIB_FIELD::CalcEdit( const wxPoint& aPosition )
424 {
425  SetTextPos( aPosition );
426 }
427 
428 
430 {
431  wxString msg;
432 
433  LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
434 
435  // Display style:
436  msg = GetTextStyleName();
437  aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg, MAGENTA ) );
438 
439  msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
440  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, BLUE ) );
441 
442  msg = MessageTextFromValue( aUnits, GetTextHeight(), true );
443  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, BLUE ) );
444 
445  // Display field name (ref, value ...)
446  aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName(), BROWN ) );
447 
448  // Display field text:
449  aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText(), BROWN ) );
450 }
451 
452 
454 {
455  return move_xpm;
456 }
void SetTextAngle(double aAngle)
Definition: eda_text.h:150
Definition: colors.h:57
#define TEXT_ANGLE_HORIZ
EDA_UNITS
Definition: common.h:72
wxString GetName(bool aTranslate=true) const
Returns the field name.
Definition: lib_field.cpp:366
bool IsBold() const
Definition: eda_text.h:167
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
Definition: lib_field.cpp:247
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:237
void SetModified()
Definition: base_struct.cpp:95
int compare(const LIB_ITEM &aOther) const override
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_field.cpp:187
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: lib_field.cpp:411
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:177
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:44
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:184
name of datasheet
PNG memory record (file in memory).
Definition: bitmap_def.h:29
LIB_FIELD(int idfield=2)
Definition: lib_field.cpp:51
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: lib_field.cpp:135
void GetMsgPanelInfo(EDA_UNITS aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
Definition: lib_item.cpp:52
int GetPenSizeForBold(int aTextSize)
Function GetPensizeForBold.
Definition: gr_text.cpp:66
#define TEXT_ANGLE_VERT
void CopyText(const EDA_TEXT &aSrc)
Definition: eda_text.cpp:118
Implementation of conversion functions that require both schematic and board internal units.
void CalcEdit(const wxPoint &aPosition) override
Calculate the new circle at aPosition when editing.
Definition: lib_field.cpp:423
LIB_PART * GetParent() const
Definition: lib_item.h:176
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils)
Definition: base_units.cpp:127
bool IsVisible() const
Definition: eda_text.h:170
void SetEffects(const EDA_TEXT &aSrc)
Set the text effects from another instance.
Definition: eda_text.cpp:125
Definition: colors.h:61
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
int color
Definition: DXF_plotter.cpp:61
Field object used in symbol libraries.
Definition: lib_field.h:59
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:231
void SetVisible(bool aVisible)
Definition: eda_text.h:169
double GetTextAngle() const
Definition: eda_text.h:158
TRANSFORM DefaultTransform
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
int GetThickness() const
Return the pen width.
Definition: eda_text.h:148
void GetMsgPanelInfo(EDA_UNITS aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
Definition: lib_field.cpp:429
int x1
Definition: transform.h:48
static const wxString GetDefaultFieldName(int aFieldNdx)
Function GetDefaultFieldName returns a default symbol field name for field aFieldNdx for all componen...
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: lib_field.cpp:453
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
Definition: lib_field.cpp:235
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
Definition: lib_field.cpp:229
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: lib_field.cpp:315
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
COLOR4D GetDefaultColor() override
Definition: lib_field.cpp:355
void SetName(const wxString &aName)
Set a user definable field name to aName.
Definition: lib_field.cpp:391
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size)
Definition: eda_rect.h:209
COLOR4D GetInvisibleItemColor()
Field Name Module PCB, i.e. "16DIP300".
Field Reference of part, i.e. "IC21".
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:42
The base class for drawable items used by schematic library components.
Definition: lib_item.h:60
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
Definition: lib_field.cpp:217
int GetTextHeight() const
Definition: eda_text.h:229
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
Definition: gr_text.cpp:232
void SetTextX(int aX)
Definition: eda_text.h:234
bool IsItalic() const
Definition: eda_text.h:164
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:109
int y1
Definition: transform.h:49
const wxPoint GetEnd() const
Definition: eda_rect.h:116
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
Definition: lib_field.cpp:340
#define VALUE
int GetTextMarkupFlags()
Definition: gr_text.cpp:55
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize Don't allow text to become cluttered up in its own fatness.
Definition: gr_text.cpp:81
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:183
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:111
#define NULL
int GetUnitCount() const override
For items with units, return the number of units.
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:216
const wxPoint GetOrigin() const
Definition: eda_rect.h:114
Class LIB_PIN definition.
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false, int aMarkupFlags=0) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition: eda_text.cpp:184
void SetEnd(int x, int y)
Definition: eda_rect.h:192
const wxSize & GetTextSize() const
Definition: eda_text.h:223
void Copy(LIB_FIELD *aTarget) const
Copy parameters of this field to another field.
Definition: lib_field.cpp:177
bool Inside(EDA_RECT &aRect) const override
Test if any part of the draw object is inside rectangle bounds of aRect.
Definition: lib_field.cpp:223
void Rotate(const wxPoint &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
Definition: lib_field.cpp:259
const BITMAP_OPAQUE move_xpm[1]
Definition: move.cpp:59
void Plot(PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) override
Plot the draw item using the plot object.
Definition: lib_field.cpp:271
Define a library symbol object.
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: lib_field.cpp:167
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:163
LIB_FIELD & operator=(const LIB_FIELD &field)
Definition: lib_field.cpp:71
void Init(int idfield)
Object constructor initialization helper.
Definition: lib_field.cpp:84
void print(wxDC *aDC, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
Print the field.
Definition: lib_field.cpp:122
void GRText(wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function GRText Draw a graphic text (like module texts)
Definition: gr_text.cpp:143
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:51
void SetTextWidth(int aWidth)
Definition: eda_text.h:225
int m_id
Definition: lib_field.h:61
Base plotter engine class.
Definition: plotter.h:103
void BeginEdit(const wxPoint aStartPoint) override
Begin drawing a component library draw item at aPosition.
Definition: lib_field.cpp:417
int GetTextWidth() const
Definition: eda_text.h:226
see class PGM_BASE
wxString GetTextStyleName()
Definition: eda_text.cpp:445
const char * name
Definition: DXF_plotter.cpp:60
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define _(s)
Definition: 3d_actions.cpp:31
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:300
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:336
static wxString SubReference(int aUnit, bool aAddSeparator=true)
void SetTextHeight(int aHeight)
Definition: eda_text.h:228
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
wxPoint Centre() const
Definition: eda_rect.h:62
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
const wxPoint & GetTextPos() const
Definition: eda_text.h:232
int GetPenSize() const override
Definition: lib_field.cpp:104
#define DBG(x)
Definition: fctsys.h:33
virtual wxString GetShownText() const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:129
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
wxString m_name
Name (not the field text value itself, that is .m_Text)
Definition: lib_field.h:62
Message panel definition file.
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
void SetTextY(int aY)
Definition: eda_text.h:235
int GetDefaultTextSize()
Default size for text in general.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62