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