KiCad PCB EDA Suite
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 (C) 2022 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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <base_units.h>
25#include <pgm_base.h>
26#include <sch_edit_frame.h>
27#include <plotters/plotter.h>
28#include <widgets/msgpanel.h>
29#include <bitmaps.h>
30#include <string_utils.h>
31#include <schematic.h>
33#include <sch_painter.h>
34#include <wx/log.h>
38#include <core/kicad_algo.h>
39#include <trigo.h>
40#include <sch_textbox.h>
42
44
45
46SCH_TEXTBOX::SCH_TEXTBOX( int aLineWidth, FILL_T aFillType, const wxString& text ) :
47 SCH_SHAPE( SHAPE_T::RECT, aLineWidth, aFillType, SCH_TEXTBOX_T ),
49{
51
54 SetMultilineAllowed( true );
55}
56
57
59 SCH_SHAPE( aText ),
60 EDA_TEXT( aText )
61{ }
62
63
65{
66 return KiROUND( GetStroke().GetWidth() / 2.0 ) + KiROUND( GetTextSize().y * 0.75 );
67}
68
69
71{
72 // Text is NOT really mirrored; it just has its justification flipped
74 {
75 switch( GetHorizJustify() )
76 {
78 case GR_TEXT_H_ALIGN_CENTER: break;
80 }
81 }
82}
83
84
86{
87 // Text is NOT really mirrored; it just has its justification flipped
89 {
90 switch( GetHorizJustify() )
91 {
93 case GR_TEXT_H_ALIGN_CENTER: break;
95 }
96 }
97}
98
99
100void SCH_TEXTBOX::Rotate( const VECTOR2I& aCenter )
101{
102 SCH_SHAPE::Rotate( aCenter );
104}
105
106
107void SCH_TEXTBOX::Rotate90( bool aClockwise )
108{
110}
111
112
114{
115 int margin = GetTextMargin();
116 BOX2I bbox( m_start, m_end - m_start );
117
118 bbox.Normalize();
119
120 VECTOR2I pos( bbox.GetLeft() + margin, bbox.GetBottom() - margin );
121
123 {
124 switch( GetHorizJustify() )
125 {
127 pos.y = bbox.GetBottom() - margin;
128 break;
130 pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2;
131 break;
133 pos.y = bbox.GetTop() + margin;
134 break;
135 }
136
137 switch( GetVertJustify() )
138 {
140 pos.x = bbox.GetLeft() + margin;
141 break;
143 pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2;
144 break;
146 pos.x = bbox.GetRight() - margin;
147 break;
148 }
149 }
150 else
151 {
152 switch( GetHorizJustify() )
153 {
155 pos.x = bbox.GetLeft() + margin;
156 break;
158 pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2;
159 break;
161 pos.x = bbox.GetRight() - margin;
162 break;
163 }
164
165 switch( GetVertJustify() )
166 {
168 pos.y = bbox.GetTop() + margin;
169 break;
171 pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2;
172 break;
174 pos.y = bbox.GetBottom() - margin;
175 break;
176 }
177 }
178
179 return pos;
180}
181
182
184{
185 SCH_TEXTBOX* item = static_cast<SCH_TEXTBOX*>( aItem );
186
187 std::swap( m_layer, item->m_layer );
188
189 SwapText( *item );
190 SwapAttributes( *item );
191
192 SCH_SHAPE::SwapData( aItem );
193}
194
195
196bool SCH_TEXTBOX::operator<( const SCH_ITEM& aItem ) const
197{
198 if( Type() != aItem.Type() )
199 return Type() < aItem.Type();
200
201 auto other = static_cast<const SCH_TEXTBOX*>( &aItem );
202
203 if( GetLayer() != other->GetLayer() )
204 return GetLayer() < other->GetLayer();
205
206 if( GetPosition().x != other->GetPosition().x )
207 return GetPosition().x < other->GetPosition().x;
208
209 if( GetPosition().y != other->GetPosition().y )
210 return GetPosition().y < other->GetPosition().y;
211
212 return GetText() < other->GetText();
213}
214
215
217{
219
220 if( !font )
222
223 return font;
224}
225
226
227void SCH_TEXTBOX::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
228{
229 wxDC* DC = aSettings->GetPrintDC();
230 int penWidth = GetPenWidth();
231 bool blackAndWhiteMode = GetGRForceBlackPenState();
232 VECTOR2I pt1 = GetStart();
233 VECTOR2I pt2 = GetEnd();
235 PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle();
236
237 if( GetFillMode() == FILL_T::FILLED_WITH_COLOR && !blackAndWhiteMode )
238 GRFilledRect( DC, pt1, pt2, 0, GetFillColor(), GetFillColor() );
239
240 if( penWidth > 0 )
241 {
242 penWidth = std::max( penWidth, aSettings->GetMinPenWidth() );
243
244 if( blackAndWhiteMode || color == COLOR4D::UNSPECIFIED )
245 color = aSettings->GetLayerColor( m_layer );
246
247 if( lineStyle == PLOT_DASH_TYPE::DEFAULT )
248 lineStyle = PLOT_DASH_TYPE::SOLID;
249
250 if( lineStyle == PLOT_DASH_TYPE::SOLID )
251 {
252 GRRect( DC, pt1, pt2, penWidth, color );
253 }
254 else
255 {
256 std::vector<SHAPE*> shapes = MakeEffectiveShapes( true );
257
258 for( SHAPE* shape : shapes )
259 {
260 STROKE_PARAMS::Stroke( shape, lineStyle, penWidth, aSettings,
261 [&]( const VECTOR2I& a, const VECTOR2I& b )
262 {
263 GRLine( DC, a.x, a.y, b.x, b.y, penWidth, color );
264 } );
265 }
266
267 for( SHAPE* shape : shapes )
268 delete shape;
269 }
270 }
271
273
274 if( blackAndWhiteMode || color == COLOR4D::UNSPECIFIED )
275 color = aSettings->GetLayerColor( m_layer );
276
277 EDA_TEXT::Print( aSettings, aOffset, color );
278}
279
280
281wxString SCH_TEXTBOX::GetShownText( int aDepth, bool aAllowExtraText ) const
282{
283 std::function<bool( wxString* )> textResolver =
284 [&]( wxString* token ) -> bool
285 {
286 if( SCH_SHEET* sheet = Schematic()->CurrentSheet().Last() )
287 {
288 if( sheet->ResolveTextVar( token, aDepth + 1 ) )
289 return true;
290 }
291
292 return false;
293 };
294
295 wxString text = EDA_TEXT::GetShownText();
296
297 if( HasTextVars() )
298 {
299 if( aDepth < 10 )
300 text = ExpandTextVars( text, &textResolver );
301 }
302
303 KIFONT::FONT* font = GetFont();
304
305 if( !font )
307
308 VECTOR2D size = GetEnd() - GetStart();
309 int colWidth = GetTextAngle() == ANGLE_HORIZONTAL ? size.x : size.y;
310
311 colWidth = abs( colWidth ) - GetTextMargin() * 2;
312 font->LinebreakText( text, colWidth, GetTextSize(), GetTextThickness(), IsBold(), IsItalic() );
313
314 return text;
315}
316
317
318bool SCH_TEXTBOX::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
319{
320 BOX2I rect = GetBoundingBox();
321
322 rect.Inflate( aAccuracy );
323
324 return rect.Contains( aPosition );
325}
326
327
328bool SCH_TEXTBOX::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
329{
330 BOX2I rect = aRect;
331
332 rect.Inflate( aAccuracy );
333
334 if( aContained )
335 return rect.Contains( GetBoundingBox() );
336
337 return rect.Intersects( GetBoundingBox() );
338}
339
340
342{
343 wxCHECK_MSG( IsHypertext(), /* void */,
344 "Calling a hypertext menu on a SCH_TEXTBOX with no hyperlink?" );
345
347 navTool->HypertextCommand( m_hyperlink );
348}
349
350
351wxString SCH_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
352{
353 return wxString::Format( _( "Graphic Text Box" ) );
354}
355
356
358{
360}
361
362
363void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground ) const
364{
365 if( aBackground )
366 {
367 SCH_SHAPE::Plot( aPlotter, aBackground );
368 return;
369 }
370
371 RENDER_SETTINGS* settings = aPlotter->RenderSettings();
372 int penWidth = GetPenWidth();
374 PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle();
375
376 if( penWidth > 0 )
377 {
378 penWidth = std::max( penWidth, settings->GetMinPenWidth() );
379
380 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
381 color = settings->GetLayerColor( m_layer );
382
383 if( lineStyle == PLOT_DASH_TYPE::DEFAULT )
384 lineStyle = PLOT_DASH_TYPE::SOLID;
385
386 aPlotter->SetColor( color );
387 aPlotter->SetDash( penWidth, lineStyle );
388 aPlotter->Rect( m_start, m_end, FILL_T::NO_FILL, penWidth );
389 aPlotter->SetDash( penWidth, PLOT_DASH_TYPE::SOLID );
390 }
391
392 KIFONT::FONT* font = GetFont();
393
394 if( !font )
395 font = KIFONT::FONT::GetFont( settings->GetDefaultFont(), IsBold(), IsItalic() );
396
398
399 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
400 color = settings->GetLayerColor( m_layer );
401
402 penWidth = GetEffectiveTextPenWidth( settings->GetDefaultPenWidth() );
403 penWidth = std::max( penWidth, settings->GetMinPenWidth() );
404 aPlotter->SetCurrentLineWidth( penWidth );
405
406 std::vector<VECTOR2I> positions;
407 wxArrayString strings_list;
408 wxStringSplit( GetShownText(), strings_list, '\n' );
409 positions.reserve( strings_list.Count() );
410
411 GetLinePositions( positions, (int) strings_list.Count() );
412
414 attrs.m_StrokeWidth = penWidth;
415 attrs.m_Multiline = false;
416
417 for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
418 {
419 aPlotter->PlotText( positions[ii], color, strings_list.Item( ii ), attrs, font );
420 }
421
422 if( HasHyperlink() )
423 aPlotter->HyperlinkBox( GetBoundingBox(), GetHyperlink() );
424}
425
426
427void SCH_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
428{
429 // Don't use GetShownText() here; we want to show the user the variable references
430 aList.emplace_back( _( "Text Box" ), KIUI::EllipsizeStatusText( aFrame, GetText() ) );
431
432 aList.emplace_back( _( "Font" ), GetFont() ? GetFont()->GetName() : _( "Default" ) );
433
434 wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) };
435 int style = IsBold() && IsItalic() ? 3 : IsBold() ? 2 : IsItalic() ? 1 : 0;
436 aList.emplace_back( _( "Style" ), textStyle[style] );
437
438 aList.emplace_back( _( "Text Size" ), aFrame->MessageTextFromValue( GetTextWidth() ) );
439
440 aList.emplace_back( _( "Box Width" ),
441 aFrame->MessageTextFromValue( std::abs( GetEnd().x - GetStart().x ) ) );
442
443 aList.emplace_back( _( "Box Height" ),
444 aFrame->MessageTextFromValue( std::abs( GetEnd().y - GetStart().y ) ) );
445
446 m_stroke.GetMsgPanelInfo( aFrame, aList );
447}
int color
Definition: DXF_plotter.cpp:57
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
Definition: box2.h:119
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:269
coord_type GetTop() const
Definition: box2.h:194
bool Contains(const Vec &aPoint) const
Definition: box2.h:141
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:506
coord_type GetRight() const
Definition: box2.h:189
coord_type GetLeft() const
Definition: box2.h:193
coord_type GetBottom() const
Definition: box2.h:190
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
FILL_T GetFillMode() const
Definition: eda_shape.h:101
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
Definition: eda_shape.h:289
VECTOR2I m_start
Definition: eda_shape.h:369
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:145
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition: eda_shape.h:120
COLOR4D GetFillColor() const
Definition: eda_shape.h:105
int GetWidth() const
Definition: eda_shape.h:109
VECTOR2I m_end
Definition: eda_shape.h:370
STROKE_PARAMS m_stroke
Definition: eda_shape.h:365
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
COLOR4D GetTextColor() const
Definition: eda_text.h:205
bool IsItalic() const
Definition: eda_text.h:130
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:120
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:87
KIFONT::FONT * GetFont() const
Definition: eda_text.h:188
wxString m_hyperlink
A hyperlink URL.
Definition: eda_text.h:386
int GetTextWidth() const
Definition: eda_text.h:199
virtual bool HasHyperlink() const
Definition: eda_text.h:333
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
Definition: eda_text.cpp:250
wxString GetHyperlink() const
Definition: eda_text.h:334
GR_TEXT_H_ALIGN_T GetHorizJustify() const
Definition: eda_text.h:149
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
Definition: eda_text.h:103
void GetLinePositions(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:673
const TEXT_ATTRIBUTES & GetAttributes() const
Definition: eda_text.h:172
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
Definition: eda_text.cpp:299
void SwapAttributes(EDA_TEXT &aTradingPartner)
Swap the text attributes of the two involved instances.
Definition: eda_text.cpp:286
bool IsBold() const
Definition: eda_text.h:133
GR_TEXT_V_ALIGN_T GetVertJustify() const
Definition: eda_text.h:152
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
Definition: eda_text.cpp:195
int GetTextThickness() const
Definition: eda_text.h:112
virtual wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:98
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor, OUTLINE_MODE aDisplay_mode=FILLED)
Print this text object to the device context aDC.
Definition: eda_text.cpp:650
void SwapText(EDA_TEXT &aTradingPartner)
Definition: eda_text.cpp:275
void SetMultilineAllowed(bool aAllow)
Definition: eda_text.cpp:234
VECTOR2I GetTextSize() const
Definition: eda_text.h:196
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition: eda_text.cpp:242
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:105
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
Definition: font.cpp:138
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:509
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:102
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
const wxString & GetDefaultFont() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
Store schematic specific render settings.
Definition: sch_painter.h:71
Base plotter engine class.
Definition: plotter.h:110
virtual void SetDash(int aLineWidth, PLOT_DASH_TYPE aLineStyle)=0
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:141
virtual void HyperlinkBox(const BOX2I &aBox, const wxString &aDestinationURL)
Create a clickable hyperlink with a rectangular click area.
Definition: plotter.h:455
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr)
Definition: plotter.cpp:758
bool GetColorMode() const
Definition: plotter.h:138
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetColor(const COLOR4D &color)=0
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:122
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
const wxString & GetDefaultFont() const
Definition: sch_item.cpp:286
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:112
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:246
SCH_LAYER_ID m_layer
Definition: sch_item.h:491
Handle actions specific to the schematic editor.
void HypertextCommand(const wxString &href)
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_shape.cpp:52
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_shape.h:75
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_shape.cpp:106
void Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
Definition: sch_shape.cpp:112
int GetPenWidth() const override
Definition: sch_shape.cpp:226
STROKE_PARAMS GetStroke() const override
Definition: sch_shape.h:64
VECTOR2I GetPosition() const override
Definition: sch_shape.h:77
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:57
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_textbox.cpp:70
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool operator<(const SCH_ITEM &aItem) const override
int GetTextMargin() const
Definition: sch_textbox.cpp:64
SCH_TEXTBOX(int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, const wxString &aText=wxEmptyString)
Definition: sch_textbox.cpp:46
VECTOR2I GetDrawPos() const override
bool IsHypertext() const override
Allow items to support hypertext actions when hovered/clicked.
Definition: sch_textbox.h:60
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.
virtual void Rotate90(bool aClockwise)
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &offset) override
Print a schematic item.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_textbox.cpp:85
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
KIFONT::FONT * getDrawFont() const override
void DoHypertextAction(EDA_DRAW_FRAME *aFrame) const override
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
An abstract shape on 2D plane.
Definition: shape.h:124
void GetMsgPanelInfo(UNITS_PROVIDER *aUnitsProvider, std::vector< MSG_PANEL_ITEM > &aList, bool aIncludeStyle=true, bool aIncludeWidth=true)
static void Stroke(const SHAPE *aShape, PLOT_DASH_TYPE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, std::function< void(const VECTOR2I &a, const VECTOR2I &b)> aStroker)
KIGFX::COLOR4D GetColor() const
PLOT_DASH_TYPE GetPlotStyle() const
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
Definition: common.cpp:58
#define _(s)
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
Definition: eda_angle.h:425
static constexpr EDA_ANGLE & ANGLE_VERTICAL
Definition: eda_angle.h:426
SHAPE_T
Definition: eda_shape.h:41
FILL_T
Definition: eda_shape.h:54
@ FILLED_WITH_COLOR
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:396
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:171
void GRFilledRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Definition: gr_basic.cpp:403
bool GetGRForceBlackPenState(void)
Definition: gr_basic.cpp:165
@ LAYER_NOTES
Definition: layer_ids.h:358
Message panel definition file.
wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
Definition: ui_common.cpp:197
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:418
see class PGM_BASE
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
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
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
PLOT_DASH_TYPE
Dashed line types.
Definition: stroke_params.h:48
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
@ SCH_TEXTBOX_T
Definition: typeinfo.h:149
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:85