KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_textbox.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <google/protobuf/any.pb.h>
21
22#include <advanced_config.h>
23#include <api/api_enums.h>
24#include <api/api_utils.h>
25#include <base_units.h>
26#include <pgm_base.h>
27#include <sch_edit_frame.h>
28#include <plotters/plotter.h>
29#include <widgets/msgpanel.h>
30#include <bitmaps.h>
31#include <string_utils.h>
32#include <schematic.h>
34#include <sch_painter.h>
35#include <wx/log.h>
38#include <trigo.h>
40#include <sch_textbox.h>
42#include <tool/tool_manager.h>
43#include <markup_parser.h>
44#include <properties/property.h>
46#include <api/schematic/schematic_types.pb.h>
47
48
49SCH_TEXTBOX::SCH_TEXTBOX( SCH_LAYER_ID aLayer, int aLineWidth, FILL_T aFillType, const wxString& aText,
50 KICAD_T aType ) :
51 SCH_SHAPE( SHAPE_T::RECTANGLE, aLayer, aLineWidth, aFillType, aType ),
52 EDA_TEXT( schIUScale, aText )
53{
54 m_layer = aLayer;
55
58 SetMultilineAllowed( true );
59
60 m_excludedFromSim = false;
61
62 int defaultMargin = GetLegacyTextMargin();
63 m_marginLeft = defaultMargin;
64 m_marginTop = defaultMargin;
65 m_marginRight = defaultMargin;
66 m_marginBottom = defaultMargin;
67}
68
69
80
81
82void SCH_TEXTBOX::Serialize( kiapi::schematic::types::SchematicTextBox& aOutput, const EDA_IU_SCALE& aScale ) const
83{
84 using namespace kiapi::common;
85
86 aOutput.mutable_id()->set_value( m_Uuid.AsStdString() );
87 aOutput.set_locked( IsLocked() ? types::LockedState::LS_LOCKED : types::LockedState::LS_UNLOCKED );
88 aOutput.set_exclude_from_sim( GetExcludedFromSim() );
89 PackDistance( *aOutput.mutable_margin_left(), GetMarginLeft(), aScale );
90 PackDistance( *aOutput.mutable_margin_top(), GetMarginTop(), aScale );
91 PackDistance( *aOutput.mutable_margin_right(), GetMarginRight(), aScale );
92 PackDistance( *aOutput.mutable_margin_bottom(), GetMarginBottom(), aScale );
93
94 types::TextBox& text = *aOutput.mutable_textbox();
95 PackVector2( *text.mutable_top_left(), GetPosition(), aScale );
96 PackVector2( *text.mutable_bottom_right(), GetEnd(), aScale );
97 text.set_text( GetText().ToUTF8() );
98 text.set_border_enabled( GetStroke().GetWidth() >= 0 );
99
100 types::TextAttributes* attrs = text.mutable_attributes();
101
102 if( GetFont() )
103 attrs->set_font_name( GetFont()->GetName().ToUTF8() );
104
107 attrs->mutable_angle()->set_value_degrees( GetTextAngleDegrees() );
108 attrs->set_line_spacing( GetLineSpacing() );
109 PackDistance( *attrs->mutable_stroke_width(), GetTextThickness(), aScale );
110 attrs->set_italic( IsItalic() );
111 attrs->set_bold( IsBold() );
112 attrs->set_underlined( GetAttributes().m_Underlined );
113 attrs->set_mirrored( IsMirrored() );
114 attrs->set_multiline( IsMultilineAllowed() );
115 attrs->set_keep_upright( IsKeepUpright() );
116 PackVector2( *attrs->mutable_size(), GetTextSize(), aScale );
117
119 PackColor( *attrs->mutable_color(), GetTextColor() );
120
121 types::StrokeAttributes* stroke = aOutput.mutable_graphic_attributes()->mutable_stroke();
122 PackDistance( *stroke->mutable_width(), GetStroke().GetWidth(), aScale );
124
125 if( GetStroke().GetColor() != COLOR4D::UNSPECIFIED )
126 PackColor( *stroke->mutable_color(), GetStroke().GetColor() );
127
128 types::GraphicFillAttributes* fill = aOutput.mutable_graphic_attributes()->mutable_fill();
130
132 PackColor( *fill->mutable_color(), GetFillColor() );
133
134 PackCustomProperties( aOutput.mutable_custom_properties(), *this );
135}
136
137
138void SCH_TEXTBOX::Serialize( google::protobuf::Any& aContainer ) const
139{
140 kiapi::schematic::types::SchematicTextBox textBox;
141 Serialize( textBox, schIUScale );
142 aContainer.PackFrom( textBox );
143}
144
145
146bool SCH_TEXTBOX::Deserialize( const kiapi::schematic::types::SchematicTextBox& aInput, const EDA_IU_SCALE& aScale )
147{
148 using namespace kiapi::common;
149
150 const_cast<KIID&>( m_Uuid ) = KIID( aInput.id().value() );
151 SetLocked( aInput.locked() == types::LockedState::LS_LOCKED );
152 SetExcludedFromSim( aInput.exclude_from_sim() );
153 SetPosition( UnpackVector2( aInput.textbox().top_left(), aScale ) );
154 SetEnd( UnpackVector2( aInput.textbox().bottom_right(), aScale ) );
155 SetText( wxString::FromUTF8( aInput.textbox().text() ) );
156 UnpackCustomProperties( aInput.custom_properties(), *this );
157
158 if( aInput.has_margin_left() )
159 SetMarginLeft( UnpackDistance( aInput.margin_left(), aScale ) );
160
161 if( aInput.has_margin_top() )
162 SetMarginTop( UnpackDistance( aInput.margin_top(), aScale ) );
163
164 if( aInput.has_margin_right() )
165 SetMarginRight( UnpackDistance( aInput.margin_right(), aScale ) );
166
167 if( aInput.has_margin_bottom() )
168 SetMarginBottom( UnpackDistance( aInput.margin_bottom(), aScale ) );
169
170 if( aInput.textbox().has_attributes() )
171 {
173
174 attrs.m_Bold = aInput.textbox().attributes().bold();
175 attrs.m_Italic = aInput.textbox().attributes().italic();
176 attrs.m_Underlined = aInput.textbox().attributes().underlined();
177 attrs.m_Mirrored = aInput.textbox().attributes().mirrored();
178 attrs.m_Multiline = aInput.textbox().attributes().multiline();
179 attrs.m_KeepUpright = aInput.textbox().attributes().keep_upright();
180 attrs.m_Size = UnpackVector2( aInput.textbox().attributes().size(), aScale );
181
182 if( aInput.textbox().attributes().has_color() )
183 attrs.m_Color = UnpackColor( aInput.textbox().attributes().color() );
184 else
186
187 if( !aInput.textbox().attributes().font_name().empty() )
188 {
189 attrs.m_Font = KIFONT::FONT::GetFont( wxString::FromUTF8( aInput.textbox().attributes().font_name() ),
190 attrs.m_Bold, attrs.m_Italic );
191 }
192
193 attrs.m_Angle = EDA_ANGLE( aInput.textbox().attributes().angle().value_degrees(), DEGREES_T );
194
195 if( aInput.textbox().attributes().has_line_spacing() )
196 attrs.m_LineSpacing = aInput.textbox().attributes().line_spacing();
197 else
198 attrs.m_LineSpacing = 1.0;
199
200 attrs.m_StrokeWidth = UnpackDistance( aInput.textbox().attributes().stroke_width(), aScale );
202 aInput.textbox().attributes().horizontal_alignment() );
204 aInput.textbox().attributes().vertical_alignment() );
205
206 SetAttributes( attrs );
207 }
208
209 if( aInput.has_graphic_attributes() )
210 {
211 if( aInput.graphic_attributes().stroke().has_color() )
212 m_stroke.SetColor( UnpackColor( aInput.graphic_attributes().stroke().color() ) );
213 else
214 m_stroke.SetColor( COLOR4D::UNSPECIFIED );
215
216 if( aInput.graphic_attributes().fill().has_color() )
217 SetFillColor( UnpackColor( aInput.graphic_attributes().fill().color() ) );
218 else
220
221 SetWidth( UnpackDistance( aInput.graphic_attributes().stroke().width(), aScale ) );
222
223 if( !aInput.textbox().border_enabled() )
224 SetWidth( -1 );
225 else
226 SetWidth( std::max( 0, GetStroke().GetWidth() ) );
227
229 FromProtoEnum<LINE_STYLE, types::StrokeLineStyle>( aInput.graphic_attributes().stroke().style() ) );
230 SetFillMode( FromProtoEnum<FILL_T, types::GraphicFillType>( aInput.graphic_attributes().fill().fill_type() ) );
231 }
232
233 return true;
234}
235
236
237bool SCH_TEXTBOX::Deserialize( const google::protobuf::Any& aContainer )
238{
239 kiapi::schematic::types::SchematicTextBox textBox;
240
241 if( !aContainer.UnpackTo( &textBox ) )
242 return false;
243
244 return Deserialize( textBox, schIUScale );
245}
246
247
249{
250 if( m_layer == LAYER_DEVICE )
251 return KiROUND( GetTextSize().y * 0.8 );
252 else
253 return KiROUND( GetStroke().GetWidth() / 2.0 ) + KiROUND( GetTextSize().y * 0.75 );
254}
255
256
258{
259 if( GetText().IsEmpty() )
260 return VECTOR2I( 0, 0 );
261
262 BOX2I textBox = GetTextBox( nullptr );
263
264 int textHeight = std::abs( textBox.GetHeight() );
265
266 if( GetTextAngle().IsVertical() )
267 {
268 textHeight += GetMarginLeft() + GetMarginRight();
269 return VECTOR2I( textHeight, 0 );
270 }
271
272 textHeight += GetMarginTop() + GetMarginBottom();
273 return VECTOR2I( 0, textHeight );
274}
275
276
278{
280
281 // Text is NOT really mirrored; it just has its justification flipped
283 {
288 }
289}
290
291
293{
295
296 // Text is NOT really mirrored; it just has its justification flipped
298 {
303 }
304}
305
306
307void SCH_TEXTBOX::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
308{
309 SCH_SHAPE::Rotate( aCenter, aRotateCCW );
311}
312
313
318
319
321{
322 BOX2I bbox = BOX2I( m_start, m_end - m_start );
323
324 bbox.Normalize();
325
326 VECTOR2I pos( bbox.GetLeft() + m_marginLeft, bbox.GetBottom() - m_marginBottom );
327
328 if( GetTextAngle().IsVertical() )
329 {
330 switch( GetHorizJustify() )
331 {
332 case GR_TEXT_H_ALIGN_LEFT: pos.y = bbox.GetBottom() - m_marginBottom; break;
333 case GR_TEXT_H_ALIGN_CENTER: pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2; break;
334 case GR_TEXT_H_ALIGN_RIGHT: pos.y = bbox.GetTop() + m_marginTop; break;
335 case GR_TEXT_H_ALIGN_INDETERMINATE: wxFAIL_MSG( wxT( "Indeterminate state legal only in dialogs." ) ); break;
336 }
337
338 switch( GetVertJustify() )
339 {
340 case GR_TEXT_V_ALIGN_TOP: pos.x = bbox.GetLeft() + m_marginLeft; break;
341 case GR_TEXT_V_ALIGN_CENTER: pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2; break;
342 case GR_TEXT_V_ALIGN_BOTTOM: pos.x = bbox.GetRight() - m_marginRight; break;
343 case GR_TEXT_V_ALIGN_INDETERMINATE: wxFAIL_MSG( wxT( "Indeterminate state legal only in dialogs." ) ); break;
344 }
345 }
346 else
347 {
348 switch( GetHorizJustify() )
349 {
350 case GR_TEXT_H_ALIGN_LEFT: pos.x = bbox.GetLeft() + m_marginLeft; break;
351 case GR_TEXT_H_ALIGN_CENTER: pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2; break;
352 case GR_TEXT_H_ALIGN_RIGHT: pos.x = bbox.GetRight() - m_marginRight; break;
353 case GR_TEXT_H_ALIGN_INDETERMINATE: wxFAIL_MSG( wxT( "Indeterminate state legal only in dialogs." ) ); break;
354 }
355
356 switch( GetVertJustify() )
357 {
358 case GR_TEXT_V_ALIGN_TOP: pos.y = bbox.GetTop() + m_marginTop; break;
359 case GR_TEXT_V_ALIGN_CENTER: pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2; break;
360 case GR_TEXT_V_ALIGN_BOTTOM: pos.y = bbox.GetBottom() - m_marginBottom; break;
361 case GR_TEXT_V_ALIGN_INDETERMINATE: wxFAIL_MSG( wxT( "Indeterminate state legal only in dialogs." ) ); break;
362 }
363 }
364
365 return pos;
366}
367
368
370{
371 SCH_SHAPE::swapData( aItem );
372
373 SCH_TEXTBOX* item = static_cast<SCH_TEXTBOX*>( aItem );
374
375 std::swap( m_excludedFromSim, item->m_excludedFromSim );
376 std::swap( m_marginLeft, item->m_marginLeft );
377 std::swap( m_marginTop, item->m_marginTop );
378 std::swap( m_marginRight, item->m_marginRight );
379 std::swap( m_marginBottom, item->m_marginBottom );
380
381 SwapText( *item );
382 SwapAttributes( *item );
383}
384
385
386bool SCH_TEXTBOX::operator<( const SCH_ITEM& aItem ) const
387{
388 if( Type() != aItem.Type() )
389 return Type() < aItem.Type();
390
391 auto other = static_cast<const SCH_TEXTBOX*>( &aItem );
392
393 if( GetLayer() != other->GetLayer() )
394 return GetLayer() < other->GetLayer();
395
396 if( GetPosition().x != other->GetPosition().x )
397 return GetPosition().x < other->GetPosition().x;
398
399 if( GetPosition().y != other->GetPosition().y )
400 return GetPosition().y < other->GetPosition().y;
401
402 if( GetMarginLeft() != other->GetMarginLeft() )
403 return GetMarginLeft() < other->GetMarginLeft();
404
405 if( GetMarginTop() != other->GetMarginTop() )
406 return GetMarginTop() < other->GetMarginTop();
407
408 if( GetMarginRight() != other->GetMarginRight() )
409 return GetMarginRight() < other->GetMarginRight();
410
411 if( GetMarginBottom() != other->GetMarginBottom() )
412 return GetMarginBottom() < other->GetMarginBottom();
413
414 if( GetExcludedFromSim() != other->GetExcludedFromSim() )
415 return GetExcludedFromSim();
416
417 return GetText() < other->GetText();
418}
419
420
422{
424
425 if( !font )
426 font = KIFONT::FONT::GetFont( GetDefaultFont( aSettings ), IsBold(), IsItalic() );
427
428 return font;
429}
430
431
432wxString SCH_TEXTBOX::GetShownText( const RENDER_SETTINGS* aSettings, const SCH_SHEET_PATH* aPath,
433 RESOLUTION_CONTEXT aContext, int aDepth ) const
434{
435 // Use local depth counter so each text element starts fresh
436 int depth = 0;
437
438 SCH_SHEET* sheet = nullptr;
439
440 if( aPath )
441 sheet = aPath->Last();
442
443 std::function<bool( wxString* )> textResolver =
444 [&]( wxString* token ) -> bool
445 {
446 if( sheet )
447 {
448 if( sheet->ResolveTextVar( aPath, token, depth + 1 ) )
449 return true;
450 }
451
452 return false;
453 };
454
455 wxString text = EDA_TEXT::GetShownText( aContext, depth );
456
457 if( HasTextVars() && aContext != RAW_VALUE )
458 {
459 text = ResolveTextVars( text, &textResolver, depth );
460 FinalizeTextVarExpansion( text, aContext );
461 }
462
463 if( aDepth == 0 )
464 {
465 VECTOR2I size = GetEnd() - GetStart();
466 int colWidth;
467
468 if( GetTextAngle().IsVertical() )
469 colWidth = abs( size.y ) - ( GetMarginTop() + GetMarginBottom() );
470 else
471 colWidth = abs( size.x ) - ( GetMarginLeft() + GetMarginRight() );
472
474 IsBold(), IsItalic() );
475 }
476
477 return text;
478}
479
480
481bool SCH_TEXTBOX::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
482{
483 BOX2I rect = GetBoundingBox();
484
485 rect.Inflate( aAccuracy );
486
487 return rect.Contains( aPosition );
488}
489
490
491bool SCH_TEXTBOX::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
492{
493 BOX2I rect = aRect;
494
495 rect.Inflate( aAccuracy );
496
497 if( aContained )
498 return rect.Contains( GetBoundingBox() );
499
500 return rect.Intersects( GetBoundingBox() );
501}
502
503
504bool SCH_TEXTBOX::HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const
505{
506 return KIGEOM::BoxHitTest( aPoly, GetBoundingBox(), aContained );
507}
508
509
511{
512 return HasHyperlink() || containsURL();
513}
514
515
517{
518 return !m_activeUrl.IsEmpty();
519}
520
521
522void SCH_TEXTBOX::DoHypertextAction( EDA_DRAW_FRAME* aFrame, const VECTOR2I& aMousePos ) const
523{
525
526 if( HasHyperlink() )
527 navTool->HypertextCommand( m_hyperlink );
528 else if( !m_activeUrl.IsEmpty() )
529 navTool->HypertextCommand( m_activeUrl );
530}
531
532
533wxString SCH_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
534{
535 return wxString::Format( _( "Text box '%s'" ), aFull ? GetShownText( FOR_GUI )
537}
538
539
544
545
546void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, int aUnit, int aBodyStyle,
547 const VECTOR2I& aOffset, bool aDimmed )
548{
549 if( IsPrivate() )
550 return;
551
552 SCH_SHAPE::Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
553
554 if( aBackground )
555 return;
556
557 SCH_SHEET_PATH* sheet = Schematic() ? &Schematic()->CurrentSheet() : nullptr;
558 SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
559 int penWidth = GetEffectivePenWidth( renderSettings );
560 COLOR4D color = GetStroke().GetColor();
561 COLOR4D bg = renderSettings->GetBackgroundColor();
562
563 KIFONT::FONT* font = GetDrawFont( renderSettings );
564
565 color = GetTextColor();
566
567 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
568 color = renderSettings->GetLayerColor( m_layer );
569
570 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
571 bg = COLOR4D::WHITE;
572
573 if( color.m_text && Schematic() )
574 color = COLOR4D( ResolveText( *color.m_text, &Schematic()->CurrentSheet() ) );
575
576 if( aDimmed )
577 {
578 color.Desaturate();
579 color = color.Mix( bg, 0.5f );
580 }
581
582 penWidth = GetEffectiveTextPenWidth( renderSettings->GetDefaultPenWidth() );
583 penWidth = std::max( penWidth, renderSettings->GetMinPenWidth() );
584 aPlotter->SetCurrentLineWidth( penWidth );
585
586 TEXT_ATTRIBUTES attrs;
587 std::vector<VECTOR2I> positions;
588 wxArrayString strings_list;
589
590 wxStringSplit( GetShownText( renderSettings, sheet, FOR_CANVAS ), strings_list, '\n' );
591 positions.reserve( strings_list.Count() );
592
593 if( renderSettings->m_Transform != TRANSFORM() || aOffset != VECTOR2I() )
594 {
595 SCH_TEXTBOX temp( *this );
596
597 if( renderSettings->m_Transform.y1 )
599
600 temp.SetStart( renderSettings->TransformCoordinate( m_start ) + aOffset );
601 temp.SetEnd( renderSettings->TransformCoordinate( m_end ) + aOffset );
602
603 attrs = temp.GetAttributes();
604 temp.GetLinePositions( renderSettings, positions, (int) strings_list.Count() );
605 }
606 else
607 {
608 attrs = GetAttributes();
609 GetLinePositions( renderSettings, positions, (int) strings_list.Count() );
610 }
611
612 attrs.m_StrokeWidth = penWidth;
613 attrs.m_Multiline = false;
614
615 for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
616 {
617 aPlotter->PlotText( positions[ii], color, strings_list.Item( ii ), attrs, font, GetFontMetrics() );
618 }
619
620 if( HasHyperlink() )
621 aPlotter->HyperlinkBox( GetBoundingBox(), GetHyperlink() );
622}
623
624
625void SCH_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
626{
627 // Don't use GetShownText() here; we want to show the user the variable references
628 aList.emplace_back( _( "Text Box" ), KIUI::EllipsizeStatusText( aFrame, GetText() ) );
629
630 SCH_ITEM::GetMsgPanelInfo( aFrame, aList );
631
633 aList.emplace_back( _( "Exclude from" ), _( "Simulation" ) );
634
635 aList.emplace_back( _( "Font" ), GetFont() ? GetFont()->GetName() : _( "Default" ) );
636
637 wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) };
638 int style = IsBold() && IsItalic() ? 3 : IsBold() ? 2 : IsItalic() ? 1 : 0;
639 aList.emplace_back( _( "Style" ), textStyle[style] );
640
641 aList.emplace_back( _( "Text Size" ), aFrame->MessageTextFromValue( GetTextWidth() ) );
642
643 aList.emplace_back( _( "Box Width" ), aFrame->MessageTextFromValue( std::abs( GetEnd().x - GetStart().x ) ) );
644
645 aList.emplace_back( _( "Box Height" ), aFrame->MessageTextFromValue( std::abs( GetEnd().y - GetStart().y ) ) );
646
647 m_stroke.GetMsgPanelInfo( aFrame, aList );
648}
649
650
651bool SCH_TEXTBOX::operator==( const SCH_ITEM& aOther ) const
652{
653 if( Type() != aOther.Type() )
654 return false;
655
656 const SCH_TEXTBOX& other = static_cast<const SCH_TEXTBOX&>( aOther );
657
659 return false;
660
661 if( GetMarginLeft() != other.GetMarginLeft() )
662 return false;
663
664 if( GetMarginTop() != other.GetMarginTop() )
665 return false;
666
667 if( GetMarginRight() != other.GetMarginRight() )
668 return false;
669
670 if( GetMarginBottom() != other.GetMarginBottom() )
671 return false;
672
673 return SCH_SHAPE::operator==( aOther ) && EDA_TEXT::operator==( other );
674}
675
676
677double SCH_TEXTBOX::Similarity( const SCH_ITEM& aOther ) const
678{
679 if( m_Uuid == aOther.m_Uuid )
680 return 1.0;
681
682 if( aOther.Type() != Type() )
683 return 0.0;
684
685 auto other = static_cast<const SCH_TEXTBOX&>( aOther );
686
687 double similarity = SimilarityBase( other );
688
689 if( m_excludedFromSim != other.m_excludedFromSim )
690 similarity *= 0.9;
691
692 if( GetMarginLeft() != other.GetMarginLeft() )
693 similarity *= 0.9;
694
695 if( GetMarginTop() != other.GetMarginTop() )
696 similarity *= 0.9;
697
698 if( GetMarginRight() != other.GetMarginRight() )
699 similarity *= 0.9;
700
701 if( GetMarginBottom() != other.GetMarginBottom() )
702 similarity *= 0.9;
703
704 similarity *= SCH_SHAPE::Similarity( aOther );
705 similarity *= EDA_TEXT::Similarity( other );
706
707 return similarity;
708}
709
710
711int SCH_TEXTBOX::compare( const SCH_ITEM& aOther, int aCompareFlags ) const
712{
713 wxASSERT( aOther.Type() == SCH_TEXTBOX_T || aOther.Type() == SCH_TABLECELL_T );
714
715 int retv = SCH_SHAPE::compare( aOther, aCompareFlags );
716
717 if( retv )
718 return retv;
719
720 const SCH_TEXTBOX* tmp = static_cast<const SCH_TEXTBOX*>( &aOther );
721
722 int result = GetText().CmpNoCase( tmp->GetText() );
723
724 if( result != 0 )
725 return result;
726
727 if( GetTextWidth() != tmp->GetTextWidth() )
728 return GetTextWidth() - tmp->GetTextWidth();
729
730 if( GetTextHeight() != tmp->GetTextHeight() )
731 return GetTextHeight() - tmp->GetTextHeight();
732
733 if( IsBold() != tmp->IsBold() )
734 return IsBold() - tmp->IsBold();
735
736 if( IsItalic() != tmp->IsItalic() )
737 return IsItalic() - tmp->IsItalic();
738
739 if( GetHorizJustify() != tmp->GetHorizJustify() )
740 return (int) GetHorizJustify() - (int) tmp->GetHorizJustify();
741
742 if( GetTextAngle().AsTenthsOfADegree() != tmp->GetTextAngle().AsTenthsOfADegree() )
744
745 if( GetMarginLeft() != tmp->GetMarginLeft() )
746 return GetMarginLeft() - tmp->GetMarginLeft();
747
748 if( GetMarginTop() != tmp->GetMarginTop() )
749 return GetMarginTop() - tmp->GetMarginTop();
750
751 if( GetMarginRight() != tmp->GetMarginRight() )
752 return GetMarginRight() - tmp->GetMarginRight();
753
754 if( GetMarginBottom() != tmp->GetMarginBottom() )
755 return GetMarginBottom() - tmp->GetMarginBottom();
756
757 return 0;
758}
759
760
761static struct SCH_TEXTBOX_DESC
762{
764 {
767
774
775 propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_SHAPE ), _HKI( "Shape" ) );
776 propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_SHAPE ), _HKI( "Corner Radius" ) );
777
778 propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Width" ) );
779 propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Height" ) );
780 propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Thickness" ) );
781
782 const wxString marginProps = _( "Margins" );
783
784 propMgr.AddProperty( new PROPERTY<SCH_TEXTBOX, int>( _HKI( "Margin Left" ),
786 marginProps );
787 propMgr.AddProperty( new PROPERTY<SCH_TEXTBOX, int>( _HKI( "Margin Top" ),
789 marginProps );
790 propMgr.AddProperty( new PROPERTY<SCH_TEXTBOX, int>( _HKI( "Margin Right" ),
792 marginProps );
793 propMgr.AddProperty( new PROPERTY<SCH_TEXTBOX, int>( _HKI( "Margin Bottom" ),
795 marginProps );
796
797 propMgr.AddProperty( new PROPERTY<SCH_TEXTBOX, int>( _HKI( "Text Size" ),
799 _HKI( "Text Properties" ) );
800
801 propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Orientation" ) );
802 }
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICOMMON_API KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
Definition api_enums.cpp:55
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:130
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:982
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:553
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
Definition box2.h:143
constexpr size_type GetHeight() const
Definition box2.h:212
constexpr coord_type GetLeft() const
Definition box2.h:225
constexpr bool Contains(const Vec &aPoint) const
Definition box2.h:165
constexpr coord_type GetRight() const
Definition box2.h:214
constexpr coord_type GetTop() const
Definition box2.h:226
constexpr bool Intersects(const BOX2< Vec > &aRect) const
Definition box2.h:308
constexpr coord_type GetBottom() const
Definition box2.h:219
static const COLOR4D WHITE
Definition color4d.h:403
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:400
int AsTenthsOfADegree() const
Definition eda_angle.h:117
The base class for create windows for drawing purpose.
const KIID m_Uuid
Definition eda_item.h:599
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
virtual void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:329
FILL_T GetFillMode() const
Definition eda_shape.h:148
void SetLineStyle(const LINE_STYLE aStyle)
void SetFillColor(const COLOR4D &aColor)
Definition eda_shape.h:160
VECTOR2I m_start
Definition eda_shape.h:752
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:325
LINE_STYLE GetLineStyle() const
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition eda_shape.h:275
COLOR4D GetFillColor() const
Definition eda_shape.h:159
VECTOR2I m_end
Definition eda_shape.h:753
virtual int GetWidth() const
Definition eda_shape.h:163
STROKE_PARAMS m_stroke
Definition eda_shape.h:739
virtual void SetWidth(int aWidth)
void SetFillMode(FILL_T aFill)
virtual void SetStart(const VECTOR2I &aStart)
Definition eda_shape.h:279
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:94
virtual VECTOR2I GetTextSize() const
Definition eda_text.h:301
COLOR4D GetTextColor() const
Definition eda_text.h:310
bool IsItalic() const
Definition eda_text.h:200
bool IsMultilineAllowed() const
Definition eda_text.h:236
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:118
bool IsKeepUpright() const
Definition eda_text.h:245
virtual int GetTextHeight() const
Definition eda_text.h:307
KIFONT::FONT * GetFont() const
Definition eda_text.h:286
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
Definition eda_text.cpp:394
wxString m_hyperlink
A hyperlink URL.
Definition eda_text.h:508
BOX2I GetTextBox(const RENDER_SETTINGS *aSettings, int aLine=-1) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition eda_text.cpp:754
virtual bool HasHyperlink() const
Definition eda_text.h:448
virtual wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition eda_text.h:128
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
Definition eda_text.cpp:378
wxString GetHyperlink() const
Definition eda_text.h:449
virtual int GetTextWidth() const
Definition eda_text.h:304
GR_TEXT_H_ALIGN_T GetHorizJustify() const
Definition eda_text.h:239
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
Definition eda_text.h:139
bool containsURL() const
EDA_TEXT(const EDA_IU_SCALE &aIuScale, const wxString &aText=wxEmptyString)
Definition eda_text.cpp:98
wxString m_activeUrl
Definition eda_text.h:510
double GetLineSpacing() const
Definition eda_text.h:298
double Similarity(const EDA_TEXT &aOther) const
virtual EDA_ANGLE GetTextAngle() const
Definition eda_text.h:178
const TEXT_ATTRIBUTES & GetAttributes() const
Definition eda_text.h:270
bool IsMirrored() const
Definition eda_text.h:229
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
Definition eda_text.cpp:427
void SwapAttributes(EDA_TEXT &aTradingPartner)
Swap the text attributes of the two involved instances.
Definition eda_text.cpp:414
double GetTextAngleDegrees() const
Definition eda_text.h:185
void GetLinePositions(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
Definition eda_text.cpp:931
bool IsBold() const
Definition eda_text.h:215
GR_TEXT_V_ALIGN_T GetVertJustify() const
Definition eda_text.h:242
virtual int GetTextThickness() const
Definition eda_text.h:159
virtual void SetText(const wxString &aText)
Definition eda_text.cpp:236
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
Definition eda_text.cpp:268
void SwapText(EDA_TEXT &aTradingPartner)
Definition eda_text.cpp:406
bool operator==(const EDA_TEXT &aRhs) const
Definition eda_text.h:444
void SetMultilineAllowed(bool aAllow)
Definition eda_text.cpp:362
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition eda_text.cpp:370
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:94
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
Definition font.cpp:143
void LinebreakText(wxString &aText, int aColumnWidth, const VECTOR2I &aGlyphSize, int aThickness, bool aBold, bool aItalic) const
Insert characters into text to ensure that no lines are wider than aColumnWidth.
Definition font.cpp:609
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
std::shared_ptr< wxString > m_text
Definition color4d.h:397
COLOR4D & Desaturate()
Removes color (in HSL model)
Definition color4d.cpp:530
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition color4d.h:293
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Definition kiid.h:46
Base plotter engine class.
Definition plotter.h:136
virtual void HyperlinkBox(const BOX2I &aBox, const wxString &aDestinationURL)
Create a clickable hyperlink with a rectangular click area.
Definition plotter.h:510
bool GetColorMode() const
Definition plotter.h:164
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont=nullptr, const KIFONT::METRICS &aFontMetrics=KIFONT::METRICS::Default(), void *aData=nullptr)
Definition plotter.cpp:617
Provide class metadata.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
SCH_SHEET_PATH & CurrentSheet() const
Definition schematic.h:304
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.
void SetLocked(bool aLocked) override
Definition sch_item.h:262
const wxString & GetDefaultFont(const KIGFX::RENDER_SETTINGS *aSettings) const
Definition sch_item.cpp:999
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
Definition sch_item.cpp:46
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:302
bool IsLocked() const override
Definition sch_item.cpp:179
bool IsPrivate() const
Definition sch_item.h:259
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition sch_item.h:353
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:65
wxString ResolveText(const wxString &aText, const SCH_SHEET_PATH *aPath, int aDepth=0) const
Definition sch_item.cpp:464
const KIFONT::METRICS & GetFontMetrics() const
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
SCH_LAYER_ID m_layer
Definition sch_item.h:838
double SimilarityBase(const SCH_ITEM &aItem) const
Calculate the boilerplate similarity for all LIB_ITEMs without preventing the use above of a pure vir...
Definition sch_item.h:398
Handle actions specific to the schematic editor.
void HypertextCommand(const wxString &aHref)
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
void SetPosition(const VECTOR2I &aPos) override
Definition sch_shape.h:87
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition sch_shape.cpp:90
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
SCH_SHAPE(SHAPE_T aShape=SHAPE_T::UNDEFINED, SCH_LAYER_ID aLayer=LAYER_NOTES, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, KICAD_T aType=SCH_SHAPE_T)
Definition sch_shape.cpp:42
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool operator==(const SCH_ITEM &aOther) const override
STROKE_PARAMS GetStroke() const override
Definition sch_shape.h:57
VECTOR2I GetPosition() const override
Definition sch_shape.h:86
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
void SetMarginBottom(int aBottom)
Definition sch_textbox.h:77
int GetMarginBottom() const
Definition sch_textbox.h:82
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool m_excludedFromSim
bool operator==(const SCH_ITEM &aOther) const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
int GetLegacyTextMargin() const
int GetMarginLeft() const
Definition sch_textbox.h:79
int GetSchTextSize() const
Definition sch_textbox.h:84
bool GetExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
virtual wxString GetShownText(const RENDER_SETTINGS *aSettings, const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const
int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool operator<(const SCH_ITEM &aItem) const override
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
bool HasHypertext() const override
Indicates that the item has at least one hypertext action.
VECTOR2I GetDrawPos() const override
int GetMarginRight() const
Definition sch_textbox.h:81
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
VECTOR2I GetMinSize() const
Return the minimum height needed to contain the textbox's wrapped text content plus margins.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
bool HasHoveredHypertext() const override
Indicates that a hypertext link is currently active.
int GetMarginTop() const
Definition sch_textbox.h:80
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
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.
void SetMarginLeft(int aLeft)
Definition sch_textbox.h:74
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void DoHypertextAction(EDA_DRAW_FRAME *aFrame, const VECTOR2I &aMousePos) const override
virtual void Rotate90(bool aClockwise)
void SetMarginRight(int aRight)
Definition sch_textbox.h:76
void SetSchTextSize(int aSize)
Definition sch_textbox.h:85
KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const override
SCH_TEXTBOX(SCH_LAYER_ID aLayer=LAYER_NOTES, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXTBOX_T)
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void SetExcludedFromSim(bool aExclude, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
void SetMarginTop(int aTop)
Definition sch_textbox.h:75
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
KIGFX::COLOR4D GetColor() const
KIGFX::COLOR4D m_Color
EDA_ORIENTATION m_Angle
GR_TEXT_H_ALIGN_T m_Halign
GR_TEXT_V_ALIGN_T m_Valign
KIFONT::FONT * m_Font
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
T * GetTool()
Return the tool of given type or nullptr if there is no such tool registered.
for transforming drawing coordinates for a wxDC device context.
Definition transform.h:42
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
void FinalizeTextVarExpansion(wxString &aText, RESOLUTION_CONTEXT aContext)
Definition common.cpp:88
wxString ResolveTextVars(const wxString &aSource, const std::function< bool(wxString *)> *aResolver, int &aDepth)
Multi-pass text variable expansion and math expression evaluation.
Definition common.cpp:333
RESOLUTION_CONTEXT
Definition common.h:89
@ FOR_GUI
Definition common.h:91
@ FOR_CANVAS
Definition common.h:90
@ RAW_VALUE
Definition common.h:96
#define _(s)
@ DEGREES_T
Definition eda_angle.h:30
static constexpr EDA_ANGLE ANGLE_VERTICAL
Definition eda_angle.h:445
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
Definition eda_angle.h:444
FILL_T
Definition eda_fill.h:29
SHAPE_T
Definition eda_shape.h:54
a few functions useful in geometry calculations.
SCH_LAYER_ID
Eeschema drawing layers.
Definition layer_ids.h:471
@ LAYER_DEVICE
Definition layer_ids.h:488
Message panel definition file.
bool BoxHitTest(const VECTOR2I &aHitPoint, const BOX2I &aHittee, int aAccuracy)
Perform a point-to-box hit test.
KICOMMON_API wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
KICOMMON_API wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
KICOMMON_API void PackColor(types::Color &aOutput, const KIGFX::COLOR4D &aInput)
KICOMMON_API int UnpackDistance(const types::Distance &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API KIGFX::COLOR4D UnpackColor(const types::Color &aInput)
KICOMMON_API void PackCustomProperties(google::protobuf::RepeatedPtrField< types::CustomProperty > *aOutput, const EDA_ITEM &aItem)
KICOMMON_API VECTOR2I UnpackVector2(const types::Vector2 &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackDistance(types::Distance &aOutput, int aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackVector2(types::Vector2 &aOutput, const VECTOR2I &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void UnpackCustomProperties(const google::protobuf::RepeatedPtrField< types::CustomProperty > &aInput, EDA_ITEM &aItem)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:437
#define _HKI(x)
Definition page_info.cpp:40
see class PGM_BASE
#define TYPE_HASH(x)
Macro to generate unique identifier for a type.
Definition property.h:74
@ PT_SIZE
Size expressed in distance units (mm/inch)
Definition property.h:63
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names.
static struct SCH_TEXTBOX_DESC _SCH_TEXTBOX_DESC
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
wxString result
Test unit parsing edge cases and error handling.
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ SCH_TABLECELL_T
Definition typeinfo.h:162
@ SCH_TEXTBOX_T
Definition typeinfo.h:148
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708