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  PANEL_PROPERTIES_BASE( aParent ),
40  m_scintillaTricks( nullptr ),
41  m_textCtrlTextSizeXBinder( aParent, m_staticTextTsizeX, m_textCtrlTextSizeX, m_TextTextSizeXUnits ),
42  m_textCtrlTextSizeYBinder( aParent, m_staticTextTsizeY, m_textCtrlTextSizeY, m_TextTextSizeYUnits ),
43  m_textCtrlConstraintXBinder( aParent, m_staticTextConstraintX, m_textCtrlConstraintX, m_TextConstraintXUnits ),
44  m_textCtrlConstraintYBinder( aParent, m_staticTextConstraintY, m_textCtrlConstraintY, m_TextConstraintYUnits ),
45  m_textCtrlPosXBinder( aParent, m_staticTextPosX, m_textCtrlPosX, m_TextPosXUnits ),
46  m_textCtrlPosYBinder( aParent, m_staticTextPosY, m_textCtrlPosY, m_TextPosYUnits ),
47  m_textCtrlEndXBinder( aParent, m_staticTextEndX, m_textCtrlEndX, m_TextEndXUnits ),
48  m_textCtrlEndYBinder( aParent, m_staticTextEndY, m_textCtrlEndY, m_TextEndYUnits ),
49  m_textCtrlStepXBinder( aParent, m_staticTextStepX, m_textCtrlStepX, m_TextStepXUnits ),
50  m_textCtrlStepYBinder( aParent, m_staticTextStepY, m_textCtrlStepY, m_TextStepYUnits ),
51  m_textCtrlDefaultTextSizeXBinder( aParent, m_staticTextDefTsX, m_textCtrlDefaultTextSizeX, m_TextDefaultTextSizeXUnits ),
52  m_textCtrlDefaultTextSizeYBinder( aParent, m_staticTextDefTsY, m_textCtrlDefaultTextSizeY, m_TextDefaultTextSizeYUnits ),
53  m_textCtrlDefaultLineWidthBinder( aParent, m_staticTextDefLineW, m_textCtrlDefaultLineWidth, m_TextDefaultLineWidthUnits ),
54  m_textCtrlDefaultTextThicknessBinder( aParent, m_staticTextDefTextThickness, m_textCtrlDefaultTextThickness, m_TextDefaultTextThicknessUnits ),
55  m_textCtrlLeftMarginBinder( aParent, m_staticTextLeftMargin, m_textCtrlLeftMargin, m_TextLeftMarginUnits ),
56  m_textCtrlRightMarginBinder( aParent, m_staticTextDefRightMargin, m_textCtrlRightMargin, m_TextRightMarginUnits ),
57  m_textCtrlTopMarginBinder( aParent, m_staticTextTopMargin, m_textCtrlTopMargin, m_TextTopMarginUnits ),
58  m_textCtrlBottomMarginBinder( aParent, m_staticTextBottomMargin, m_textCtrlBottomMargin, m_TextBottomMarginUnits ),
59  m_textCtrlThicknessBinder( aParent, m_staticTextThickness, m_textCtrlThickness, m_TextLineThicknessUnits )
60 {
61  m_parent = aParent;
62 
63  m_stcText->SetUseVerticalScrollBar( false );
64  m_stcText->SetUseHorizontalScrollBar( false );
65  m_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ) );
66 
67  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
68  infoFont.SetSymbolicSize( wxFONTSIZE_X_SMALL );
69  m_staticTextSizeInfo->SetFont( infoFont );
70 
71  m_buttonOK->SetDefault();
72 
73  m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
74 }
75 
76 
78 {
79  delete m_scintillaTricks;
80 }
81 
82 
83 void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
84 {
85  if( event.GetSelection() == 0 )
86  m_buttonOK->SetDefault();
87  else
88  m_buttonGeneralOptsOK->SetDefault();
89 
90  event.Skip();
91 }
92 
93 
95 {
96  return wxSize( 150, -1 );
97 }
98 
99 
100 // Data transfert from general properties to widgets
102 {
104 
105  // Set default parameters
108 
111 
114 
117 
122 }
123 
124 // Data transfert from widgets to general properties
126 {
128 
129  // Import default parameters from widgets
130  model.m_DefaultLineWidth =
132 
133  model.m_DefaultTextSize.x =
135  model.m_DefaultTextSize.y =
137 
138  model.m_DefaultTextThickness =
140 
141  // Get page margins values
142  model.SetRightMargin(
144  model.SetBottomMargin(
146 
147  // cordinates of the left top corner are the left and top margins
148  model.SetLeftMargin(
150  model.SetTopMargin(
152 
153  return true;
154 }
155 
156 
157 // Data transfert from item to widgets in properties frame
159 {
160  if( !aItem )
161  {
162  m_SizerItemProperties->Show( false );
163  return;
164  }
165 
166  wxString msg;
167 
168  // Set parameters common to all DS_DATA_ITEM types
169  m_staticTextType->SetLabel( aItem->GetClassName() );
170  m_textCtrlComment->SetValue( aItem->m_Info );
171 
172  switch( aItem->GetPage1Option() )
173  {
174  default:
175  case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
176  case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
177  case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
178  }
179 
180  // Position/ start point
183 
186 
187  switch( aItem->m_Pos.m_Anchor )
188  {
189  case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
190  case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
191  case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
192  case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
193  }
194 
195  // End point
200 
201  switch( aItem->m_End.m_Anchor )
202  {
203  case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
204  case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
205  case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
206  case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
207  }
208 
211 
212  // Now, set prms more specific to DS_DATA_ITEM types
213  // For a given type, disable widgets which are not relevant,
214  // and be sure widgets which are relevant are enabled
215  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
216  {
217  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
218  item->m_FullText = item->m_TextBase;
219  // Replace our '\' 'n' sequence by the EOL char
220  item->ReplaceAntiSlashSequence();
221  m_stcText->SetValue( item->m_FullText );
222 
223  msg.Printf( wxT("%d"), item->m_IncrementLabel );
224  m_textCtrlTextIncrement->SetValue( msg );
225 
226  // Rotation (poly and text)
227  msg.Printf( wxT("%.3f"), item->m_Orient );
228  m_textCtrlRotation->SetValue( msg );
229 
230  // Constraints:
235 
236  // Font Options
237  m_checkBoxBold->SetValue( item->m_Bold );
238  m_checkBoxItalic->SetValue( item->m_Italic );
239 
240  switch( item->m_Hjustify )
241  {
242  case GR_TEXT_HJUSTIFY_LEFT: m_choiceHjustify->SetSelection( 0 ); break;
243  case GR_TEXT_HJUSTIFY_CENTER: m_choiceHjustify->SetSelection( 1 ); break;
244  case GR_TEXT_HJUSTIFY_RIGHT: m_choiceHjustify->SetSelection( 2 ); break;
245  }
246 
247  switch( item->m_Vjustify )
248  {
249  case GR_TEXT_VJUSTIFY_TOP: m_choiceVjustify->SetSelection( 0 ); break;
250  case GR_TEXT_VJUSTIFY_CENTER: m_choiceVjustify->SetSelection( 1 ); break;
251  case GR_TEXT_VJUSTIFY_BOTTOM: m_choiceVjustify->SetSelection( 2 ); break;
252  }
253 
254  // Text size
259  }
260 
261  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
262  {
263  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
264  // Rotation (poly and text)
265  msg.Printf( wxT("%.3f"), item->m_Orient );
266  m_textCtrlRotation->SetValue( msg );
267  }
268 
269  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
270  {
271  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
272  // select definition in PPI
273  msg.Printf( wxT("%d"), item->GetPPI() );
274  m_textCtrlBitmapDPI->SetValue( msg );
275  }
276 
277  m_SizerItemProperties->Show( true );
278 
279  m_SizerTextOptions->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
280 
282  || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
283 
285 
286  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
287  || aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
288  {
289  m_staticTextRot->Show( true );
290  m_textCtrlRotation->Show( true );
291  }
292  else
293  {
294  m_staticTextRot->Show( false );
295  m_textCtrlRotation->Show( false );
296  }
297 
300 
303 
304  // Repeat parameters
305  msg.Printf( wxT("%d"), aItem->m_RepeatCount );
306  m_textCtrlRepeatCount->SetValue( msg );
307 
310 
313 
314  // The number of widgets was modified, so recalculate sizers
315  m_swItemProperties->Layout();
316 #ifdef __WXGTK__
317  // This call is mandatory on wxGTK to initialize the right virtual size and therefore
318  // scrollbars, but for some reason, create issues on Windows (incorrect disply
319  // until the frame is resized). Joys of multiplatform dev.
320  m_swItemProperties->Fit();
321 #endif
322  // send a size event to be sure scrollbars will be added/removed as needed
323  m_swItemProperties->PostSizeEvent();
324  m_swItemProperties->Refresh();
325 }
326 
327 
328 // Event function called by clicking on the OK button
329 void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
330 {
332  PL_SELECTION& selection = selTool->GetSelection();
333 
335 
336  DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
337 
338  if( drawItem )
339  {
340  DS_DATA_ITEM* dataItem = drawItem->GetPeer();
341  CopyPrmsFromPanelToItem( dataItem );
342  // Be sure what is displayed is what is set for item
343  // (mainly, texts can be modified if they contain "\n")
344  CopyPrmsFromItemToPanel( dataItem );
345  m_parent->GetCanvas()->GetView()->Update( drawItem );
346  }
347 
349 
350  // Refresh values, exactly as they are converted, to avoid any mistake
352 
353  m_parent->OnModify();
354 
355  // Rebuild the draw list with the new parameters
357  m_parent->GetCanvas()->Refresh();
358 }
359 
360 
361 void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
362 {
364 
366  model.m_DefaultLineWidth = 0.15;
367  model.m_DefaultTextThickness = 0.15;
368 
370 
371  // Rebuild the draw list with the new parameters
373  m_parent->GetCanvas()->Refresh();
374 }
375 
376 
377 // Data transfert from properties frame to item parameters
379 {
380  if( aItem == NULL )
381  return false;
382 
383  wxString msg;
384 
385  // Import common parameters:
386  aItem->m_Info = m_textCtrlComment->GetValue();
387 
388  switch( m_choicePageOpt->GetSelection() )
389  {
390  default:
391  case 0: aItem->SetPage1Option( ALL_PAGES ); break;
392  case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
393  case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
394  }
395 
396  // Import thickness
398 
399  // Import Start point
402 
403  switch( m_comboBoxCornerPos->GetSelection() )
404  {
405  case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
406  case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
407  case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
408  case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
409  }
410 
411  // Import End point
414 
415  switch( m_comboBoxCornerEnd->GetSelection() )
416  {
417  case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
418  case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
419  case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
420  case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
421  }
422 
423  // Import Repeat prms
424  long itmp;
425  msg = m_textCtrlRepeatCount->GetValue();
426  msg.ToLong( &itmp );
427  aItem->m_RepeatCount = itmp;
428 
431 
432  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
433  {
434  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
435 
436  item->m_TextBase = m_stcText->GetValue();
437 
438  msg = m_textCtrlTextIncrement->GetValue();
439  msg.ToLong( &itmp );
440  item->m_IncrementLabel = itmp;
441 
442  item->m_Bold = m_checkBoxBold->IsChecked();
443  item->m_Italic = m_checkBoxItalic->IsChecked();
444 
445  switch( m_choiceHjustify->GetSelection() )
446  {
447  case 0: item->m_Hjustify = GR_TEXT_HJUSTIFY_LEFT; break;
448  case 1: item->m_Hjustify = GR_TEXT_HJUSTIFY_CENTER; break;
449  case 2: item->m_Hjustify = GR_TEXT_HJUSTIFY_RIGHT; break;
450  }
451 
452  switch( m_choiceVjustify->GetSelection() )
453  {
454  case 0: item->m_Vjustify = GR_TEXT_VJUSTIFY_TOP; break;
455  case 1: item->m_Vjustify = GR_TEXT_VJUSTIFY_CENTER; break;
456  case 2: item->m_Vjustify = GR_TEXT_VJUSTIFY_BOTTOM; break;
457  }
458 
459  msg = m_textCtrlRotation->GetValue();
461 
462  // Import text size
463  item->m_TextSize.x =
465  item->m_TextSize.y =
467 
468  // Import constraints:
469  item->m_BoundingBoxSize.x =
471  item->m_BoundingBoxSize.y =
473  }
474 
475  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
476  {
477  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
478 
479  msg = m_textCtrlRotation->GetValue();
481  }
482 
483  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
484  {
485  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
486  long value;
487 
488  msg = m_textCtrlBitmapDPI->GetValue();
489 
490  if( msg.ToLong( &value ) )
491  item->SetPPI( (int)value );
492  }
493 
494  return true;
495 }
496 
497 
498 void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
499 {
500  wxArrayString autocompleteTokens;
501  int pos = m_stcText->GetCurrentPos();
502  int start = m_stcText->WordStartPosition( pos, true );
503  wxString partial;
504 
505  if( start >= 2
506  && m_stcText->GetCharAt( start-2 ) == '$'
507  && m_stcText->GetCharAt( start-1 ) == '{' )
508  {
509  DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
510 
511  partial = m_stcText->GetTextRange( start, pos );
512 
513  for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
514  autocompleteTokens.push_back( entry.first );
515  }
516 
517  m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
518  m_stcText->SetFocus();
519 }
wxString m_Info
Definition: ds_data_item.h:208
UNIT_BINDER m_textCtrlConstraintXBinder
virtual std::map< wxString, wxString > & GetTextVars() const
Handle the graphic items list to draw/plot the frame and title block.
Definition: ds_data_model.h:38
UNIT_BINDER m_textCtrlStepXBinder
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:344
double GetRightMargin()
Definition: ds_data_model.h:63
UNIT_BINDER m_textCtrlTopMarginBinder
Add cut/copy/paste, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
wxStaticText * m_staticTextInclabel
UNIT_BINDER m_textCtrlBottomMarginBinder
void SetBottomMargin(double aMargin)
Definition: ds_data_model.h:70
UNIT_BINDER m_textCtrlEndXBinder
void OnAcceptPrms(wxCommandEvent &event) override
PL_EDITOR_FRAME is the main window used in the drawing sheet editor.
DPOINT DSIZE
Definition: vector2d.h:629
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
double m_DefaultLineWidth
wxStaticText * m_staticTextBitmapDPI
double GetTopMargin()
Definition: ds_data_model.h:66
UNIT_BINDER m_textCtrlPosYBinder
UNIT_BINDER m_textCtrlRightMarginBinder
void SetLeftMargin(double aMargin)
Definition: ds_data_model.h:61
#define TB_DEFAULT_TEXTSIZE
Definition: ds_data_item.h:35
double GetLeftMargin()
Definition: ds_data_model.h:60
POINT_COORD m_End
Definition: ds_data_item.h:210
void OnPageChanged(wxNotebookEvent &event) override
void DisplayWorksheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
void SetRightMargin(double aMargin)
Definition: ds_data_model.h:64
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:343
Base class to handle basic graphic items.
Definition: ds_draw_item.h:58
DPOINT m_IncrementVector
Definition: ds_data_item.h:213
double m_LineWidth
Definition: ds_data_item.h:211
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:129
#define NULL
DSIZE m_DefaultTextSize
const wxString GetClassName() const
UNIT_BINDER m_textCtrlDefaultTextThicknessBinder
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:88
DPOINT m_Pos
Definition: ds_data_item.h:80
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
double GetBottomMargin()
Definition: ds_data_model.h:69
void SetTopMargin(double aMargin)
Definition: ds_data_model.h:67
int m_IncrementLabel
Definition: ds_data_item.h:215
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
UNIT_BINDER m_textCtrlConstraintYBinder
void SetPPI(int aBitmapPPI)
wxSize GetMinSize() const override
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
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
UNIT_BINDER m_textCtrlPosXBinder
UNIT_BINDER m_textCtrlDefaultLineWidthBinder
void SetPage1Option(PAGE_OPTION aChoice)
Definition: ds_data_item.h:135
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:91
bool CopyPrmsFromPanelToItem(DS_DATA_ITEM *aItem)
POINT_COORD m_Pos
Definition: ds_data_item.h:209
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
UNIT_BINDER m_textCtrlTextSizeYBinder
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
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:55
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:338
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:313
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:1508
PAGE_OPTION GetPage1Option() const
Definition: ds_data_item.h:134
Class PANEL_PROPERTIES_BASE.