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-2022 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
46 PANEL_PROPERTIES_BASE( aParent ),
47 m_scintillaTricks( nullptr ),
48 m_textSizeX( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX, m_textSizeXUnits ),
49 m_textSizeY( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY, m_textSizeYUnits ),
50 m_constraintX( aParent, m_constraintXLabel, m_constraintXCtrl, m_constraintXUnits ),
51 m_constraintY( aParent, m_constraintYLabel, m_constraintYCtrl, m_constraintYUnits ),
52 m_textPosX( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ),
53 m_textPosY( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ),
54 m_textEndX( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ),
55 m_textEndY( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ),
56 m_textStepX( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ),
57 m_textStepY( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ),
58 m_defaultTextSizeX( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX, m_defaultTextSizeXUnits ),
59 m_defaultTextSizeY( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY, m_defaultTextSizeYUnits ),
60 m_defaultLineWidth( aParent, m_defaultLineWidthLabel, m_defaultLineWidthCtrl, m_defaultLineWidthUnits ),
61 m_defaultTextThickness( aParent, m_defaultTextThicknessLabel, m_defaultTextThicknessCtrl, m_defaultTextThicknessUnits ),
62 m_textLeftMargin( aParent, m_leftMarginLabel, m_leftMarginCtrl, m_leftMarginUnits ),
63 m_textRightMargin( aParent, m_rightMarginLabel, m_rightMarginCtrl, m_rightMarginUnits ),
64 m_textTopMargin( aParent, m_topMarginLabel, m_topMarginCtrl, m_topMarginUnits ),
65 m_textBottomMargin( aParent, m_bottomMarginLabel, m_bottomMarginCtrl, m_bottomMarginUnits ),
66 m_lineWidth( aParent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits )
67{
68 m_parent = aParent;
69
70 m_stcText->SetUseVerticalScrollBar( false );
71 m_stcText->SetUseHorizontalScrollBar( false );
72 m_stcText->SetEOLMode( wxSTC_EOL_LF ); // Always use LF as eol char, regardless the platform
73 m_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ), false );
74
75 m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() );
76
81
83
90
92
99
101
102 m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
104
105 m_buttonOK->SetDefault();
106
107 // ensure sizers are up to date
108 // (fix an issue on GTK but should not create issues on other platforms):
109 m_swItemProperties->Fit();
110 m_swGeneralOpts->Fit();
111
112 m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
113 m_alignLeft->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
114 m_alignCenter->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
115 m_alignRight->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onHAlignButton, this );
116 m_vAlignTop->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
117 m_vAlignMiddle->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
118 m_vAlignBottom->Bind( wxEVT_BUTTON, &PROPERTIES_FRAME::onVAlignButton, this );
119}
120
121
123{
124 delete m_scintillaTricks;
125}
126
127
128void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
129{
130 if( event.GetSelection() == 0 )
131 m_buttonOK->SetDefault();
132 else
133 m_buttonGeneralOptsOK->SetDefault();
134
135 event.Skip();
136}
137
138
140{
141 return wxSize( 150, -1 );
142}
143
144
146{
147 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
149
150 // Set default parameters
153
160
169}
170
171
173{
174 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
176
177 // Import default parameters from widgets
180
187
188 // Get page margins values
197
198 return true;
199}
200
201
203{
204 if( !aItem )
205 {
206 m_SizerItemProperties->Show( false );
207 return;
208 }
209
210 static EDA_UNITS units = EDA_UNITS::MILLIMETRES;
211 wxString msg;
212
213 // Set parameters common to all DS_DATA_ITEM types
214 m_staticTextType->SetLabel( aItem->GetClassName() );
215 m_textCtrlComment->SetValue( aItem->m_Info );
216
217 switch( aItem->GetPage1Option() )
218 {
219 default:
220 case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
221 case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
222 case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
223 }
224
225 // Position/ start point
228
229 switch( aItem->m_Pos.m_Anchor )
230 {
231 case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
232 case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
233 case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
234 case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
235 }
236
237 // End point
240
241 switch( aItem->m_End.m_Anchor )
242 {
243 case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
244 case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
245 case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
246 case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
247 }
248
250
251 // Now, set prms more specific to DS_DATA_ITEM types
252 // For a given type, disable widgets which are not relevant,
253 // and be sure widgets which are relevant are enabled
254 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
255 {
256 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
257 item->m_FullText = item->m_TextBase;
258
259 // Replace our '\' 'n' sequence by the EOL char
261 m_stcText->SetValue( item->m_FullText );
262 m_stcText->EmptyUndoBuffer();
263
264 msg.Printf( wxT( "%d" ), item->m_IncrementLabel );
265 m_textCtrlTextIncrement->SetValue( msg );
266
267 // Rotation (poly and text)
268 msg.Printf( wxT( "%.3f" ), item->m_Orient );
269 m_textCtrlRotation->SetValue( msg );
270
271 // Constraints:
274
275 // Font Options
277
278 m_bold->Check( item->m_Bold );
279 m_italic->Check( item->m_Italic );
280
282
284 btn->Check( false );
285
286 switch( item->m_Hjustify )
287 {
288 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check(); break;
291 }
292
294 btn->Check( false );
295
296 switch( item->m_Vjustify )
297 {
298 case GR_TEXT_V_ALIGN_TOP: m_vAlignTop->Check(); break;
301 }
302
303 // Text size
306 }
307
308 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
309 {
310 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
311
312 // Rotation (poly and text)
313 msg.Printf( wxT( "%.3f" ), item->m_Orient.AsDegrees() );
314 m_textCtrlRotation->SetValue( msg );
315 }
316
317 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
318 {
319 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
320
321 // select definition in PPI
322 msg.Printf( wxT( "%d" ), item->GetPPI() );
323 m_textCtrlBitmapDPI->SetValue( msg );
324 }
325
326 m_SizerItemProperties->Show( true );
327
329 m_buttonHelp->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
330
332 || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
333
335
336 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
338 {
339 m_staticTextRot->Show( true );
340 m_textCtrlRotation->Show( true );
341 }
342 else
343 {
344 m_staticTextRot->Show( false );
345 m_textCtrlRotation->Show( false );
346 }
347
350
353
354 // Repeat parameters
355 msg.Printf( wxT( "%d" ), aItem->m_RepeatCount );
356 m_textCtrlRepeatCount->SetValue( msg );
357
360
361 // The number of widgets was modified, so recalculate sizers
362 m_swItemProperties->Layout();
363#ifdef __WXGTK__
364 // This call is mandatory on wxGTK to initialize the right virtual size and therefore
365 // scrollbars, but for some reason, create issues on Windows (incorrect display
366 // until the frame is resized). Joys of multiplatform dev.
367 m_swItemProperties->Fit();
368#endif
369
370 // send a size event to be sure scrollbars will be added/removed as needed
371 m_swItemProperties->PostSizeEvent();
372 m_swItemProperties->Refresh();
373}
374
375
376void PROPERTIES_FRAME::onHAlignButton( wxCommandEvent& aEvent )
377{
379 {
380 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
381 btn->Check( false );
382 }
383}
384
385
386void PROPERTIES_FRAME::onVAlignButton( wxCommandEvent& aEvent )
387{
389 {
390 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
391 btn->Check( false );
392 }
393}
394
395
396void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
397{
399 PL_SELECTION& selection = selTool->GetSelection();
400
402
403 DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
404
405 if( drawItem )
406 {
407 DS_DATA_ITEM* dataItem = drawItem->GetPeer();
408 CopyPrmsFromPanelToItem( dataItem );
409
410 // Be sure what is displayed is what is set for item
411 // (mainly, texts can be modified if they contain "\n")
412 CopyPrmsFromItemToPanel( dataItem );
413 m_parent->GetCanvas()->GetView()->Update( drawItem );
414 }
415
417
418 // Refresh values, exactly as they are converted, to avoid any mistake
420
422
423 // Rebuild the draw list with the new parameters
426}
427
428
429void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
430{
432
434 model.m_DefaultLineWidth = 0.15;
435 model.m_DefaultTextThickness = 0.15;
436
438
439 // Rebuild the draw list with the new parameters
442}
443
444
446{
447 if( aItem == nullptr )
448 return false;
449
450 const EDA_UNITS units = EDA_UNITS::MILLIMETRES;
451 wxString msg;
452
453 // Import common parameters:
454 aItem->m_Info = m_textCtrlComment->GetValue();
455
456 switch( m_choicePageOpt->GetSelection() )
457 {
458 default:
459 case 0: aItem->SetPage1Option( ALL_PAGES ); break;
460 case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
461 case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
462 }
463
464 // Import thickness
465 aItem->m_LineWidth =
467
468 // Import Start point
469 aItem->m_Pos.m_Pos.x =
471 aItem->m_Pos.m_Pos.y =
473
474 switch( m_comboBoxCornerPos->GetSelection() )
475 {
476 case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
477 case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
478 case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
479 case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
480 }
481
482 // Import End point
483 aItem->m_End.m_Pos.x =
485 aItem->m_End.m_Pos.y =
487
488 switch( m_comboBoxCornerEnd->GetSelection() )
489 {
490 case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
491 case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
492 case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
493 case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
494 }
495
496 // Import Repeat prms
497 long itmp;
498 msg = m_textCtrlRepeatCount->GetValue();
499 msg.ToLong( &itmp );
500 aItem->m_RepeatCount = itmp;
501
502 aItem->m_IncrementVector.x =
504 aItem->m_IncrementVector.y =
506
507 if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
508 {
509 DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
510
511 item->m_TextBase = m_stcText->GetValue();
512
513 msg = m_textCtrlTextIncrement->GetValue();
514 msg.ToLong( &itmp );
515 item->m_IncrementLabel = itmp;
516
517 item->m_Bold = m_bold->IsChecked();
518 item->m_Italic = m_italic->IsChecked();
520
521 if( m_alignLeft->IsChecked() )
523 else if( m_alignCenter->IsChecked() )
525 else if( m_alignRight->IsChecked() )
527
528 if( m_vAlignTop->IsChecked() )
530 else if( m_vAlignMiddle->IsChecked() )
532 else if( m_vAlignBottom->IsChecked() )
534
536 item->m_Font = m_fontCtrl->GetFontSelection( item->m_Bold, item->m_Italic );
537
538 msg = m_textCtrlRotation->GetValue();
540
541 // Import text size
542 item->m_TextSize.x =
544 item->m_TextSize.y =
546
547 // Import constraints:
548 item->m_BoundingBoxSize.x =
550 item->m_BoundingBoxSize.y =
552 }
553
554 if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
555 {
556 DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
557
558 msg = m_textCtrlRotation->GetValue();
559 item->m_Orient = EDA_ANGLE(
561 }
562
563 if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
564 {
565 DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
566 long value;
567
568 msg = m_textCtrlBitmapDPI->GetValue();
569
570 if( msg.ToLong( &value ) )
571 item->SetPPI( (int)value );
572 }
573
574 return true;
575}
576
577
578void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
579{
580 wxArrayString autocompleteTokens;
581 int pos = m_stcText->GetCurrentPos();
582 int start = m_stcText->WordStartPosition( pos, true );
583 wxString partial;
584
585 if( start >= 2
586 && m_stcText->GetCharAt( start-2 ) == '$'
587 && m_stcText->GetCharAt( start-1 ) == '{' )
588 {
589 DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
590
591 partial = m_stcText->GetTextRange( start, pos );
592
593 for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
594 autocompleteTokens.push_back( entry.first );
595 }
596
597 m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
598 m_stcText->SetFocus();
599}
600
601
602void PROPERTIES_FRAME::onHelp( wxCommandEvent& aEvent )
603{
604 // Show the system variables for worksheet text:
605 HTML_MESSAGE_BOX dlg( this, _( "Predefined Keywords" ) );
606 wxString message;
607
608 message << _( "Texts can include keywords." ) << "<br>";
609 message << _( "Keyword notation is ${keyword}" ) << "<br>";
610 message << _( "Each keyword is replaced by its value" ) << "<br><br>";
611 message << _( "These build-in keywords are always available:" ) << "<br><br>";
612 dlg.AddHTML_Text( message );
613
614 message = "KICAD_VERSION\n";
615 message << "# " << _( "(sheet number)" ) << "\n";
616 message << "## " << _( "(sheet count)" ) << "\n";
617 message << "COMMENT1 thru COMMENT9\n";
618 message << "COMPANY\n";
619 message << "FILENAME\n";
620 message << "ISSUE_DATE\n";
621 message << "LAYER\n";
622 message << "PAPER " << _( "(paper size)" ) << "\n";
623 message << "REVISION\n";
624 message << "SHEETNAME\n";
625 message << "SHEETPATH\n";
626 message << "TITLE\n";
627
628 dlg.ListSet( message );
629 dlg.ShowModal();
630}
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:105
@ 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:88
void SetFontSelection(KIFONT::FONT *aFont)
Definition: font_choice.cpp:67
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:1575
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.
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:389
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:449
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:194
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:144
@ 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:617