KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
87#ifdef _WIN32
88 // Without this setting, on Windows, some esoteric unicode chars create display issue
89 // in a wxStyledTextCtrl.
90 // for SetTechnology() info, see https://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY
91 m_stcText->SetTechnology(wxSTC_TECHNOLOGY_DIRECTWRITE);
92#endif
93
94 m_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ), false );
95
96 m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() );
97
99 m_bold->SetBitmap( KiBitmap( BITMAPS::text_bold ) );
101 m_italic->SetBitmap( KiBitmap( BITMAPS::text_italic ) );
102
104
106 m_alignLeft->SetBitmap( KiBitmap( BITMAPS::text_align_left ) );
108 m_alignCenter->SetBitmap( KiBitmap( BITMAPS::text_align_center ) );
110 m_alignRight->SetBitmap( KiBitmap( BITMAPS::text_align_right ) );
111
113
115 m_vAlignTop->SetBitmap( KiBitmap( BITMAPS::text_valign_top ) );
117 m_vAlignMiddle->SetBitmap( KiBitmap( BITMAPS::text_valign_center ) );
119 m_vAlignBottom->SetBitmap( KiBitmap( BITMAPS::text_valign_bottom ) );
120
122
123 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
125
126 m_buttonOK->SetDefault();
127
128 // ensure sizers are up to date
129 // (fix an issue on GTK but should not create issues on other platforms):
130 m_swItemProperties->Fit();
131 m_swGeneralOpts->Fit();
132
133 m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
134 m_stcText->Bind( wxEVT_STC_AUTOCOMP_CHAR_DELETED, &PROPERTIES_FRAME::onScintillaCharAdded,
135 this );
136 m_alignLeft->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
137 m_alignCenter->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
138 m_alignRight->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
139 m_vAlignTop->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
140 m_vAlignMiddle->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
141 m_vAlignBottom->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
142}
143
144
146{
147 delete m_scintillaTricks;
148}
149
150
151void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
152{
153 if( event.GetSelection() == 0 )
154 m_buttonOK->SetDefault();
155 else
156 m_buttonGeneralOptsOK->SetDefault();
157
158 event.Skip();
159}
160
161
163{
164 return wxSize( 150, -1 );
165}
166
167
169{
170 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
172
173 // Set default parameters
176
183
192}
193
194
196{
197 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
199
200 // Import default parameters from widgets
201 bool is_valid = m_defaultLineWidth.Validate( 0.0, 10.0, EDA_UNITS::MILLIMETRES );
202
203 if( is_valid )
206
208 EDA_UNITS::MILLIMETRES );
209 if( is_valid )
212
214 EDA_UNITS::MILLIMETRES );
215
216 if( is_valid )
219
220 is_valid = m_defaultTextThickness.Validate( 0.0, 5.0, EDA_UNITS::MILLIMETRES );
221
222 if( is_valid )
225
226 // Get page margins values
235
236 return true;
237}
238
239
241{
242 if( !aItem )
243 {
244 m_SizerItemProperties->Show( false );
245 return;
246 }
247
248 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
249 wxString msg;
250
251 // Set parameters common to all DS_DATA_ITEM types
252 m_staticTextType->SetLabel( aItem->GetClassName() );
253 m_textCtrlComment->SetValue( aItem->m_Info );
254
255 switch( aItem->GetPage1Option() )
256 {
257 default:
258 case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
259 case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
260 case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
261 }
262
263 // Position/ start point
265 aItem->m_Pos.m_Pos.x ) );
267 aItem->m_Pos.m_Pos.y ) );
268
269 switch( aItem->m_Pos.m_Anchor )
270 {
271 case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
272 case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
273 case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
274 case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
275 }
276
277 // End point
279 aItem->m_End.m_Pos.x ) );
281 aItem->m_End.m_Pos.y ) );
282
283 switch( aItem->m_End.m_Anchor )
284 {
285 case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
286 case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
287 case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
288 case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
289 }
290
292 aItem->m_LineWidth ) );
293
294 // Now, set prms more specific to DS_DATA_ITEM types
295 // For a given type, disable widgets which are not relevant,
296 // and be sure widgets which are relevant are enabled
297 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
298 {
299 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
300 item->m_FullText = item->m_TextBase;
301
302 // Replace our '\' 'n' sequence by the EOL char
304 m_stcText->SetValue( item->m_FullText );
305 m_stcText->EmptyUndoBuffer();
306
307 msg.Printf( wxT( "%d" ), item->m_IncrementLabel );
308 m_textCtrlTextIncrement->SetValue( msg );
309
310 // Rotation (poly and text)
311 msg.Printf( wxT( "%.3f" ), item->m_Orient );
312 m_textCtrlRotation->SetValue( msg );
313
314 // Constraints:
316 item->m_BoundingBoxSize.x ) );
318 item->m_BoundingBoxSize.y ) );
319
320 // Font Options
322
323 m_bold->Check( item->m_Bold );
324 m_italic->Check( item->m_Italic );
325
327
329 btn->Check( false );
330
331 switch( item->m_Hjustify )
332 {
333 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check(); break;
336 }
337
339 btn->Check( false );
340
341 switch( item->m_Vjustify )
342 {
343 case GR_TEXT_V_ALIGN_TOP: m_vAlignTop->Check(); break;
346 }
347
348 // Text size
350 item->m_TextSize.x ) );
352 item->m_TextSize.y ) );
353 }
354
355 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
356 {
357 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
358
359 // Rotation (poly and text)
360 msg.Printf( wxT( "%.3f" ), item->m_Orient.AsDegrees() );
361 m_textCtrlRotation->SetValue( msg );
362 }
363
364 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
365 {
366 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
367
368 // select definition in PPI
369 msg.Printf( wxT( "%d" ), item->GetPPI() );
370 m_textCtrlBitmapDPI->SetValue( msg );
371 }
372
373 m_SizerItemProperties->Show( true );
374
376 m_buttonHelp->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
377
379 || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
380
382
383 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
385 {
386 m_staticTextRot->Show( true );
387 m_textCtrlRotation->Show( true );
388 }
389 else
390 {
391 m_staticTextRot->Show( false );
392 m_textCtrlRotation->Show( false );
393 }
394
397
400
401 // Repeat parameters
402 msg.Printf( wxT( "%d" ), aItem->m_RepeatCount );
403 m_textCtrlRepeatCount->SetValue( msg );
404
406 aItem->m_IncrementVector.x ) );
408 aItem->m_IncrementVector.y ) );
409
410 // The number of widgets was modified, so recalculate sizers
411 m_swItemProperties->Layout();
412
413#ifdef __WXGTK__
414 // This call is mandatory on wxGTK to initialize the right virtual size and therefore
415 // scrollbars, but for some reason, create issues on Windows (incorrect display
416 // until the frame is resized). Joys of multiplatform dev.
417 m_swItemProperties->Fit();
418#endif
419
420 // send a size event to be sure scrollbars will be added/removed as needed
421 m_swItemProperties->PostSizeEvent();
422 m_swItemProperties->Refresh();
423}
424
425
426void PROPERTIES_FRAME::onHAlignButton( wxCommandEvent& aEvent )
427{
429 {
430 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
431 btn->Check( false );
432 }
433}
434
435
436void PROPERTIES_FRAME::onVAlignButton( wxCommandEvent& aEvent )
437{
439 {
440 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
441 btn->Check( false );
442 }
443}
444
445
446void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
447{
449 PL_SELECTION& selection = selTool->GetSelection();
450
452
453 DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
454
455 if( drawItem )
456 {
457 DS_DATA_ITEM* dataItem = drawItem->GetPeer();
458 CopyPrmsFromPanelToItem( dataItem );
459
460 // Be sure what is displayed is what is set for item
461 // (mainly, texts can be modified if they contain "\n")
462 CopyPrmsFromItemToPanel( dataItem );
463 m_parent->GetCanvas()->GetView()->Update( drawItem );
464 }
465
467
468 // Refresh values, exactly as they are converted, to avoid any mistake
470
472
473 // Rebuild the draw list with the new parameters
476}
477
478
479void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
480{
482
484 model.m_DefaultLineWidth = 0.15;
485 model.m_DefaultTextThickness = 0.15;
486
488
489 // Rebuild the draw list with the new parameters
492}
493
494
496{
497 if( aItem == nullptr )
498 return false;
499
500 const EDA_UNITS units = EDA_UNITS::MILLIMETRES;
501 wxString msg;
502
503 // Import common parameters:
504 aItem->m_Info = m_textCtrlComment->GetValue();
505
506 switch( m_choicePageOpt->GetSelection() )
507 {
508 default:
509 case 0: aItem->SetPage1Option( ALL_PAGES ); break;
510 case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
511 case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
512 }
513
514 // Import thickness
515 bool is_valid = m_lineWidth.Validate( 0.0, 10.0, EDA_UNITS::MILLIMETRES );
516
517 if( is_valid )
518 aItem->m_LineWidth =
520
521 // Import Start point
522 aItem->m_Pos.m_Pos.x =
524 aItem->m_Pos.m_Pos.y =
526
527 switch( m_comboBoxCornerPos->GetSelection() )
528 {
529 case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
530 case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
531 case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
532 case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
533 }
534
535 // Import End point
536 aItem->m_End.m_Pos.x =
538 aItem->m_End.m_Pos.y =
540
541 switch( m_comboBoxCornerEnd->GetSelection() )
542 {
543 case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
544 case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
545 case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
546 case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
547 }
548
549 // Import Repeat prms
550 long itmp;
551 msg = m_textCtrlRepeatCount->GetValue();
552 msg.ToLong( &itmp );
553
554 // Ensure m_RepeatCount is > 0. Otherwise it create issues because a repeat
555 // count < 1 make no sense
556 if( itmp < 1l )
557 {
558 itmp = 1;
559 msg.Printf( wxT( "%ld" ), itmp );
560 m_textCtrlRepeatCount->SetValue( msg );
561 }
562
563 aItem->m_RepeatCount = itmp;
564
565 aItem->m_IncrementVector.x =
567 aItem->m_IncrementVector.y =
569
570 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
571 {
572 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
573
574 item->m_TextBase = m_stcText->GetValue();
575
576 msg = m_textCtrlTextIncrement->GetValue();
577 msg.ToLong( &itmp );
578 item->m_IncrementLabel = itmp;
579
580 item->m_Bold = m_bold->IsChecked();
581 item->m_Italic = m_italic->IsChecked();
583
584 if( m_alignLeft->IsChecked() )
586 else if( m_alignCenter->IsChecked() )
588 else if( m_alignRight->IsChecked() )
590
591 if( m_vAlignTop->IsChecked() )
593 else if( m_vAlignMiddle->IsChecked() )
595 else if( m_vAlignBottom->IsChecked() )
597
599 item->m_Font = m_fontCtrl->GetFontSelection( item->m_Bold, item->m_Italic );
600
601 msg = m_textCtrlRotation->GetValue();
603 EDA_UNITS::UNSCALED, msg );
604
605 // Import text size
606 is_valid = m_textSizeX.Validate( 0.0, DLG_MAX_TEXTSIZE, EDA_UNITS::MILLIMETRES );
607
608 if( is_valid )
611 is_valid = m_textSizeY.Validate( 0.0, DLG_MAX_TEXTSIZE, EDA_UNITS::MILLIMETRES );
612
613 if( is_valid )
616
617 // Import constraints:
618 item->m_BoundingBoxSize.x =
620 item->m_BoundingBoxSize.y =
622 }
623
624 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
625 {
626 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
627
628 msg = m_textCtrlRotation->GetValue();
629 item->m_Orient = EDA_ANGLE(
631 msg ), DEGREES_T );
632 }
633
634 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
635 {
636 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
637 long value;
638
639 msg = m_textCtrlBitmapDPI->GetValue();
640
641 if( msg.ToLong( &value ) )
642 item->SetPPI( (int)value );
643 }
644
645 return true;
646}
647
648
649void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
650{
651 wxArrayString autocompleteTokens;
652 int pos = m_stcText->GetCurrentPos();
653 int start = m_stcText->WordStartPosition( pos, true );
654 wxString partial;
655
656 if( start >= 2
657 && m_stcText->GetCharAt( start-2 ) == '$'
658 && m_stcText->GetCharAt( start-1 ) == '{' )
659 {
660 DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
661
662 partial = m_stcText->GetTextRange( start, pos );
663
664 for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
665 autocompleteTokens.push_back( entry.first );
666 }
667
668 m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
669 m_stcText->SetFocus();
670}
671
672
673void PROPERTIES_FRAME::onHelp( wxCommandEvent& aEvent )
674{
675 // Show the system variables for worksheet text:
676 HTML_MESSAGE_BOX dlg( this, _( "Predefined Keywords" ) );
677 wxString message;
678
679 message << _( "Texts can include keywords." ) << "<br>";
680 message << _( "Keyword notation is ${keyword}" ) << "<br>";
681 message << _( "Each keyword is replaced by its value" ) << "<br><br>";
682 message << _( "These build-in keywords are always available:" ) << "<br><br>";
683 dlg.AddHTML_Text( message );
684
685 message = "KICAD_VERSION\n";
686 message << "# " << _( "(sheet number)" ) << "\n";
687 message << "## " << _( "(sheet count)" ) << "\n";
688 message << "COMMENT1 thru COMMENT9\n";
689 message << "COMPANY\n";
690 message << "FILENAME\n";
691 message << "ISSUE_DATE\n";
692 message << "LAYER\n";
693 message << "PAPER " << _( "(paper size)" ) << "\n";
694 message << "REVISION\n";
695 message << "SHEETNAME\n";
696 message << "SHEETPATH\n";
697 message << "TITLE\n";
698
699 dlg.ListSet( message );
700 dlg.ShowModal();
701}
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
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 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 SetBitmap(const wxBitmapBundle &aBmp)
Set the bitmap shown when the button is enabled.
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
bool HaveFontSelection() const
Definition: font_choice.cpp:94
void SetFontSelection(KIFONT::FONT *aFont)
Definition: font_choice.cpp:73
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:1607
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:84
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:55
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:44
KICOMMON_API 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
KICOMMON_API 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
KICOMMON_API 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:160
#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:587