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 <eda_item.h>
26 #include <gr_text.h>
27 #include <kicad_string.h>
28 #include <sch_draw_panel.h>
29 #include <eda_draw_frame.h>
30 #include <plotter.h>
31 #include <trigo.h>
32 #include <base_units.h>
33 #include <widgets/msgpanel.h>
34 #include <bitmaps.h>
35 #include <general.h>
36 #include <lib_symbol.h>
37 #include <transform.h>
38 #include <lib_field.h>
39 #include <template_fieldnames.h>
41 
42 
43 LIB_FIELD::LIB_FIELD( LIB_SYMBOL* aParent, int idfield ) :
44  LIB_ITEM( LIB_FIELD_T, aParent )
45 {
46  Init( idfield );
47 }
48 
49 
50 LIB_FIELD::LIB_FIELD( int idfield ) :
52 {
53  Init( idfield );
54 }
55 
56 
57 LIB_FIELD::LIB_FIELD( int aID, const wxString& aName ) :
59 {
60  Init( aID );
61  m_name = aName;
62 }
63 
64 
66 {
67 }
68 
69 
71 {
72  m_id = field.m_id;
73  m_name = field.m_name;
74  m_parent = field.m_parent;
75 
76  SetText( field.GetText() );
77  SetEffects( field );
78 
79  return *this;
80 }
81 
82 
83 void LIB_FIELD::Init( int id )
84 {
85  m_id = id;
86 
87  SetTextAngle( TEXT_ANGLE_HORIZ ); // constructor already did this.
88 
89  // Fields in RAM must always have names, because we are trying to get less dependent on
90  // field ids and more dependent on names. Plus assumptions are made in the field editors.
92 
93  // By contrast, VALUE and REFERENCE are are always constructed as initially visible, and
94  // template fieldsnames' initial visibility is controlled by the template fieldname config.
95  if( id == DATASHEET_FIELD || id == FOOTPRINT_FIELD )
96  SetVisible( false );
97 }
98 
99 
101 {
102  return GetEffectiveTextPenWidth();
103 }
104 
105 
106 void LIB_FIELD::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
107  const TRANSFORM& aTransform )
108 {
109  wxDC* DC = aSettings->GetPrintDC();
111  int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
112  wxPoint text_pos = aTransform.TransformCoordinate( GetTextPos() ) + aOffset;
113  wxString text = aData ? *static_cast<wxString*>( aData ) : GetText();
114 
115  GRText( DC, text_pos, color, text, GetTextAngle(), GetTextSize(), GetHorizJustify(),
116  GetVertJustify(), penWidth, IsItalic(), IsBold() );
117 }
118 
119 
120 bool LIB_FIELD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
121 {
122  // Because HitTest is mainly used to select the field return false if it is empty
123  if( GetText().IsEmpty() )
124  return false;
125 
126  // Build a temporary copy of the text for hit testing
127  EDA_TEXT tmp_text( *this );
128 
129  // Reference designator text has one or 2 additional character (displays U? or U?A)
130  if( m_id == REFERENCE_FIELD )
131  {
132  const LIB_SYMBOL* parent = dynamic_cast<const LIB_SYMBOL*>( m_parent );
133 
134  wxString extended_text = tmp_text.GetText();
135  extended_text.Append('?');
136 
137  if ( parent && parent->GetUnitCount() > 1 )
138  extended_text.Append('A');
139 
140  tmp_text.SetText( extended_text );
141  }
142 
144 
145  // The text orientation may need to be flipped if the transformation matrix causes xy axes
146  // to be flipped. This simple algo works only for schematic matrix (rot 90 or/and mirror)
147  bool t1 = ( DefaultTransform.x1 != 0 ) ^ ( GetTextAngle() != 0 );
148  tmp_text.SetTextAngle( t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT );
149 
150  return tmp_text.TextHitTest( aPosition, aAccuracy );
151 }
152 
153 
155 {
156  LIB_FIELD* newfield = new LIB_FIELD( m_id );
157 
158  Copy( newfield );
159 
160  return (EDA_ITEM*) newfield;
161 }
162 
163 
164 void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
165 {
166  aTarget->m_name = m_name;
167 
168  aTarget->CopyText( *this );
169  aTarget->SetEffects( *this );
170  aTarget->SetParent( m_parent );
171 }
172 
173 
174 int LIB_FIELD::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
175 {
176  wxASSERT( aOther.Type() == LIB_FIELD_T );
177 
178  int retv = LIB_ITEM::compare( aOther, aCompareFlags );
179 
180  if( retv )
181  return retv;
182 
183  const LIB_FIELD* tmp = ( LIB_FIELD* ) &aOther;
184 
185  if( m_id != tmp->m_id )
186  return m_id - tmp->m_id;
187 
188  int result = GetText().CmpNoCase( tmp->GetText() );
189 
190  if( result != 0 )
191  return result;
192 
193  if( GetTextPos().x != tmp->GetTextPos().x )
194  return GetTextPos().x - tmp->GetTextPos().x;
195 
196  if( GetTextPos().y != tmp->GetTextPos().y )
197  return GetTextPos().y - tmp->GetTextPos().y;
198 
199  if( GetTextWidth() != tmp->GetTextWidth() )
200  return GetTextWidth() - tmp->GetTextWidth();
201 
202  if( GetTextHeight() != tmp->GetTextHeight() )
203  return GetTextHeight() - tmp->GetTextHeight();
204 
205  return 0;
206 }
207 
208 
209 void LIB_FIELD::Offset( const wxPoint& aOffset )
210 {
211  EDA_TEXT::Offset( aOffset );
212 }
213 
214 
215 void LIB_FIELD::MoveTo( const wxPoint& newPosition )
216 {
217  EDA_TEXT::SetTextPos( newPosition );
218 }
219 
220 
221 void LIB_FIELD::MirrorHorizontal( const wxPoint& center )
222 {
223  int x = GetTextPos().x;
224 
225  x -= center.x;
226  x *= -1;
227  x += center.x;
228 
229  SetTextX( x );
230 }
231 
232 
233 void LIB_FIELD::MirrorVertical( const wxPoint& center )
234 {
235  int y = GetTextPos().y;
236 
237  y -= center.y;
238  y *= -1;
239  y += center.y;
240 
241  SetTextY( y );
242 }
243 
244 
245 void LIB_FIELD::Rotate( const wxPoint& center, bool aRotateCCW )
246 {
247  int rot_angle = aRotateCCW ? -900 : 900;
248 
249  wxPoint pt = GetTextPos();
250  RotatePoint( &pt, center, rot_angle );
251  SetTextPos( pt );
252 
253  SetTextAngle( GetTextAngle() != 0.0 ? 0 : 900 );
254 }
255 
256 
257 void LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
258  const TRANSFORM& aTransform ) const
259 {
260  if( GetText().IsEmpty() )
261  return;
262 
263  // Calculate the text orientation, according to the symbol orientation/mirror.
264  int orient = (int) GetTextAngle();
265 
266  if( aTransform.y1 ) // Rotate symbol 90 deg.
267  {
268  if( orient == TEXT_ANGLE_HORIZ )
269  orient = TEXT_ANGLE_VERT;
270  else
271  orient = TEXT_ANGLE_HORIZ;
272  }
273 
274  EDA_RECT BoundaryBox = GetBoundingBox();
275  BoundaryBox.RevertYAxis();
276 
279  wxPoint textpos = aTransform.TransformCoordinate( BoundaryBox.Centre() ) + aOffset;
280 
281  COLOR4D color;
282 
283  if( aPlotter->GetColorMode() )
285  else
287 
288  int penWidth = std::max( GetPenWidth(),aPlotter->RenderSettings()->GetMinPenWidth() );
289 
290  aPlotter->Text( textpos, color, GetShownText(), orient, GetTextSize(), hjustify, vjustify,
291  penWidth, IsItalic(), IsBold() );
292 }
293 
294 
295 wxString LIB_FIELD::GetFullText( int unit ) const
296 {
297  if( m_id != REFERENCE_FIELD )
298  return GetText();
299 
300  wxString text = GetText();
301  text << wxT( "?" );
302 
303  wxCHECK( GetParent(), text );
304 
305  if( GetParent()->IsMulti() )
306  text << LIB_SYMBOL::SubReference( unit );
307 
308  return text;
309 }
310 
311 
313 {
314  /* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when
315  * calling GetTextBox() that works using top to bottom Y axis orientation.
316  */
317  EDA_RECT rect = GetTextBox( -1, true );
318  rect.RevertYAxis();
319 
320  // We are using now a bottom to top Y axis.
321  wxPoint orig = rect.GetOrigin();
322  wxPoint end = rect.GetEnd();
323 
324  RotatePoint( &orig, GetTextPos(), -GetTextAngle() );
325  RotatePoint( &end, GetTextPos(), -GetTextAngle() );
326 
327  rect.SetOrigin( orig );
328  rect.SetEnd( end );
329 
330  // We are using now a top to bottom Y axis:
331  rect.RevertYAxis();
332 
333  return rect;
334 }
335 
336 
337 void LIB_FIELD::ViewGetLayers( int aLayers[], int& aCount ) const
338 {
339  aCount = 2;
340 
341  switch( m_id )
342  {
343  case REFERENCE_FIELD: aLayers[0] = LAYER_REFERENCEPART; break;
344  case VALUE_FIELD: aLayers[0] = LAYER_VALUEPART; break;
345  default: aLayers[0] = LAYER_FIELDS; break;
346  }
347 
348  aLayers[1] = LAYER_SELECTION_SHADOWS;
349 }
350 
351 
353 {
354  switch( m_id )
355  {
357  case VALUE_FIELD: return LAYER_VALUEPART;
358  default: return LAYER_FIELDS;
359  }
360 }
361 
362 
363 wxString LIB_FIELD::GetName( bool aUseDefaultName ) const
364 {
365  if( m_name.IsEmpty() && aUseDefaultName )
367 
368  return m_name;
369 }
370 
371 
373 {
374  switch( m_id )
375  {
376  case REFERENCE_FIELD: return wxT( "Reference" );
377  case VALUE_FIELD: return wxT( "Value" );
378  case FOOTPRINT_FIELD: return wxT( "Footprint" );
379  case DATASHEET_FIELD: return wxT( "Datasheet" );
380  }
381 
382  return m_name;
383 }
384 
385 
386 void LIB_FIELD::SetName( const wxString& aName )
387 {
388  // Mandatory field names are fixed.
389  if( IsMandatory() )
390  {
391  wxFAIL_MSG( "trying to set a MANDATORY_FIELD's name\n" );
392  return;
393  }
394 
395  if( m_name != aName )
396  {
397  m_name = aName;
398  SetModified();
399  }
400 }
401 
402 
403 wxString LIB_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const
404 {
405  return wxString::Format( "%s '%s'",
406  GetName(),
407  ShortenedShownText() );
408 }
409 
410 
411 void LIB_FIELD::BeginEdit( const wxPoint& aPosition )
412 {
413  SetTextPos( aPosition );
414 }
415 
416 
417 void LIB_FIELD::CalcEdit( const wxPoint& aPosition )
418 {
419  SetTextPos( aPosition );
420 }
421 
422 
424 {
425  wxString msg;
426 
427  LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
428 
429  // Display style:
430  msg = GetTextStyleName();
431  aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) );
432 
433  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() );
434  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg ) );
435 
436  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() );
437  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg ) );
438 
439  // Display field name (ref, value ...)
440  aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName() ) );
441 
442  // Display field text:
443  aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText() ) );
444 }
445 
446 
448 {
449  return BITMAPS::move;
450 }
451 
452 
454 {
455  return m_id >= 0 && m_id < MANDATORY_FIELDS;
456 }
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:423
#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:233
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:259
void SetModified()
Definition: eda_item.cpp:65
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:479
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:103
void print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
Print the field.
Definition: lib_field.cpp:106
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:403
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
LIB_FIELD(int idfield=2)
Definition: lib_field.cpp:50
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:120
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:121
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:417
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:129
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:229
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:121
int x1
Definition: transform.h:48
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
Definition: lib_field.cpp:221
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Definition: lib_symbol.cpp:447
Definition: color4d.h:44
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
Definition: lib_field.cpp:215
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: lib_field.cpp:312
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:386
Define a library symbol object.
Definition: lib_symbol.h:96
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
Definition: eda_rect.h:198
int GetPenWidth() const override
Definition: lib_field.cpp:100
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:116
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
Definition: lib_field.cpp:363
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 symbols.
Definition: lib_item.h:61
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:149
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
Definition: lib_field.cpp:209
int GetTextHeight() const
Definition: eda_text.h:251
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:103
wxString GetTextStyleName() const
Definition: eda_text.cpp:491
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:337
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:114
#define NULL
COMPARE_FLAGS
The list of flags used by the compare function.
Definition: lib_item.h:81
const wxPoint GetOrigin() const
Definition: eda_rect.h:101
void SetEnd(int x, int y)
Definition: eda_rect.h:182
const wxSize & GetTextSize() const
Definition: eda_text.h:245
int GetUnitCount() const override
For items with units, return the number of units.
void Copy(LIB_FIELD *aTarget) const
Copy parameters of this field to another field.
Definition: lib_field.cpp:164
void Rotate(const wxPoint &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
Definition: lib_field.cpp:245
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:372
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: lib_field.cpp:154
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:208
LIB_FIELD & operator=(const LIB_FIELD &field)
Definition: lib_field.cpp:70
#define _(s)
void Init(int idfield)
Object constructor initialization helper.
Definition: lib_field.cpp:83
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 BeginEdit(const wxPoint &aStartPoint) override
Begin drawing a symbol library draw item at aPosition.
Definition: lib_field.cpp:411
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)
Draw a graphic text (like footprint texts).
Definition: gr_text.cpp:130
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:212
void Plot(PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) const override
Plot the draw item using the plot object.
Definition: lib_field.cpp:257
LIB_SYMBOL * GetParent() const
Definition: lib_item.h:146
Base plotter engine class.
Definition: plotter.h:121
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
int GetTextWidth() const
Definition: eda_text.h:248
TRANSFORM DefaultTransform
Definition: eeschema.cpp:56
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
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:295
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:382
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
SCH_LAYER_ID GetDefaultLayer() const
Definition: lib_field.cpp:352
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:97
wxPoint Centre() const
Definition: eda_rect.h:55
int GetDefaultPenWidth() const
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
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=nullptr)
Draw text with the plotter.
Definition: gr_text.cpp:217
#define TEXT_ANGLE_VERT
Definition: eda_text.h:51
virtual void SetTextAngle(double aAngle)
Definition: eda_text.h:174
EDA_MSG_PANEL items 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:213
Message panel definition file.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: lib_field.cpp:447
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:174
void SetTextY(int aY)
Definition: eda_text.h:257
bool IsMandatory() const
Definition: lib_field.cpp:453
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
Field Name Module PCB, i.e. "16DIP300".
bool GetColorMode() const
Definition: plotter.h:153