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-2020 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 <eda_draw_frame.h>
33 #include <plotter.h>
34 #include <trigo.h>
35 #include <base_units.h>
36 #include <msgpanel.h>
37 #include <bitmaps.h>
38 #include <general.h>
39 #include <class_libentry.h>
40 #include <transform.h>
41 #include <lib_field.h>
42 #include <template_fieldnames.h>
44 
45 
46 LIB_FIELD::LIB_FIELD(LIB_PART * aParent, int idfield ) :
47  LIB_ITEM( LIB_FIELD_T, aParent )
48 {
49  Init( idfield );
50 }
51 
52 
53 LIB_FIELD::LIB_FIELD( int idfield ) :
55 {
56  Init( idfield );
57 }
58 
59 
60 LIB_FIELD::LIB_FIELD( int aID, const wxString& aName ) :
62 {
63  Init( aID );
64  m_name = aName;
65 }
66 
67 
69 {
70 }
71 
72 
74 {
75  m_id = field.m_id;
76  m_name = field.m_name;
77  m_Parent = field.m_Parent;
78 
79  SetText( field.GetText() );
80  SetEffects( field );
81 
82  return *this;
83 }
84 
85 
86 void LIB_FIELD::Init( int id )
87 {
88  m_id = id;
89 
90  SetTextAngle( TEXT_ANGLE_HORIZ ); // constructor already did this.
91 
92  // Fields in RAM must always have names, because we are trying to get less dependent on
93  // field ids and more dependent on names. Plus assumptions are made in the field editors.
95 
96  // By contrast, VALUE and REFERENCE are are always constructed as initially visible, and
97  // template fieldsnames' initial visibility is controlled by the template fieldname config.
98  if( id == DATASHEET || id == FOOTPRINT )
99  SetVisible( false );
100 }
101 
102 
104 {
105  return GetEffectiveTextPenWidth();
106 }
107 
108 
109 void LIB_FIELD::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
110  const TRANSFORM& aTransform )
111 {
112  wxDC* DC = aSettings->GetPrintDC();
114  int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
115  wxPoint text_pos = aTransform.TransformCoordinate( GetTextPos() ) + aOffset;
116  wxString text = aData ? *static_cast<wxString*>( aData ) : GetText();
117 
118  GRText( DC, text_pos, color, text, GetTextAngle(), GetTextSize(), GetHorizJustify(),
119  GetVertJustify(), penWidth, IsItalic(), IsBold() );
120 }
121 
122 
123 bool LIB_FIELD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
124 {
125  // Because HitTest is mainly used to select the field return false if it is empty
126  if( GetText().IsEmpty() )
127  return false;
128 
129  // Build a temporary copy of the text for hit testing
130  EDA_TEXT tmp_text( *this );
131 
132  // Reference designator text has one or 2 additional character (displays U? or U?A)
133  if( m_id == REFERENCE )
134  {
135  const LIB_PART* parent = dynamic_cast<const LIB_PART*>( m_Parent );
136 
137  wxString extended_text = tmp_text.GetText();
138  extended_text.Append('?');
139 
140  if ( parent && parent->GetUnitCount() > 1 )
141  extended_text.Append('A');
142 
143  tmp_text.SetText( extended_text );
144  }
145 
147 
148  // The text orientation may need to be flipped if the transformation matrix causes xy axes
149  // to be flipped. This simple algo works only for schematic matrix (rot 90 or/and mirror)
150  bool t1 = ( DefaultTransform.x1 != 0 ) ^ ( GetTextAngle() != 0 );
151  tmp_text.SetTextAngle( t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT );
152 
153  return tmp_text.TextHitTest( aPosition, aAccuracy );
154 }
155 
156 
158 {
159  LIB_FIELD* newfield = new LIB_FIELD( m_id );
160 
161  Copy( newfield );
162 
163  return (EDA_ITEM*) newfield;
164 }
165 
166 
167 void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
168 {
169  aTarget->m_name = m_name;
170 
171  aTarget->CopyText( *this );
172  aTarget->SetEffects( *this );
173  aTarget->SetParent( m_Parent );
174 }
175 
176 
177 int LIB_FIELD::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags ) const
178 {
179  wxASSERT( aOther.Type() == LIB_FIELD_T );
180 
181  int retv = LIB_ITEM::compare( aOther, aCompareFlags );
182 
183  if( retv )
184  return retv;
185 
186  const LIB_FIELD* tmp = ( LIB_FIELD* ) &aOther;
187 
188  if( m_id != tmp->m_id )
189  return m_id - tmp->m_id;
190 
191  int result = GetText().CmpNoCase( tmp->GetText() );
192 
193  if( result != 0 )
194  return result;
195 
196  if( GetTextPos().x != tmp->GetTextPos().x )
197  return GetTextPos().x - tmp->GetTextPos().x;
198 
199  if( GetTextPos().y != tmp->GetTextPos().y )
200  return GetTextPos().y - tmp->GetTextPos().y;
201 
202  if( GetTextWidth() != tmp->GetTextWidth() )
203  return GetTextWidth() - tmp->GetTextWidth();
204 
205  if( GetTextHeight() != tmp->GetTextHeight() )
206  return GetTextHeight() - tmp->GetTextHeight();
207 
208  return 0;
209 }
210 
211 
212 void LIB_FIELD::Offset( const wxPoint& aOffset )
213 {
214  EDA_TEXT::Offset( aOffset );
215 }
216 
217 
218 void LIB_FIELD::MoveTo( const wxPoint& newPosition )
219 {
220  EDA_TEXT::SetTextPos( newPosition );
221 }
222 
223 
225 {
226  int x = GetTextPos().x;
227 
228  x -= center.x;
229  x *= -1;
230  x += center.x;
231 
232  SetTextX( x );
233 }
234 
235 
236 void LIB_FIELD::MirrorVertical( const wxPoint& center )
237 {
238  int y = GetTextPos().y;
239 
240  y -= center.y;
241  y *= -1;
242  y += center.y;
243 
244  SetTextY( y );
245 }
246 
247 
248 void LIB_FIELD::Rotate( const wxPoint& center, bool aRotateCCW )
249 {
250  int rot_angle = aRotateCCW ? -900 : 900;
251 
252  wxPoint pt = GetTextPos();
253  RotatePoint( &pt, center, rot_angle );
254  SetTextPos( pt );
255 
256  SetTextAngle( GetTextAngle() != 0.0 ? 0 : 900 );
257 }
258 
259 
260 void LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
261  const TRANSFORM& aTransform )
262 {
263  if( GetText().IsEmpty() )
264  return;
265 
266  // Calculate the text orientation, according to the component orientation/mirror
267  int orient = (int) GetTextAngle();
268 
269  if( aTransform.y1 ) // Rotate component 90 deg.
270  {
271  if( orient == TEXT_ANGLE_HORIZ )
272  orient = TEXT_ANGLE_VERT;
273  else
274  orient = TEXT_ANGLE_HORIZ;
275  }
276 
277  EDA_RECT BoundaryBox = GetBoundingBox();
278  BoundaryBox.RevertYAxis();
279 
282  wxPoint textpos = aTransform.TransformCoordinate( BoundaryBox.Centre() ) + aOffset;
283 
284  COLOR4D color;
285 
286  if( aPlotter->GetColorMode() )
288  else
290 
291  int penWidth = std::max( GetPenWidth(),aPlotter->RenderSettings()->GetDefaultPenWidth() );
292 
293  aPlotter->Text( textpos, color, GetShownText(), orient, GetTextSize(), hjustify, vjustify,
294  penWidth, IsItalic(), IsBold() );
295 }
296 
297 
298 wxString LIB_FIELD::GetFullText( int unit ) const
299 {
300  if( m_id != REFERENCE )
301  return GetText();
302 
303  wxString text = GetText();
304  text << wxT( "?" );
305 
306  wxCHECK( GetParent(), text );
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, true );
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  {
359  case REFERENCE: return LAYER_REFERENCEPART;
360  case VALUE: return LAYER_VALUEPART;
361  default: return LAYER_FIELDS;
362  }
363 }
364 
365 
366 wxString LIB_FIELD::GetName( bool aUseDefaultName ) const
367 {
368  if( m_name.IsEmpty() && aUseDefaultName )
370 
371  return m_name;
372 }
373 
374 
376 {
377  switch( m_id )
378  {
379  case REFERENCE: return wxT( "Reference" );
380  case VALUE: return wxT( "Value" );
381  case FOOTPRINT: return wxT( "Footprint" );
382  case DATASHEET: return wxT( "Datasheet" );
383  }
384 
385  return m_name;
386 }
387 
388 
389 void LIB_FIELD::SetName( const wxString& aName )
390 {
391  // Mandatory field names are fixed.
392  if( IsMandatory() )
393  {
394  wxFAIL_MSG( "trying to set a MANDATORY_FIELD's name\n" );
395  return;
396  }
397 
398  if( m_name != aName )
399  {
400  m_name = aName;
401  SetModified();
402  }
403 }
404 
405 
406 wxString LIB_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const
407 {
408  return wxString::Format( _( "Field %s (%s)" ),
409  GetName(),
410  ShortenedShownText() );
411 }
412 
413 
414 void LIB_FIELD::BeginEdit( const wxPoint aPosition )
415 {
416  SetTextPos( aPosition );
417 }
418 
419 
420 void LIB_FIELD::CalcEdit( const wxPoint& aPosition )
421 {
422  SetTextPos( aPosition );
423 }
424 
425 
427 {
428  wxString msg;
429 
430  LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
431 
432  // Display style:
433  msg = GetTextStyleName();
434  aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg, MAGENTA ) );
435 
436  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth(), true );
437  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, BLUE ) );
438 
439  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight(), true );
440  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, BLUE ) );
441 
442  // Display field name (ref, value ...)
443  aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName(), BROWN ) );
444 
445  // Display field text:
446  aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText(), BROWN ) );
447 }
448 
449 
451 {
452  return move_xpm;
453 }
454 
455 
457 {
458  return m_id >= 0 && m_id < MANDATORY_FIELDS;
459 }
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, 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:426
#define TEXT_ANGLE_HORIZ
EDA_UNITS
Definition: common.h:198
bool IsBold() const
Definition: eda_text.h:182
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
Definition: lib_field.cpp:236
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:252
void SetModified()
Definition: base_struct.cpp:85
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:406
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:174
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:47
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:199
name of datasheet
PNG memory record (file in memory).
Definition: bitmap_def.h:29
LIB_FIELD(int idfield=2)
Definition: lib_field.cpp:53
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:123
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
#define TEXT_ANGLE_VERT
void CopyText(const EDA_TEXT &aSrc)
Definition: eda_text.cpp:124
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:420
LIB_PART * GetParent() const
Definition: lib_item.h:182
bool IsVisible() const
Definition: eda_text.h:185
void SetEffects(const EDA_TEXT &aSrc)
Set the text effects from another instance.
Definition: eda_text.cpp:132
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
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:217
void print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
Print the field.
Definition: lib_field.cpp:109
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:246
void SetVisible(bool aVisible)
Definition: eda_text.h:184
Definition: color4d.h:61
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
double GetTextAngle() const
Definition: eda_text.h:173
TRANSFORM DefaultTransform
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
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:450
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
Definition: lib_field.cpp:224
Definition: color4d.h:44
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
Definition: lib_field.cpp:218
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
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:389
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size)
Definition: eda_rect.h:209
int GetPenWidth() const override
Definition: lib_field.cpp:103
Field Name Module PCB, i.e. "16DIP300".
Field Reference of part, i.e. "IC21".
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
wxString GetName(bool aUseDefaultName=true) const
Returns the field name.
Definition: lib_field.cpp:366
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:61
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:152
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
Definition: lib_field.cpp:212
int GetTextHeight() const
Definition: eda_text.h:244
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:222
void SetTextX(int aX)
Definition: eda_text.h:249
bool IsItalic() const
Definition: eda_text.h:179
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:112
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
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:198
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:116
#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:116
const wxPoint GetOrigin() const
Definition: eda_rect.h:114
Class LIB_PIN definition.
void SetEnd(int x, int y)
Definition: eda_rect.h:192
const wxSize & GetTextSize() const
Definition: eda_text.h:238
void Copy(LIB_FIELD *aTarget) const
Copy parameters of this field to another field.
Definition: lib_field.cpp:167
void Rotate(const wxPoint &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
Definition: lib_field.cpp:248
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:375
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:260
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:157
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:196
LIB_FIELD & operator=(const LIB_FIELD &field)
Definition: lib_field.cpp:73
void Init(int idfield)
Object constructor initialization helper.
Definition: lib_field.cpp:86
SCH_LAYER_ID GetDefaultLayer()
Definition: lib_field.cpp:355
SCH_LAYER_ID
Eeschema drawing layers.
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:52
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:134
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:54
int m_id
Definition: lib_field.h:61
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
Base plotter engine class.
Definition: plotter.h:114
Definition: color4d.h:56
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
void BeginEdit(const wxPoint aStartPoint) override
Begin drawing a component library draw item at aPosition.
Definition: lib_field.cpp:414
int GetTextWidth() const
Definition: eda_text.h:241
see class PGM_BASE
wxString GetTextStyleName()
Definition: eda_text.cpp:479
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:33
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:298
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:370
static wxString SubReference(int aUnit, bool aAddSeparator=true)
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
wxPoint Centre() const
Definition: eda_rect.h:62
int GetDefaultPenWidth() const
const wxPoint & GetTextPos() const
Definition: eda_text.h:247
virtual void SetTextAngle(double aAngle)
Definition: eda_text.h:166
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 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:76
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:126
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:133
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:177
void SetTextY(int aY)
Definition: eda_text.h:250
bool IsMandatory() const
Definition: lib_field.cpp:456
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99
bool GetColorMode() const
Definition: plotter.h:144