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 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>
28 #include <tool/tool_manager.h>
32 #include <view/view.h>
33 
34 #include "properties_frame.h"
35 #include "pl_editor_frame.h"
37 
39 
40 
42  PANEL_PROPERTIES_BASE( aParent ),
43  m_scintillaTricks( nullptr ),
44  m_textCtrlTextSizeXBinder( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX,
45  m_TextTextSizeXUnits ),
46  m_textCtrlTextSizeYBinder( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY,
47  m_TextTextSizeYUnits ),
48  m_textCtrlConstraintXBinder( aParent, m_staticTextConstraintX, m_textCtrlConstraintX,
49  m_TextConstraintXUnits ),
50  m_textCtrlConstraintYBinder( aParent, m_staticTextConstraintY, m_textCtrlConstraintY,
51  m_TextConstraintYUnits ),
52  m_textCtrlPosXBinder( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ),
53  m_textCtrlPosYBinder( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ),
54  m_textCtrlEndXBinder( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ),
55  m_textCtrlEndYBinder( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ),
56  m_textCtrlStepXBinder( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ),
57  m_textCtrlStepYBinder( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ),
58  m_textCtrlDefaultTextSizeXBinder( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX,
59  m_TextDefaultTextSizeXUnits ),
60  m_textCtrlDefaultTextSizeYBinder( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY,
61  m_TextDefaultTextSizeYUnits ),
62  m_textCtrlDefaultLineWidthBinder( aParent, m_staticTextDefLineW,
63  m_textCtrlDefaultLineWidth, m_TextDefaultLineWidthUnits ),
64  m_textCtrlDefaultTextThicknessBinder( aParent, m_staticTextDefTextThickness,
65  m_textCtrlDefaultTextThickness,
66  m_TextDefaultTextThicknessUnits ),
67  m_textCtrlLeftMarginBinder( aParent, m_staticTextLeftMargin, m_textCtrlLeftMargin,
68  m_TextLeftMarginUnits ),
69  m_textCtrlRightMarginBinder( aParent, m_staticTextDefRightMargin, m_textCtrlRightMargin,
70  m_TextRightMarginUnits ),
71  m_textCtrlTopMarginBinder( aParent, m_staticTextTopMargin, m_textCtrlTopMargin,
72  m_TextTopMarginUnits ),
73  m_textCtrlBottomMarginBinder( aParent, m_staticTextBottomMargin, m_textCtrlBottomMargin,
74  m_TextBottomMarginUnits ),
75  m_textCtrlThicknessBinder( aParent, m_staticTextThickness, m_textCtrlThickness,
76  m_TextLineThicknessUnits )
77 {
78  m_parent = aParent;
79 
80  m_stcText->SetUseVerticalScrollBar( false );
81  m_stcText->SetUseHorizontalScrollBar( false );
82  m_stcText->SetEOLMode( wxSTC_EOL_LF ); // Always use LF as eol char, regardless the platform
83  m_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ), false );
84 
85  m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() );
86 
87  m_buttonOK->SetDefault();
88 
89  // ensure sizers are up to date
90  // (fix an issue on GTK but should not create issues on other platforms):
91  m_swItemProperties->Fit();
92  m_swGeneralOpts->Fit();
93 
94  m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
95 }
96 
97 
99 {
100  delete m_scintillaTricks;
101 }
102 
103 
104 void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
105 {
106  if( event.GetSelection() == 0 )
107  m_buttonOK->SetDefault();
108  else
109  m_buttonGeneralOptsOK->SetDefault();
110 
111  event.Skip();
112 }
113 
114 
116 {
117  return wxSize( 150, -1 );
118 }
119 
120 
122 {
124 
125  // Set default parameters
128 
131 
134 
137 
139  model.GetLeftMargin() ) );
141  model.GetRightMargin() ) );
143  model.GetTopMargin() ) );
145  model.GetBottomMargin() ) );
146 }
147 
148 
150 {
152 
153  // Import default parameters from widgets
154  model.m_DefaultLineWidth =
156 
157  model.m_DefaultTextSize.x =
159  model.m_DefaultTextSize.y =
161 
162  model.m_DefaultTextThickness =
164 
165  // Get page margins values
166  model.SetRightMargin(
168  model.SetBottomMargin(
170 
171  // coordinates of the left top corner are the left and top margins
172  model.SetLeftMargin(
174  model.SetTopMargin(
176 
177  return true;
178 }
179 
180 
182 {
183  if( !aItem )
184  {
185  m_SizerItemProperties->Show( false );
186  return;
187  }
188 
189  wxString msg;
190 
191  // Set parameters common to all DS_DATA_ITEM types
192  m_staticTextType->SetLabel( aItem->GetClassName() );
193  m_textCtrlComment->SetValue( aItem->m_Info );
194 
195  switch( aItem->GetPage1Option() )
196  {
197  default:
198  case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
199  case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
200  case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
201  }
202 
203  // Position/ start point
206 
209 
210  switch( aItem->m_Pos.m_Anchor )
211  {
212  case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
213  case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
214  case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
215  case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
216  }
217 
218  // End point
223 
224  switch( aItem->m_End.m_Anchor )
225  {
226  case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
227  case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
228  case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
229  case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
230  }
231 
234 
235  // Now, set prms more specific to DS_DATA_ITEM types
236  // For a given type, disable widgets which are not relevant,
237  // and be sure widgets which are relevant are enabled
238  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
239  {
240  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
241  item->m_FullText = item->m_TextBase;
242 
243  // Replace our '\' 'n' sequence by the EOL char
244  item->ReplaceAntiSlashSequence();
245  m_stcText->SetValue( item->m_FullText );
246 
247  msg.Printf( wxT("%d"), item->m_IncrementLabel );
248  m_textCtrlTextIncrement->SetValue( msg );
249 
250  // Rotation (poly and text)
251  msg.Printf( wxT("%.3f"), item->m_Orient );
252  m_textCtrlRotation->SetValue( msg );
253 
254  // Constraints:
259 
260  // Font Options
261  m_checkBoxBold->SetValue( item->m_Bold );
262  m_checkBoxItalic->SetValue( item->m_Italic );
263 
264  switch( item->m_Hjustify )
265  {
266  case GR_TEXT_HJUSTIFY_LEFT: m_choiceHjustify->SetSelection( 0 ); break;
267  case GR_TEXT_HJUSTIFY_CENTER: m_choiceHjustify->SetSelection( 1 ); break;
268  case GR_TEXT_HJUSTIFY_RIGHT: m_choiceHjustify->SetSelection( 2 ); break;
269  }
270 
271  switch( item->m_Vjustify )
272  {
273  case GR_TEXT_VJUSTIFY_TOP: m_choiceVjustify->SetSelection( 0 ); break;
274  case GR_TEXT_VJUSTIFY_CENTER: m_choiceVjustify->SetSelection( 1 ); break;
275  case GR_TEXT_VJUSTIFY_BOTTOM: m_choiceVjustify->SetSelection( 2 ); break;
276  }
277 
278  // Text size
283  }
284 
285  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
286  {
287  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
288 
289  // Rotation (poly and text)
290  msg.Printf( wxT("%.3f"), item->m_Orient );
291  m_textCtrlRotation->SetValue( msg );
292  }
293 
294  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
295  {
296  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
297 
298  // select definition in PPI
299  msg.Printf( wxT("%d"), item->GetPPI() );
300  m_textCtrlBitmapDPI->SetValue( msg );
301  }
302 
303  m_SizerItemProperties->Show( true );
304 
305  m_SizerTextOptions->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
306  m_buttonHelp->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
307 
309  || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
310 
312 
313  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
314  || aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
315  {
316  m_staticTextRot->Show( true );
317  m_textCtrlRotation->Show( true );
318  }
319  else
320  {
321  m_staticTextRot->Show( false );
322  m_textCtrlRotation->Show( false );
323  }
324 
327 
330 
331  // Repeat parameters
332  msg.Printf( wxT("%d"), aItem->m_RepeatCount );
333  m_textCtrlRepeatCount->SetValue( msg );
334 
337 
340 
341  // The number of widgets was modified, so recalculate sizers
342  m_swItemProperties->Layout();
343 #ifdef __WXGTK__
344  // This call is mandatory on wxGTK to initialize the right virtual size and therefore
345  // scrollbars, but for some reason, create issues on Windows (incorrect display
346  // until the frame is resized). Joys of multiplatform dev.
347  m_swItemProperties->Fit();
348 #endif
349 
350  // send a size event to be sure scrollbars will be added/removed as needed
351  m_swItemProperties->PostSizeEvent();
352  m_swItemProperties->Refresh();
353 }
354 
355 
356 void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
357 {
359  PL_SELECTION& selection = selTool->GetSelection();
360 
362 
363  DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
364 
365  if( drawItem )
366  {
367  DS_DATA_ITEM* dataItem = drawItem->GetPeer();
368  CopyPrmsFromPanelToItem( dataItem );
369 
370  // Be sure what is displayed is what is set for item
371  // (mainly, texts can be modified if they contain "\n")
372  CopyPrmsFromItemToPanel( dataItem );
373  m_parent->GetCanvas()->GetView()->Update( drawItem );
374  }
375 
377 
378  // Refresh values, exactly as they are converted, to avoid any mistake
380 
381  m_parent->OnModify();
382 
383  // Rebuild the draw list with the new parameters
385  m_parent->GetCanvas()->Refresh();
386 }
387 
388 
389 void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
390 {
392 
394  model.m_DefaultLineWidth = 0.15;
395  model.m_DefaultTextThickness = 0.15;
396 
398 
399  // Rebuild the draw list with the new parameters
401  m_parent->GetCanvas()->Refresh();
402 }
403 
404 
406 {
407  if( aItem == nullptr )
408  return false;
409 
410  wxString msg;
411 
412  // Import common parameters:
413  aItem->m_Info = m_textCtrlComment->GetValue();
414 
415  switch( m_choicePageOpt->GetSelection() )
416  {
417  default:
418  case 0: aItem->SetPage1Option( ALL_PAGES ); break;
419  case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
420  case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
421  }
422 
423  // Import thickness
426 
427  // Import Start point
430 
431  switch( m_comboBoxCornerPos->GetSelection() )
432  {
433  case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
434  case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
435  case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
436  case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
437  }
438 
439  // Import End point
442 
443  switch( m_comboBoxCornerEnd->GetSelection() )
444  {
445  case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
446  case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
447  case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
448  case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
449  }
450 
451  // Import Repeat prms
452  long itmp;
453  msg = m_textCtrlRepeatCount->GetValue();
454  msg.ToLong( &itmp );
455  aItem->m_RepeatCount = itmp;
456 
461 
462  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
463  {
464  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
465 
466  item->m_TextBase = m_stcText->GetValue();
467 
468  msg = m_textCtrlTextIncrement->GetValue();
469  msg.ToLong( &itmp );
470  item->m_IncrementLabel = itmp;
471 
472  item->m_Bold = m_checkBoxBold->IsChecked();
473  item->m_Italic = m_checkBoxItalic->IsChecked();
474 
475  switch( m_choiceHjustify->GetSelection() )
476  {
477  case 0: item->m_Hjustify = GR_TEXT_HJUSTIFY_LEFT; break;
478  case 1: item->m_Hjustify = GR_TEXT_HJUSTIFY_CENTER; break;
479  case 2: item->m_Hjustify = GR_TEXT_HJUSTIFY_RIGHT; break;
480  }
481 
482  switch( m_choiceVjustify->GetSelection() )
483  {
484  case 0: item->m_Vjustify = GR_TEXT_VJUSTIFY_TOP; break;
485  case 1: item->m_Vjustify = GR_TEXT_VJUSTIFY_CENTER; break;
486  case 2: item->m_Vjustify = GR_TEXT_VJUSTIFY_BOTTOM; break;
487  }
488 
489  msg = m_textCtrlRotation->GetValue();
491 
492  // Import text size
493  item->m_TextSize.x =
495  item->m_TextSize.y =
497 
498  // Import constraints:
499  item->m_BoundingBoxSize.x =
501  item->m_BoundingBoxSize.y =
503  }
504 
505  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
506  {
507  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
508 
509  msg = m_textCtrlRotation->GetValue();
511  }
512 
513  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
514  {
515  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
516  long value;
517 
518  msg = m_textCtrlBitmapDPI->GetValue();
519 
520  if( msg.ToLong( &value ) )
521  item->SetPPI( (int)value );
522  }
523 
524  return true;
525 }
526 
527 
528 void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
529 {
530  wxArrayString autocompleteTokens;
531  int pos = m_stcText->GetCurrentPos();
532  int start = m_stcText->WordStartPosition( pos, true );
533  wxString partial;
534 
535  if( start >= 2
536  && m_stcText->GetCharAt( start-2 ) == '$'
537  && m_stcText->GetCharAt( start-1 ) == '{' )
538  {
539  DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
540 
541  partial = m_stcText->GetTextRange( start, pos );
542 
543  for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
544  autocompleteTokens.push_back( entry.first );
545  }
546 
547  m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
548  m_stcText->SetFocus();
549 }
550 
551 
552 void PROPERTIES_FRAME::onHelp( wxCommandEvent& aEvent )
553 {
554  // Show the system variables for worksheet text:
555  HTML_MESSAGE_BOX dlg( this, _( "Predefined Keywords" ) );
556  wxString message;
557 
558  message << _( "Texts can include keywords." ) << "<br>";
559  message << _( "Keyword notation is ${keyword}" ) << "<br>";
560  message << _( "Each keyword is replaced by its value" ) << "<br><br>";
561  message << _( "These build-in keywords are always available:" ) << "<br><br>";
562  dlg.AddHTML_Text( message );
563 
564  message = "KICAD_VERSION\n";
565  message << "# " << _( "(sheet number)" ) << "\n";
566  message << "## " << _( "(sheet count)" ) << "\n";
567  message << "COMMENT1 thru COMMENT9\n";
568  message << "COMPANY\n";
569  message << "FILENAME\n";
570  message << "ISSUE_DATE\n";
571  message << "LAYER\n";
572  message << "PAPER " << _( "(paper size)" ) << "\n";
573  message << "REVISION\n";
574  message << "SHEETNAME\n";
575  message << "TITLE\n";
576 
577  dlg.ListSet( message );
578  dlg.ShowModal();
579 }
wxString m_Info
Definition: ds_data_item.h:199
UNIT_BINDER m_textCtrlConstraintXBinder
virtual std::map< wxString, wxString > & GetTextVars() const
Definition: project.cpp:78
Handle the graphic items list to draw/plot the frame and title block.
Definition: ds_data_model.h:38
UNIT_BINDER m_textCtrlStepXBinder
void onHelp(wxCommandEvent &aEvent) override
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
wxScrolledWindow * m_swItemProperties
EDA_TEXT_VJUSTIFY_T m_Vjustify
Definition: ds_data_item.h:339
double GetRightMargin()
Definition: ds_data_model.h:66
UNIT_BINDER m_textCtrlTopMarginBinder
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
wxStaticText * m_staticTextInclabel
UNIT_BINDER m_textCtrlBottomMarginBinder
void SetBottomMargin(double aMargin)
Definition: ds_data_model.h:73
UNIT_BINDER m_textCtrlEndXBinder
void OnAcceptPrms(wxCommandEvent &event) override
The main window used in the drawing sheet editor.
DPOINT DSIZE
Definition: vector2d.h:646
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
double m_DefaultLineWidth
wxStaticText * m_staticTextBitmapDPI
double GetTopMargin()
Definition: ds_data_model.h:69
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:144
UNIT_BINDER m_textCtrlPosYBinder
UNIT_BINDER m_textCtrlRightMarginBinder
void SetLeftMargin(double aMargin)
Definition: ds_data_model.h:64
#define TB_DEFAULT_TEXTSIZE
Definition: ds_data_item.h:35
double GetLeftMargin()
Definition: ds_data_model.h:63
POINT_COORD m_End
Definition: ds_data_item.h:201
void OnPageChanged(wxNotebookEvent &event) override
void DisplayDrawingSheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
void SetRightMargin(double aMargin)
Definition: ds_data_model.h:67
PL_SELECTION & GetSelection()
Return the set of currently selected items.
UNIT_BINDER m_textCtrlDefaultTextSizeXBinder
double m_DefaultTextThickness
void OnModify()
Must be called after a change in order to set the "modify" flag.
EDA_TEXT_HJUSTIFY_T m_Hjustify
Definition: ds_data_item.h:338
Base class to handle basic graphic items.
Definition: ds_draw_item.h:58
DPOINT m_IncrementVector
Definition: ds_data_item.h:204
double m_LineWidth
Definition: ds_data_item.h:202
UNIT_BINDER m_textCtrlEndYBinder
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
wxStyledTextCtrl * m_stcText
DS_ITEM_TYPE GetType() const
Definition: ds_data_item.h:128
DSIZE m_DefaultTextSize
const wxString GetClassName() const
UNIT_BINDER m_textCtrlDefaultTextThicknessBinder
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:89
DPOINT m_Pos
Definition: ds_data_item.h:80
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
void ListSet(const wxString &aList)
Add a list of items.
double GetBottomMargin()
Definition: ds_data_model.h:72
void SetTopMargin(double aMargin)
Definition: ds_data_model.h:70
int m_IncrementLabel
Definition: ds_data_item.h:205
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
UNIT_BINDER m_textCtrlConstraintYBinder
void SetPPI(int aBitmapPPI)
wxSize GetMinSize() const override
#define _(s)
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
UNIT_BINDER m_textCtrlStepYBinder
UNIT_BINDER m_textCtrlThicknessBinder
wxStaticBoxSizer * m_sbSizerEndPosition
UNIT_BINDER m_textCtrlDefaultTextSizeYBinder
SCINTILLA_TRICKS * m_scintillaTricks
UNIT_BINDER m_textCtrlPosXBinder
UNIT_BINDER m_textCtrlDefaultLineWidthBinder
void SetPage1Option(PAGE_OPTION aChoice)
Definition: ds_data_item.h:134
DS_DATA_ITEM * GetPeer() const
Definition: ds_draw_item.h:63
PROPERTIES_FRAME(PL_EDITOR_FRAME *aParent)
double To_User_Unit(EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:68
bool CopyPrmsFromPanelToItem(DS_DATA_ITEM *aItem)
POINT_COORD m_Pos
Definition: ds_data_item.h:200
bool ReplaceAntiSlashSequence()
Replace the '\''n' sequence by EOL and the sequence '\''\' by only one '\' inside m_FullText.
Drawing sheet structure type definitions.
Definition: ds_data_item.h:95
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
UNIT_BINDER m_textCtrlTextSizeYBinder
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...
PL_EDITOR_FRAME * m_parent
virtual long long int GetValue()
Return the current value in Internal Units.
void SaveCopyInUndoList()
Save a copy of the description (in a S expr string) for Undo/redo commands.
UNIT_BINDER m_textCtrlLeftMarginBinder
wxScrolledWindow * m_swGeneralOpts
void CopyPrmsFromItemToPanel(DS_DATA_ITEM *aItem)
wxStaticText * m_staticTextSizeInfo
UNIT_BINDER m_textCtrlTextSizeXBinder
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:307
void OnSetDefaultValues(wxCommandEvent &event) override
double From_User_Unit(EDA_UNITS aUnits, double aValue)
Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg".
Definition: base_units.cpp:282
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:1570
PAGE_OPTION GetPage1Option() const
Definition: ds_data_item.h:133
Class PANEL_PROPERTIES_BASE.