KiCad PCB EDA Suite
properties_frame.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) 2013 CERN
5 * Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <project.h>
27#include <scintilla_tricks.h>
29#include <widgets/font_choice.h>
31#include <tool/tool_manager.h>
35#include <view/view.h>
36#include <bitmaps.h>
37
38#include "properties_frame.h"
39#include "pl_editor_frame.h"
41
43
44
50#define DLG_MIN_TEXTSIZE 0.01
51#define DLG_MAX_TEXTSIZE 100.0
52
53
55 PANEL_PROPERTIES_BASE( aParent ),
56 m_scintillaTricks( nullptr ),
57 m_textSizeX( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX, m_textSizeXUnits ),
58 m_textSizeY( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY, m_textSizeYUnits ),
59 m_constraintX( aParent, m_constraintXLabel, m_constraintXCtrl, m_constraintXUnits ),
60 m_constraintY( aParent, m_constraintYLabel, m_constraintYCtrl, m_constraintYUnits ),
61 m_textPosX( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ),
62 m_textPosY( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ),
63 m_textEndX( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ),
64 m_textEndY( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ),
65 m_textStepX( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ),
66 m_textStepY( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ),
67 m_defaultTextSizeX( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX,
68 m_defaultTextSizeXUnits ),
69 m_defaultTextSizeY( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY,
70 m_defaultTextSizeYUnits ),
71 m_defaultLineWidth( aParent, m_defaultLineWidthLabel, m_defaultLineWidthCtrl,
72 m_defaultLineWidthUnits ),
73 m_defaultTextThickness( aParent, m_defaultTextThicknessLabel, m_defaultTextThicknessCtrl,
74 m_defaultTextThicknessUnits ),
75 m_textLeftMargin( aParent, m_leftMarginLabel, m_leftMarginCtrl, m_leftMarginUnits ),
76 m_textRightMargin( aParent, m_rightMarginLabel, m_rightMarginCtrl, m_rightMarginUnits ),
77 m_textTopMargin( aParent, m_topMarginLabel, m_topMarginCtrl, m_topMarginUnits ),
78 m_textBottomMargin( aParent, m_bottomMarginLabel, m_bottomMarginCtrl, m_bottomMarginUnits ),
79 m_lineWidth( aParent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits )
80{
81 m_parent = aParent;
82
83 m_stcText->SetUseVerticalScrollBar( false );
84 m_stcText->SetUseHorizontalScrollBar( false );
85 m_stcText->SetEOLMode( wxSTC_EOL_LF ); // Always use LF as eol char, regardless the platform
86 m_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ), false );
87
88 m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() );
89
94
96
103
105
112
114
115 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
117
118 m_buttonOK->SetDefault();
119
120 // ensure sizers are up to date
121 // (fix an issue on GTK but should not create issues on other platforms):
122 m_swItemProperties->Fit();
123 m_swGeneralOpts->Fit();
124
125 m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
126 m_stcText->Bind( wxEVT_STC_AUTOCOMP_CHAR_DELETED, &PROPERTIES_FRAME::onScintillaCharAdded,
127 this );
128 m_alignLeft->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
129 m_alignCenter->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
130 m_alignRight->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
131 m_vAlignTop->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
132 m_vAlignMiddle->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
133 m_vAlignBottom->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
134}
135
136
138{
139 delete m_scintillaTricks;
140}
141
142
143void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
144{
145 if( event.GetSelection() == 0 )
146 m_buttonOK->SetDefault();
147 else
148 m_buttonGeneralOptsOK->SetDefault();
149
150 event.Skip();
151}
152
153
155{
156 return wxSize( 150, -1 );
157}
158
159
161{
162 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
164
165 // Set default parameters
168
175
184}
185
186
188{
189 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
191
192 // Import default parameters from widgets
193 bool is_valid = m_defaultLineWidth.Validate( 0.0, 10.0, EDA_UNITS::MILLIMETRES );
194
195 if( is_valid )
198
201 if( is_valid )
204
207
208 if( is_valid )
211
213
214 if( is_valid )
217
218 // Get page margins values
227
228 return true;
229}
230
231
233{
234 if( !aItem )
235 {
236 m_SizerItemProperties->Show( false );
237 return;
238 }
239
240 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
241 wxString msg;
242
243 // Set parameters common to all DS_DATA_ITEM types
244 m_staticTextType->SetLabel( aItem->GetClassName() );
245 m_textCtrlComment->SetValue( aItem->m_Info );
246
247 switch( aItem->GetPage1Option() )
248 {
249 default:
250 case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
251 case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
252 case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
253 }
254
255 // Position/ start point
257 aItem->m_Pos.m_Pos.x ) );
259 aItem->m_Pos.m_Pos.y ) );
260
261 switch( aItem->m_Pos.m_Anchor )
262 {
263 case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
264 case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
265 case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
266 case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
267 }
268
269 // End point
271 aItem->m_End.m_Pos.x ) );
273 aItem->m_End.m_Pos.y ) );
274
275 switch( aItem->m_End.m_Anchor )
276 {
277 case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
278 case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
279 case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
280 case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
281 }
282
284 aItem->m_LineWidth ) );
285
286 // Now, set prms more specific to DS_DATA_ITEM types
287 // For a given type, disable widgets which are not relevant,
288 // and be sure widgets which are relevant are enabled
289 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
290 {
291 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
292 item->m_FullText = item->m_TextBase;
293
294 // Replace our '\' 'n' sequence by the EOL char
296 m_stcText->SetValue( item->m_FullText );
297 m_stcText->EmptyUndoBuffer();
298
299 msg.Printf( wxT( "%d" ), item->m_IncrementLabel );
300 m_textCtrlTextIncrement->SetValue( msg );
301
302 // Rotation (poly and text)
303 msg.Printf( wxT( "%.3f" ), item->m_Orient );
304 m_textCtrlRotation->SetValue( msg );
305
306 // Constraints:
308 item->m_BoundingBoxSize.x ) );
310 item->m_BoundingBoxSize.y ) );
311
312 // Font Options
314
315 m_bold->Check( item->m_Bold );
316 m_italic->Check( item->m_Italic );
317
319
321 btn->Check( false );
322
323 switch( item->m_Hjustify )
324 {
325 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check(); break;
328 }
329
331 btn->Check( false );
332
333 switch( item->m_Vjustify )
334 {
335 case GR_TEXT_V_ALIGN_TOP: m_vAlignTop->Check(); break;
338 }
339
340 // Text size
342 item->m_TextSize.x ) );
344 item->m_TextSize.y ) );
345 }
346
347 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
348 {
349 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
350
351 // Rotation (poly and text)
352 msg.Printf( wxT( "%.3f" ), item->m_Orient.AsDegrees() );
353 m_textCtrlRotation->SetValue( msg );
354 }
355
356 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
357 {
358 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
359
360 // select definition in PPI
361 msg.Printf( wxT( "%d" ), item->GetPPI() );
362 m_textCtrlBitmapDPI->SetValue( msg );
363 }
364
365 m_SizerItemProperties->Show( true );
366
368 m_buttonHelp->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
369
371 || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
372
374
375 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
377 {
378 m_staticTextRot->Show( true );
379 m_textCtrlRotation->Show( true );
380 }
381 else
382 {
383 m_staticTextRot->Show( false );
384 m_textCtrlRotation->Show( false );
385 }
386
389
392
393 // Repeat parameters
394 msg.Printf( wxT( "%d" ), aItem->m_RepeatCount );
395 m_textCtrlRepeatCount->SetValue( msg );
396
398 aItem->m_IncrementVector.x ) );
400 aItem->m_IncrementVector.y ) );
401
402 // The number of widgets was modified, so recalculate sizers
403 m_swItemProperties->Layout();
404
405#ifdef __WXGTK__
406 // This call is mandatory on wxGTK to initialize the right virtual size and therefore
407 // scrollbars, but for some reason, create issues on Windows (incorrect display
408 // until the frame is resized). Joys of multiplatform dev.
409 m_swItemProperties->Fit();
410#endif
411
412 // send a size event to be sure scrollbars will be added/removed as needed
413 m_swItemProperties->PostSizeEvent();
414 m_swItemProperties->Refresh();
415}
416
417
418void PROPERTIES_FRAME::onHAlignButton( wxCommandEvent& aEvent )
419{
421 {
422 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
423 btn->Check( false );
424 }
425}
426
427
428void PROPERTIES_FRAME::onVAlignButton( wxCommandEvent& aEvent )
429{
431 {
432 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
433 btn->Check( false );
434 }
435}
436
437
438void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
439{
441 PL_SELECTION& selection = selTool->GetSelection();
442
444
445 DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
446
447 if( drawItem )
448 {
449 DS_DATA_ITEM* dataItem = drawItem->GetPeer();
450 CopyPrmsFromPanelToItem( dataItem );
451
452 // Be sure what is displayed is what is set for item
453 // (mainly, texts can be modified if they contain "\n")
454 CopyPrmsFromItemToPanel( dataItem );
455 m_parent->GetCanvas()->GetView()->Update( drawItem );
456 }
457
459
460 // Refresh values, exactly as they are converted, to avoid any mistake
462
464
465 // Rebuild the draw list with the new parameters
468}
469
470
471void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
472{
474
476 model.m_DefaultLineWidth = 0.15;
477 model.m_DefaultTextThickness = 0.15;
478
480
481 // Rebuild the draw list with the new parameters
484}
485
486
488{
489 if( aItem == nullptr )
490 return false;
491
492 const EDA_UNITS units = EDA_UNITS::MILLIMETRES;
493 wxString msg;
494
495 // Import common parameters:
496 aItem->m_Info = m_textCtrlComment->GetValue();
497
498 switch( m_choicePageOpt->GetSelection() )
499 {
500 default:
501 case 0: aItem->SetPage1Option( ALL_PAGES ); break;
502 case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
503 case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
504 }
505
506 // Import thickness
507 bool is_valid = m_lineWidth.Validate( 0.0, 10.0, EDA_UNITS::MILLIMETRES );
508
509 if( is_valid )
510 aItem->m_LineWidth =
512
513 // Import Start point
514 aItem->m_Pos.m_Pos.x =
516 aItem->m_Pos.m_Pos.y =
518
519 switch( m_comboBoxCornerPos->GetSelection() )
520 {
521 case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
522 case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
523 case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
524 case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
525 }
526
527 // Import End point
528 aItem->m_End.m_Pos.x =
530 aItem->m_End.m_Pos.y =
532
533 switch( m_comboBoxCornerEnd->GetSelection() )
534 {
535 case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
536 case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
537 case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
538 case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
539 }
540
541 // Import Repeat prms
542 long itmp;
543 msg = m_textCtrlRepeatCount->GetValue();
544 msg.ToLong( &itmp );
545
546 // Ensure m_RepeatCount is > 0. Otherwise it create issues because a repeat
547 // count < 1 make no sense
548 if( itmp < 1l )
549 {
550 itmp = 1;
551 msg.Printf( wxT( "%ld" ), itmp );
552 m_textCtrlRepeatCount->SetValue( msg );
553 }
554
555 aItem->m_RepeatCount = itmp;
556
557 aItem->m_IncrementVector.x =
559 aItem->m_IncrementVector.y =
561
562 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
563 {
564 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
565
566 item->m_TextBase = m_stcText->GetValue();
567
568 msg = m_textCtrlTextIncrement->GetValue();
569 msg.ToLong( &itmp );
570 item->m_IncrementLabel = itmp;
571
572 item->m_Bold = m_bold->IsChecked();
573 item->m_Italic = m_italic->IsChecked();
575
576 if( m_alignLeft->IsChecked() )
578 else if( m_alignCenter->IsChecked() )
580 else if( m_alignRight->IsChecked() )
582
583 if( m_vAlignTop->IsChecked() )
585 else if( m_vAlignMiddle->IsChecked() )
587 else if( m_vAlignBottom->IsChecked() )
589
591 item->m_Font = m_fontCtrl->GetFontSelection( item->m_Bold, item->m_Italic );
592
593 msg = m_textCtrlRotation->GetValue();
595 EDA_UNITS::UNSCALED, msg );
596
597 // Import text size
599
600 if( is_valid )
604
605 if( is_valid )
608
609 // Import constraints:
610 item->m_BoundingBoxSize.x =
612 item->m_BoundingBoxSize.y =
614 }
615
616 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
617 {
618 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
619
620 msg = m_textCtrlRotation->GetValue();
621 item->m_Orient = EDA_ANGLE(
623 msg ), DEGREES_T );
624 }
625
626 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
627 {
628 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
629 long value;
630
631 msg = m_textCtrlBitmapDPI->GetValue();
632
633 if( msg.ToLong( &value ) )
634 item->SetPPI( (int)value );
635 }
636
637 return true;
638}
639
640
641void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
642{
643 wxArrayString autocompleteTokens;
644 int pos = m_stcText->GetCurrentPos();
645 int start = m_stcText->WordStartPosition( pos, true );
646 wxString partial;
647
648 if( start >= 2
649 && m_stcText->GetCharAt( start-2 ) == '$'
650 && m_stcText->GetCharAt( start-1 ) == '{' )
651 {
652 DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
653
654 partial = m_stcText->GetTextRange( start, pos );
655
656 for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
657 autocompleteTokens.push_back( entry.first );
658 }
659
660 m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
661 m_stcText->SetFocus();
662}
663
664
665void PROPERTIES_FRAME::onHelp( wxCommandEvent& aEvent )
666{
667 // Show the system variables for worksheet text:
668 HTML_MESSAGE_BOX dlg( this, _( "Predefined Keywords" ) );
669 wxString message;
670
671 message << _( "Texts can include keywords." ) << "<br>";
672 message << _( "Keyword notation is ${keyword}" ) << "<br>";
673 message << _( "Each keyword is replaced by its value" ) << "<br><br>";
674 message << _( "These build-in keywords are always available:" ) << "<br><br>";
675 dlg.AddHTML_Text( message );
676
677 message = "KICAD_VERSION\n";
678 message << "# " << _( "(sheet number)" ) << "\n";
679 message << "## " << _( "(sheet count)" ) << "\n";
680 message << "COMMENT1 thru COMMENT9\n";
681 message << "COMPANY\n";
682 message << "FILENAME\n";
683 message << "ISSUE_DATE\n";
684 message << "LAYER\n";
685 message << "PAPER " << _( "(paper size)" ) << "\n";
686 message << "REVISION\n";
687 message << "SHEETNAME\n";
688 message << "SHEETPATH\n";
689 message << "TITLE\n";
690
691 dlg.ListSet( message );
692 dlg.ShowModal();
693}
constexpr EDA_IU_SCALE drawSheetIUScale
Definition: base_units.h:110
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:106
@ text_align_right
@ text_valign_top
@ text_align_left
@ text_valign_center
@ text_align_center
@ text_valign_bottom
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
Definition: bitmap_button.h:41
void SetIsRadioButton()
bool IsChecked() const
void SetBitmap(const wxBitmap &aBmp)
Set the bitmap shown when the button is enabled.
void Check(bool aCheck=true)
Check the control.
void SetIsSeparator()
Render button as a toolbar separator.
void SetIsCheckButton()
Setup the control as a two-state button (checked or unchecked).
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
void SetPPI(int aBitmapPPI)
bool ReplaceAntiSlashSequence()
Replace the '\''n' sequence by EOL and the sequence '\''\' by only one '\' inside m_FullText.
KIFONT::FONT * m_Font
Definition: ds_data_item.h:342
GR_TEXT_H_ALIGN_T m_Hjustify
Definition: ds_data_item.h:338
KIGFX::COLOR4D m_TextColor
Definition: ds_data_item.h:344
VECTOR2D m_BoundingBoxSize
Definition: ds_data_item.h:345
GR_TEXT_V_ALIGN_T m_Vjustify
Definition: ds_data_item.h:339
Drawing sheet structure type definitions.
Definition: ds_data_item.h:96
PAGE_OPTION GetPage1Option() const
Definition: ds_data_item.h:133
void SetPage1Option(PAGE_OPTION aChoice)
Definition: ds_data_item.h:134
DS_ITEM_TYPE GetType() const
Definition: ds_data_item.h:128
const wxString GetClassName() const
VECTOR2D m_IncrementVector
Definition: ds_data_item.h:204
POINT_COORD m_Pos
Definition: ds_data_item.h:200
wxString m_Info
Definition: ds_data_item.h:199
double m_LineWidth
Definition: ds_data_item.h:202
POINT_COORD m_End
Definition: ds_data_item.h:201
int m_IncrementLabel
Definition: ds_data_item.h:205
Handle the graphic items list to draw/plot the frame and title block.
Definition: ds_data_model.h:39
void SetBottomMargin(double aMargin)
Definition: ds_data_model.h:73
double GetRightMargin()
Definition: ds_data_model.h:66
VECTOR2D m_DefaultTextSize
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
double GetTopMargin()
Definition: ds_data_model.h:69
void SetRightMargin(double aMargin)
Definition: ds_data_model.h:67
double m_DefaultLineWidth
double GetBottomMargin()
Definition: ds_data_model.h:72
double GetLeftMargin()
Definition: ds_data_model.h:63
void SetLeftMargin(double aMargin)
Definition: ds_data_model.h:64
double m_DefaultTextThickness
void SetTopMargin(double aMargin)
Definition: ds_data_model.h:70
Base class to handle basic graphic items.
Definition: ds_draw_item.h:59
DS_DATA_ITEM * GetPeer() const
Definition: ds_draw_item.h:63
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:97
double AsDegrees() const
Definition: eda_angle.h:149
virtual COLOR4D GetDrawBgColor() const
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool HaveFontSelection() const
Definition: font_choice.cpp:89
void SetFontSelection(KIFONT::FONT *aFont)
Definition: font_choice.cpp:68
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
void ListSet(const wxString &aList)
Add a list of items.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1591
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Class PANEL_PROPERTIES_BASE.
wxScrolledWindow * m_swItemProperties
wxStaticBoxSizer * m_sbSizerEndPosition
wxStyledTextCtrl * m_stcText
wxScrolledWindow * m_swGeneralOpts
wxStaticText * m_staticTextInclabel
wxStaticText * m_staticTextBitmapDPI
COLOR_SWATCH * m_textColorSwatch
BITMAP_BUTTON * m_vAlignMiddle
wxStaticText * m_staticTextSizeInfo
BITMAP_BUTTON * m_vAlignBottom
void DisplayDrawingSheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
The main window used in the drawing sheet editor.
void OnModify() override
Must be called after a change in order to set the "modify" flag.
void SaveCopyInUndoList()
Save a copy of the description (in a S expr string) for Undo/redo commands.
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PL_SELECTION & GetSelection()
Return the set of currently selected items.
VECTOR2D m_Pos
Definition: ds_data_item.h:80
virtual std::map< wxString, wxString > & GetTextVars() const
Definition: project.cpp:82
UNIT_BINDER m_defaultTextSizeX
UNIT_BINDER m_lineWidth
PROPERTIES_FRAME(PL_EDITOR_FRAME *aParent)
void OnAcceptPrms(wxCommandEvent &event) override
UNIT_BINDER m_constraintX
UNIT_BINDER m_defaultLineWidth
UNIT_BINDER m_textBottomMargin
PL_EDITOR_FRAME * m_parent
UNIT_BINDER m_textSizeY
UNIT_BINDER m_textLeftMargin
UNIT_BINDER m_defaultTextThickness
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
void onHelp(wxCommandEvent &aEvent) override
UNIT_BINDER m_textEndX
void OnSetDefaultValues(wxCommandEvent &event) override
void CopyPrmsFromItemToPanel(DS_DATA_ITEM *aItem)
void onHAlignButton(wxCommandEvent &aEvent)
bool CopyPrmsFromPanelToItem(DS_DATA_ITEM *aItem)
UNIT_BINDER m_textEndY
wxSize GetMinSize() const override
UNIT_BINDER m_textSizeX
void onVAlignButton(wxCommandEvent &aEvent)
UNIT_BINDER m_constraintY
UNIT_BINDER m_defaultTextSizeY
UNIT_BINDER m_textPosX
UNIT_BINDER m_textStepY
UNIT_BINDER m_textTopMargin
UNIT_BINDER m_textRightMargin
UNIT_BINDER m_textPosY
UNIT_BINDER m_textStepX
SCINTILLA_TRICKS * m_scintillaTricks
void OnPageChanged(wxNotebookEvent &event) override
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
#define TB_DEFAULT_TEXTSIZE
Definition: ds_data_item.h:35
@ FIRST_PAGE_ONLY
Definition: ds_data_item.h:58
@ SUBSEQUENT_PAGES
Definition: ds_data_item.h:59
@ ALL_PAGES
Definition: ds_data_item.h:57
@ RB_CORNER
Definition: ds_data_item.h:49
@ RT_CORNER
Definition: ds_data_item.h:50
@ LT_CORNER
Definition: ds_data_item.h:52
@ LB_CORNER
Definition: ds_data_item.h:51
#define _(s)
@ DEGREES_T
Definition: eda_angle.h:31
EDA_UNITS
Definition: eda_units.h:43
double FromUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg".
Definition: eda_units.cpp:385
double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function DoubleValueFromString converts aTextValue to a double.
Definition: eda_units.cpp:445
double ToUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: eda_units.cpp:190
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:156
#define DLG_MIN_TEXTSIZE
Minimum drawing sheet text default size in millmeters from PROPERTIES_FRAME.
#define DLG_MAX_TEXTSIZE
Maximum drawing sheet text size in mm from PROPERTIES_FRAME.
@ 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
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589