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-2021 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 <pgm_base.h>
26 #include <eda_item.h>
27 #include <gr_text.h>
28 #include <kicad_string.h>
29 #include <sch_draw_panel.h>
30 #include <eda_draw_frame.h>
31 #include <plotter.h>
32 #include <trigo.h>
33 #include <base_units.h>
34 #include <widgets/msgpanel.h>
35 #include <bitmaps.h>
36 #include <general.h>
37 #include <lib_symbol.h>
38 #include <transform.h>
39 #include <lib_field.h>
40 #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, const 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 
88  SetTextAngle( TEXT_ANGLE_HORIZ ); // constructor already did this.
89 
90  // Fields in RAM must always have names, because we are trying to get less dependent on
91  // field ids and more dependent on names. Plus assumptions are made in the field editors.
93 
94  // By contrast, VALUE and REFERENCE are are always constructed as initially visible, and
95  // template fieldsnames' initial visibility is controlled by the template fieldname config.
96  if( id == DATASHEET_FIELD || id == FOOTPRINT_FIELD )
97  SetVisible( false );
98 }
99 
100 
102 {
103  return GetEffectiveTextPenWidth();
104 }
105 
106 
107 void LIB_FIELD::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
108  const TRANSFORM& aTransform )
109 {
110  wxDC* DC = aSettings->GetPrintDC();
112  int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
113  wxPoint text_pos = aTransform.TransformCoordinate( GetTextPos() ) + aOffset;
114  wxString text = aData ? *static_cast<wxString*>( aData ) : GetText();
115 
116  GRText( DC, text_pos, color, text, GetTextAngle(), GetTextSize(), GetHorizJustify(),
117  GetVertJustify(), penWidth, IsItalic(), IsBold() );
118 }
119 
120 
121 bool LIB_FIELD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
122 {
123  // Because HitTest is mainly used to select the field return false if it is empty
124  if( GetText().IsEmpty() )
125  return false;
126 
127  // Build a temporary copy of the text for hit testing
128  EDA_TEXT tmp_text( *this );
129 
130  // Reference designator text has one or 2 additional character (displays U? or U?A)
131  if( m_id == REFERENCE_FIELD )
132  {
133  const LIB_PART* parent = dynamic_cast<const LIB_PART*>( m_parent );
134 
135  wxString extended_text = tmp_text.GetText();
136  extended_text.Append('?');
137 
138  if ( parent && parent->GetUnitCount() > 1 )
139  extended_text.Append('A');
140 
141  tmp_text.SetText( extended_text );
142  }
143 
145 
146  // The text orientation may need to be flipped if the transformation matrix causes xy axes
147  // to be flipped. This simple algo works only for schematic matrix (rot 90 or/and mirror)
148  bool t1 = ( DefaultTransform.x1 != 0 ) ^ ( GetTextAngle() != 0 );
149  tmp_text.SetTextAngle( t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT );
150 
151  return tmp_text.TextHitTest( aPosition, aAccuracy );
152 }
153 
154 
156 {
157  LIB_FIELD* newfield = new LIB_FIELD( m_id );
158 
159  Copy( newfield );
160 
161  return (EDA_ITEM*) newfield;
162 }
163 
164 
165 void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
166 {
167  aTarget->m_name = m_name;
168 
169  aTarget->CopyText( *this );
170  aTarget->SetEffects( *this );
171  aTarget->SetParent( m_parent );
172 }
173 
174 
175 int LIB_FIELD::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
176 {
177  wxASSERT( aOther.Type() == LIB_FIELD_T );
178 
179  int retv = LIB_ITEM::compare( aOther, aCompareFlags );
180 
181  if( retv )
182  return retv;
183 
184  const LIB_FIELD* tmp = ( LIB_FIELD* ) &aOther;
185 
186  if( m_id != tmp->m_id )
187  return m_id - tmp->m_id;
188 
189  int result = GetText().CmpNoCase( tmp->GetText() );
190 
191  if( result != 0 )
192  return result;
193 
194  if( GetTextPos().x != tmp->GetTextPos().x )
195  return GetTextPos().x - tmp->GetTextPos().x;
196 
197  if( GetTextPos().y != tmp->GetTextPos().y )
198  return GetTextPos().y - tmp->GetTextPos().y;
199 
200  if( GetTextWidth() != tmp->GetTextWidth() )
201  return GetTextWidth() - tmp->GetTextWidth();
202 
203  if( GetTextHeight() != tmp->GetTextHeight() )
204  return GetTextHeight() - tmp->GetTextHeight();
205 
206  return 0;
207 }
208 
209 
210 void LIB_FIELD::Offset( const wxPoint& aOffset )
211 {
212  EDA_TEXT::Offset( aOffset );
213 }
214 
215 
216 void LIB_FIELD::MoveTo( const wxPoint& newPosition )
217 {
218  EDA_TEXT::SetTextPos( newPosition );
219 }
220 
221 
222 void LIB_FIELD::MirrorHorizontal( const wxPoint& center )
223 {
224  int x = GetTextPos().x;
225 
226  x -= center.x;
227  x *= -1;
228  x += center.x;
229 
230  SetTextX( x );
231 }
232 
233 
234 void LIB_FIELD::MirrorVertical( const wxPoint& center )
235 {
236  int y = GetTextPos().y;
237 
238  y -= center.y;
239  y *= -1;
240  y += center.y;
241 
242  SetTextY( y );
243 }
244 
245 
246 void LIB_FIELD::Rotate( const wxPoint& center, bool aRotateCCW )
247 {
248  int rot_angle = aRotateCCW ? -900 : 900;
249 
250  wxPoint pt = GetTextPos();
251  RotatePoint( &pt, center, rot_angle );
252  SetTextPos( pt );
253 
254  SetTextAngle( GetTextAngle() != 0.0 ? 0 : 900 );
255 }
256 
257 
258 void LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
259  const TRANSFORM& aTransform )
260 {
261  if( GetText().IsEmpty() )
262  return;
263 
264  // Calculate the text orientation, according to the component orientation/mirror
265  int orient = (int) GetTextAngle();
266 
267  if( aTransform.y1 ) // Rotate component 90 deg.
268  {
269  if( orient == TEXT_ANGLE_HORIZ )
270  orient = TEXT_ANGLE_VERT;
271  else
272  orient = TEXT_ANGLE_HORIZ;
273  }
274 
275  EDA_RECT BoundaryBox = GetBoundingBox();
276  BoundaryBox.RevertYAxis();
277 
280  wxPoint textpos = aTransform.TransformCoordinate( BoundaryBox.Centre() ) + aOffset;
281 
282  COLOR4D color;
283 
284  if( aPlotter->GetColorMode() )
286  else
288 
289  int penWidth = std::max( GetPenWidth(),aPlotter->RenderSettings()->GetMinPenWidth() );
290 
291  aPlotter->Text( textpos, color, GetShownText(), orient, GetTextSize(), hjustify, vjustify,
292  penWidth, IsItalic(), IsBold() );
293 }
294 
295 
296 wxString LIB_FIELD::GetFullText( int unit ) const
297 {
298  if( m_id != REFERENCE_FIELD )
299  return GetText();
300 
301  wxString text = GetText();
302  text << wxT( "?" );
303 
304  wxCHECK( GetParent(), text );
305 
306  if( GetParent()->IsMulti() )
307  text << LIB_PART::SubReference( unit );
308 
309  return text;
310 }
311 
312 
314 {
315  /* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when
316  * calling GetTextBox() that works using top to bottom Y axis orientation.
317  */
318  EDA_RECT rect = GetTextBox( -1, true );
319  rect.RevertYAxis();
320 
321  // We are using now a bottom to top Y axis.
322  wxPoint orig = rect.GetOrigin();
323  wxPoint end = rect.GetEnd();
324 
325  RotatePoint( &orig, GetTextPos(), -GetTextAngle() );
326  RotatePoint( &end, GetTextPos(), -GetTextAngle() );
327 
328  rect.SetOrigin( orig );
329  rect.SetEnd( end );
330 
331  // We are using now a top to bottom Y axis:
332  rect.RevertYAxis();
333 
334  return rect;
335 }
336 
337 
338 void LIB_FIELD::ViewGetLayers( int aLayers[], int& aCount ) const
339 {
340  aCount = 2;
341 
342  switch( m_id )
343  {
344  case REFERENCE_FIELD: aLayers[0] = LAYER_REFERENCEPART; break;
345  case VALUE_FIELD: aLayers[0] = LAYER_VALUEPART; break;
346  default: aLayers[0] = LAYER_FIELDS; break;
347  }
348 
349  aLayers[1] = LAYER_SELECTION_SHADOWS;
350 }
351 
352 
354 {
355  switch( m_id )
356  {
358  case VALUE_FIELD: return LAYER_VALUEPART;
359  default: return LAYER_FIELDS;
360  }
361 }
362 
363 
364 wxString LIB_FIELD::GetName( bool aUseDefaultName ) const
365 {
366  if( m_name.IsEmpty() && aUseDefaultName )
368 
369  return m_name;
370 }
371 
372 
374 {
375  switch( m_id )
376  {
377  case REFERENCE_FIELD: return wxT( "Reference" );
378  case VALUE_FIELD: return wxT( "Value" );
379  case FOOTPRINT_FIELD: return wxT( "Footprint" );
380  case DATASHEET_FIELD: return wxT( "Datasheet" );
381  }
382 
383  return m_name;
384 }
385 
386 
387 void LIB_FIELD::SetName( const wxString& aName )
388 {
389  // Mandatory field names are fixed.
390  if( IsMandatory() )
391  {
392  wxFAIL_MSG( "trying to set a MANDATORY_FIELD's name\n" );
393  return;
394  }
395 
396  if( m_name != aName )
397  {
398  m_name = aName;
399  SetModified();
400  }
401 }
402 
403 
404 wxString LIB_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const
405 {
406  return wxString::Format( "%s '%s'",
407  GetName(),
408  ShortenedShownText() );
409 }
410 
411 
412 void LIB_FIELD::BeginEdit( const wxPoint aPosition )
413 {
414  SetTextPos( aPosition );
415 }
416 
417 
418 void LIB_FIELD::CalcEdit( const wxPoint& aPosition )
419 {
420  SetTextPos( aPosition );
421 }
422 
423 
425 {
426  wxString msg;
427 
428  LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
429 
430  // Display style:
431  msg = GetTextStyleName();
432  aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) );
433 
434  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() );
435  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg ) );
436 
437  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() );
438  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg ) );
439 
440  // Display field name (ref, value ...)
441  aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName() ) );
442 
443  // Display field text:
444  aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText() ) );
445 }
446 
447 
449 {
450  return move_xpm;
451 }
452 
453 
455 {
456  return m_id >= 0 && m_id < MANDATORY_FIELDS;
457 }
Field Reference of part, i.e. "IC21".
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: lib_field.cpp:424
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: eda_text.h:50
bool IsBold() const
Definition: eda_text.h:190
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
Definition: lib_field.cpp:234
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:259
void SetModified()
Definition: eda_item.cpp:79
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:528
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:125
void print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
Print the field.
Definition: lib_field.cpp:107
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: lib_field.cpp:404
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:61
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:206
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
Test if aPosition is contained within or on the bounding box of an item.
Definition: lib_field.cpp:121
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void CopyText(const EDA_TEXT &aSrc)
Definition: eda_text.cpp:129
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:418
LIB_PART * GetParent() const
Definition: lib_item.h:149
bool IsVisible() const
Definition: eda_text.h:193
void SetEffects(const EDA_TEXT &aSrc)
Set the text effects from another instance.
Definition: eda_text.cpp:137
int color
Definition: DXF_plotter.cpp:60
Field object used in symbol libraries.
Definition: lib_field.h:59
EDA_RECT GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition: eda_text.cpp:223
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:253
void SetVisible(bool aVisible)
Definition: eda_text.h:192
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
double GetTextAngle() const
Definition: eda_text.h:181
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:126
int x1
Definition: transform.h:48
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: lib_field.cpp:448
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
Definition: lib_field.cpp:222
Definition: color4d.h:44
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
Definition: lib_field.cpp:216
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_field.cpp:313
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:228
The base class for create windows for drawing purpose.
void SetName(const wxString &aName)
Set a user definable field name to aName.
Definition: lib_field.cpp:387
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
Definition: eda_rect.h:203
int GetPenWidth() const override
Definition: lib_field.cpp:101
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
wxString GetName(bool aUseDefaultName=true) const
Returns the field name.
Definition: lib_field.cpp:364
name of datasheet
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:62
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:157
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
Definition: lib_field.cpp:210
int GetTextHeight() const
Definition: eda_text.h:251
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:219
void SetTextX(int aX)
Definition: eda_text.h:256
bool IsItalic() const
Definition: eda_text.h:187
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
int y1
Definition: transform.h:49
const wxPoint GetEnd() const
Definition: eda_rect.h:108
wxString GetTextStyleName() const
Definition: eda_text.cpp:485
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: lib_field.cpp:338
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:205
Field Value of part, i.e. "3.3K".
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:121
#define NULL
int GetUnitCount() const override
For items with units, return the number of units.
COMPARE_FLAGS
The list of flags used by the compare function.
Definition: lib_item.h:84
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
void SetEnd(int x, int y)
Definition: eda_rect.h:187
const wxSize & GetTextSize() const
Definition: eda_text.h:245
void Copy(LIB_FIELD *aTarget) const
Copy parameters of this field to another field.
Definition: lib_field.cpp:165
void Rotate(const wxPoint &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
Definition: lib_field.cpp:246
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
Definition: lib_field.cpp:373
const BITMAP_OPAQUE move_xpm[1]
Definition: move.cpp:25
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:258
Define a library symbol object.
Definition: lib_symbol.h:93
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: lib_field.cpp:155
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:202
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
SCH_LAYER_ID GetDefaultLayer()
Definition: lib_field.cpp:353
wxDC * GetPrintDC() const
SCH_LAYER_ID
Eeschema drawing layers.
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslate=true)
Return a default symbol field name for field aFieldNdx for all components.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, 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:50
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 footprint texts)
Definition: gr_text.cpp:131
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:68
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
EDA_UNITS
Definition: eda_units.h:38
int m_id
Definition: lib_field.h:61
Base plotter engine class.
Definition: plotter.h:121
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:155
void BeginEdit(const wxPoint aStartPoint) override
Begin drawing a component library draw item at aPosition.
Definition: lib_field.cpp:412
int GetTextWidth() const
Definition: eda_text.h:248
see class PGM_BASE
TRANSFORM DefaultTransform
Definition: eeschema.cpp:56
#define _(s)
Definition: 3d_actions.cpp:33
Handle the component boundary box.
Definition: eda_rect.h:42
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:296
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:376
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:447
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:97
wxPoint Centre() const
Definition: eda_rect.h:60
int GetDefaultPenWidth() const
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
#define TEXT_ANGLE_VERT
Definition: eda_text.h:51
virtual void SetTextAngle(double aAngle)
Definition: eda_text.h:174
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:54
wxString m_name
Name (not the field text value itself, that is .m_Text)
Definition: lib_field.h:62
Message panel definition file.
virtual int compare(const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:74
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:141
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
int compare(const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const override
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_field.cpp:175
void SetTextY(int aY)
Definition: eda_text.h:257
bool IsMandatory() const
Definition: lib_field.cpp:454
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98
Field Name Module PCB, i.e. "16DIP300".
bool GetColorMode() const
Definition: plotter.h:152