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  // ensure sizers are up to date
74  // (fix an issue on GTK but should not create issues on other platforms):
75  m_swItemProperties->Fit();
76  m_swGeneralOpts->Fit();
77 
78  m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
79 }
80 
81 
83 {
84  delete m_scintillaTricks;
85 }
86 
87 
88 void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
89 {
90  if( event.GetSelection() == 0 )
91  m_buttonOK->SetDefault();
92  else
93  m_buttonGeneralOptsOK->SetDefault();
94 
95  event.Skip();
96 }
97 
98 
100 {
101  return wxSize( 150, -1 );
102 }
103 
104 
105 // Data transfer from general properties to widgets
107 {
109 
110  // Set default parameters
113 
116 
119 
122 
127 }
128 
129 // Data transfer from widgets to general properties
131 {
133 
134  // Import default parameters from widgets
135  model.m_DefaultLineWidth =
137 
138  model.m_DefaultTextSize.x =
140  model.m_DefaultTextSize.y =
142 
143  model.m_DefaultTextThickness =
145 
146  // Get page margins values
147  model.SetRightMargin(
149  model.SetBottomMargin(
151 
152  // coordinates of the left top corner are the left and top margins
153  model.SetLeftMargin(
155  model.SetTopMargin(
157 
158  return true;
159 }
160 
161 
162 // Data transfer from item to widgets in properties frame
164 {
165  if( !aItem )
166  {
167  m_SizerItemProperties->Show( false );
168  return;
169  }
170 
171  wxString msg;
172 
173  // Set parameters common to all DS_DATA_ITEM types
174  m_staticTextType->SetLabel( aItem->GetClassName() );
175  m_textCtrlComment->SetValue( aItem->m_Info );
176 
177  switch( aItem->GetPage1Option() )
178  {
179  default:
180  case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
181  case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
182  case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
183  }
184 
185  // Position/ start point
188 
191 
192  switch( aItem->m_Pos.m_Anchor )
193  {
194  case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
195  case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
196  case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
197  case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
198  }
199 
200  // End point
205 
206  switch( aItem->m_End.m_Anchor )
207  {
208  case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
209  case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
210  case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
211  case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
212  }
213 
216 
217  // Now, set prms more specific to DS_DATA_ITEM types
218  // For a given type, disable widgets which are not relevant,
219  // and be sure widgets which are relevant are enabled
220  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
221  {
222  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
223  item->m_FullText = item->m_TextBase;
224  // Replace our '\' 'n' sequence by the EOL char
225  item->ReplaceAntiSlashSequence();
226  m_stcText->SetValue( item->m_FullText );
227 
228  msg.Printf( wxT("%d"), item->m_IncrementLabel );
229  m_textCtrlTextIncrement->SetValue( msg );
230 
231  // Rotation (poly and text)
232  msg.Printf( wxT("%.3f"), item->m_Orient );
233  m_textCtrlRotation->SetValue( msg );
234 
235  // Constraints:
240 
241  // Font Options
242  m_checkBoxBold->SetValue( item->m_Bold );
243  m_checkBoxItalic->SetValue( item->m_Italic );
244 
245  switch( item->m_Hjustify )
246  {
247  case GR_TEXT_HJUSTIFY_LEFT: m_choiceHjustify->SetSelection( 0 ); break;
248  case GR_TEXT_HJUSTIFY_CENTER: m_choiceHjustify->SetSelection( 1 ); break;
249  case GR_TEXT_HJUSTIFY_RIGHT: m_choiceHjustify->SetSelection( 2 ); break;
250  }
251 
252  switch( item->m_Vjustify )
253  {
254  case GR_TEXT_VJUSTIFY_TOP: m_choiceVjustify->SetSelection( 0 ); break;
255  case GR_TEXT_VJUSTIFY_CENTER: m_choiceVjustify->SetSelection( 1 ); break;
256  case GR_TEXT_VJUSTIFY_BOTTOM: m_choiceVjustify->SetSelection( 2 ); break;
257  }
258 
259  // Text size
264  }
265 
266  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
267  {
268  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
269  // Rotation (poly and text)
270  msg.Printf( wxT("%.3f"), item->m_Orient );
271  m_textCtrlRotation->SetValue( msg );
272  }
273 
274  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
275  {
276  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
277  // select definition in PPI
278  msg.Printf( wxT("%d"), item->GetPPI() );
279  m_textCtrlBitmapDPI->SetValue( msg );
280  }
281 
282  m_SizerItemProperties->Show( true );
283 
284  m_SizerTextOptions->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
285 
287  || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
288 
290 
291  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
292  || aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
293  {
294  m_staticTextRot->Show( true );
295  m_textCtrlRotation->Show( true );
296  }
297  else
298  {
299  m_staticTextRot->Show( false );
300  m_textCtrlRotation->Show( false );
301  }
302 
305 
308 
309  // Repeat parameters
310  msg.Printf( wxT("%d"), aItem->m_RepeatCount );
311  m_textCtrlRepeatCount->SetValue( msg );
312 
315 
318 
319  // The number of widgets was modified, so recalculate sizers
320  m_swItemProperties->Layout();
321 #ifdef __WXGTK__
322  // This call is mandatory on wxGTK to initialize the right virtual size and therefore
323  // scrollbars, but for some reason, create issues on Windows (incorrect display
324  // until the frame is resized). Joys of multiplatform dev.
325  m_swItemProperties->Fit();
326 #endif
327  // send a size event to be sure scrollbars will be added/removed as needed
328  m_swItemProperties->PostSizeEvent();
329  m_swItemProperties->Refresh();
330 }
331 
332 
333 // Event function called by clicking on the OK button
334 void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
335 {
337  PL_SELECTION& selection = selTool->GetSelection();
338 
340 
341  DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
342 
343  if( drawItem )
344  {
345  DS_DATA_ITEM* dataItem = drawItem->GetPeer();
346  CopyPrmsFromPanelToItem( dataItem );
347  // Be sure what is displayed is what is set for item
348  // (mainly, texts can be modified if they contain "\n")
349  CopyPrmsFromItemToPanel( dataItem );
350  m_parent->GetCanvas()->GetView()->Update( drawItem );
351  }
352 
354 
355  // Refresh values, exactly as they are converted, to avoid any mistake
357 
358  m_parent->OnModify();
359 
360  // Rebuild the draw list with the new parameters
362  m_parent->GetCanvas()->Refresh();
363 }
364 
365 
366 void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
367 {
369 
371  model.m_DefaultLineWidth = 0.15;
372  model.m_DefaultTextThickness = 0.15;
373 
375 
376  // Rebuild the draw list with the new parameters
378  m_parent->GetCanvas()->Refresh();
379 }
380 
381 
382 // Data transfer from properties frame to item parameters
384 {
385  if( aItem == NULL )
386  return false;
387 
388  wxString msg;
389 
390  // Import common parameters:
391  aItem->m_Info = m_textCtrlComment->GetValue();
392 
393  switch( m_choicePageOpt->GetSelection() )
394  {
395  default:
396  case 0: aItem->SetPage1Option( ALL_PAGES ); break;
397  case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
398  case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
399  }
400 
401  // Import thickness
403 
404  // Import Start point
407 
408  switch( m_comboBoxCornerPos->GetSelection() )
409  {
410  case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
411  case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
412  case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
413  case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
414  }
415 
416  // Import End point
419 
420  switch( m_comboBoxCornerEnd->GetSelection() )
421  {
422  case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
423  case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
424  case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
425  case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
426  }
427 
428  // Import Repeat prms
429  long itmp;
430  msg = m_textCtrlRepeatCount->GetValue();
431  msg.ToLong( &itmp );
432  aItem->m_RepeatCount = itmp;
433 
436 
437  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
438  {
439  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
440 
441  item->m_TextBase = m_stcText->GetValue();
442 
443  msg = m_textCtrlTextIncrement->GetValue();
444  msg.ToLong( &itmp );
445  item->m_IncrementLabel = itmp;
446 
447  item->m_Bold = m_checkBoxBold->IsChecked();
448  item->m_Italic = m_checkBoxItalic->IsChecked();
449 
450  switch( m_choiceHjustify->GetSelection() )
451  {
452  case 0: item->m_Hjustify = GR_TEXT_HJUSTIFY_LEFT; break;
453  case 1: item->m_Hjustify = GR_TEXT_HJUSTIFY_CENTER; break;
454  case 2: item->m_Hjustify = GR_TEXT_HJUSTIFY_RIGHT; break;
455  }
456 
457  switch( m_choiceVjustify->GetSelection() )
458  {
459  case 0: item->m_Vjustify = GR_TEXT_VJUSTIFY_TOP; break;
460  case 1: item->m_Vjustify = GR_TEXT_VJUSTIFY_CENTER; break;
461  case 2: item->m_Vjustify = GR_TEXT_VJUSTIFY_BOTTOM; break;
462  }
463 
464  msg = m_textCtrlRotation->GetValue();
466 
467  // Import text size
468  item->m_TextSize.x =
470  item->m_TextSize.y =
472 
473  // Import constraints:
474  item->m_BoundingBoxSize.x =
476  item->m_BoundingBoxSize.y =
478  }
479 
480  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
481  {
482  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
483 
484  msg = m_textCtrlRotation->GetValue();
486  }
487 
488  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
489  {
490  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
491  long value;
492 
493  msg = m_textCtrlBitmapDPI->GetValue();
494 
495  if( msg.ToLong( &value ) )
496  item->SetPPI( (int)value );
497  }
498 
499  return true;
500 }
501 
502 
503 void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
504 {
505  wxArrayString autocompleteTokens;
506  int pos = m_stcText->GetCurrentPos();
507  int start = m_stcText->WordStartPosition( pos, true );
508  wxString partial;
509 
510  if( start >= 2
511  && m_stcText->GetCharAt( start-2 ) == '$'
512  && m_stcText->GetCharAt( start-1 ) == '{' )
513  {
514  DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
515 
516  partial = m_stcText->GetTextRange( start, pos );
517 
518  for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
519  autocompleteTokens.push_back( entry.first );
520  }
521 
522  m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
523  m_stcText->SetFocus();
524 }
wxString m_Info
Definition: ds_data_item.h:199
UNIT_BINDER m_textCtrlConstraintXBinder
virtual std::map< wxString, wxString > & GetTextVars() const
Definition: project.cpp:79
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:339
double GetRightMargin()
Definition: ds_data_model.h:66
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:73
UNIT_BINDER m_textCtrlEndXBinder
void OnAcceptPrms(wxCommandEvent &event) override
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:69
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
#define NULL
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.
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
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: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
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
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:306
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:281
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:1504
PAGE_OPTION GetPage1Option() const
Definition: ds_data_item.h:133
Class PANEL_PROPERTIES_BASE.