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