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_scintillaTricks = new SCINTILLA_TRICKS( m_stcText, wxT( "{}" ), false );
83 
84  m_staticTextSizeInfo->SetFont( KIUI::GetInfoFont( this ).Italic() );
85 
86  m_buttonOK->SetDefault();
87 
88  // ensure sizers are up to date
89  // (fix an issue on GTK but should not create issues on other platforms):
90  m_swItemProperties->Fit();
91  m_swGeneralOpts->Fit();
92 
93  m_stcText->Bind( wxEVT_STC_CHARADDED, &PROPERTIES_FRAME::onScintillaCharAdded, this );
94 }
95 
96 
98 {
99  delete m_scintillaTricks;
100 }
101 
102 
103 void PROPERTIES_FRAME::OnPageChanged( wxNotebookEvent& event )
104 {
105  if( event.GetSelection() == 0 )
106  m_buttonOK->SetDefault();
107  else
108  m_buttonGeneralOptsOK->SetDefault();
109 
110  event.Skip();
111 }
112 
113 
115 {
116  return wxSize( 150, -1 );
117 }
118 
119 
121 {
123 
124  // Set default parameters
127 
130 
133 
136 
138  model.GetLeftMargin() ) );
140  model.GetRightMargin() ) );
142  model.GetTopMargin() ) );
144  model.GetBottomMargin() ) );
145 }
146 
147 
149 {
151 
152  // Import default parameters from widgets
153  model.m_DefaultLineWidth =
155 
156  model.m_DefaultTextSize.x =
158  model.m_DefaultTextSize.y =
160 
161  model.m_DefaultTextThickness =
163 
164  // Get page margins values
165  model.SetRightMargin(
167  model.SetBottomMargin(
169 
170  // coordinates of the left top corner are the left and top margins
171  model.SetLeftMargin(
173  model.SetTopMargin(
175 
176  return true;
177 }
178 
179 
181 {
182  if( !aItem )
183  {
184  m_SizerItemProperties->Show( false );
185  return;
186  }
187 
188  wxString msg;
189 
190  // Set parameters common to all DS_DATA_ITEM types
191  m_staticTextType->SetLabel( aItem->GetClassName() );
192  m_textCtrlComment->SetValue( aItem->m_Info );
193 
194  switch( aItem->GetPage1Option() )
195  {
196  default:
197  case ALL_PAGES: m_choicePageOpt->SetSelection( 0 ); break;
198  case FIRST_PAGE_ONLY: m_choicePageOpt->SetSelection( 1 ); break;
199  case SUBSEQUENT_PAGES: m_choicePageOpt->SetSelection( 2 ); break;
200  }
201 
202  // Position/ start point
205 
208 
209  switch( aItem->m_Pos.m_Anchor )
210  {
211  case RB_CORNER: m_comboBoxCornerPos->SetSelection( 2 ); break;
212  case RT_CORNER: m_comboBoxCornerPos->SetSelection( 0 ); break;
213  case LB_CORNER: m_comboBoxCornerPos->SetSelection( 3 ); break;
214  case LT_CORNER: m_comboBoxCornerPos->SetSelection( 1 ); break;
215  }
216 
217  // End point
222 
223  switch( aItem->m_End.m_Anchor )
224  {
225  case RB_CORNER: m_comboBoxCornerEnd->SetSelection( 2 ); break;
226  case RT_CORNER: m_comboBoxCornerEnd->SetSelection( 0 ); break;
227  case LB_CORNER: m_comboBoxCornerEnd->SetSelection( 3 ); break;
228  case LT_CORNER: m_comboBoxCornerEnd->SetSelection( 1 ); break;
229  }
230 
233 
234  // Now, set prms more specific to DS_DATA_ITEM types
235  // For a given type, disable widgets which are not relevant,
236  // and be sure widgets which are relevant are enabled
237  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
238  {
239  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
240  item->m_FullText = item->m_TextBase;
241 
242  // Replace our '\' 'n' sequence by the EOL char
243  item->ReplaceAntiSlashSequence();
244  m_stcText->SetValue( item->m_FullText );
245 
246  msg.Printf( wxT("%d"), item->m_IncrementLabel );
247  m_textCtrlTextIncrement->SetValue( msg );
248 
249  // Rotation (poly and text)
250  msg.Printf( wxT("%.3f"), item->m_Orient );
251  m_textCtrlRotation->SetValue( msg );
252 
253  // Constraints:
258 
259  // Font Options
260  m_checkBoxBold->SetValue( item->m_Bold );
261  m_checkBoxItalic->SetValue( item->m_Italic );
262 
263  switch( item->m_Hjustify )
264  {
265  case GR_TEXT_HJUSTIFY_LEFT: m_choiceHjustify->SetSelection( 0 ); break;
266  case GR_TEXT_HJUSTIFY_CENTER: m_choiceHjustify->SetSelection( 1 ); break;
267  case GR_TEXT_HJUSTIFY_RIGHT: m_choiceHjustify->SetSelection( 2 ); break;
268  }
269 
270  switch( item->m_Vjustify )
271  {
272  case GR_TEXT_VJUSTIFY_TOP: m_choiceVjustify->SetSelection( 0 ); break;
273  case GR_TEXT_VJUSTIFY_CENTER: m_choiceVjustify->SetSelection( 1 ); break;
274  case GR_TEXT_VJUSTIFY_BOTTOM: m_choiceVjustify->SetSelection( 2 ); break;
275  }
276 
277  // Text size
282  }
283 
284  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
285  {
286  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
287 
288  // Rotation (poly and text)
289  msg.Printf( wxT("%.3f"), item->m_Orient );
290  m_textCtrlRotation->SetValue( msg );
291  }
292 
293  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
294  {
295  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
296 
297  // select definition in PPI
298  msg.Printf( wxT("%d"), item->GetPPI() );
299  m_textCtrlBitmapDPI->SetValue( msg );
300  }
301 
302  m_SizerItemProperties->Show( true );
303 
304  m_SizerTextOptions->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
305  m_buttonHelp->Show( aItem->GetType() == DS_DATA_ITEM::DS_TEXT );
306 
308  || aItem->GetType() == DS_DATA_ITEM::DS_RECT );
309 
311 
312  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT
313  || aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
314  {
315  m_staticTextRot->Show( true );
316  m_textCtrlRotation->Show( true );
317  }
318  else
319  {
320  m_staticTextRot->Show( false );
321  m_textCtrlRotation->Show( false );
322  }
323 
326 
329 
330  // Repeat parameters
331  msg.Printf( wxT("%d"), aItem->m_RepeatCount );
332  m_textCtrlRepeatCount->SetValue( msg );
333 
336 
339 
340  // The number of widgets was modified, so recalculate sizers
341  m_swItemProperties->Layout();
342 #ifdef __WXGTK__
343  // This call is mandatory on wxGTK to initialize the right virtual size and therefore
344  // scrollbars, but for some reason, create issues on Windows (incorrect display
345  // until the frame is resized). Joys of multiplatform dev.
346  m_swItemProperties->Fit();
347 #endif
348 
349  // send a size event to be sure scrollbars will be added/removed as needed
350  m_swItemProperties->PostSizeEvent();
351  m_swItemProperties->Refresh();
352 }
353 
354 
355 void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
356 {
358  PL_SELECTION& selection = selTool->GetSelection();
359 
361 
362  DS_DRAW_ITEM_BASE* drawItem = (DS_DRAW_ITEM_BASE*) selection.Front();
363 
364  if( drawItem )
365  {
366  DS_DATA_ITEM* dataItem = drawItem->GetPeer();
367  CopyPrmsFromPanelToItem( dataItem );
368 
369  // Be sure what is displayed is what is set for item
370  // (mainly, texts can be modified if they contain "\n")
371  CopyPrmsFromItemToPanel( dataItem );
372  m_parent->GetCanvas()->GetView()->Update( drawItem );
373  }
374 
376 
377  // Refresh values, exactly as they are converted, to avoid any mistake
379 
380  m_parent->OnModify();
381 
382  // Rebuild the draw list with the new parameters
384  m_parent->GetCanvas()->Refresh();
385 }
386 
387 
388 void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
389 {
391 
393  model.m_DefaultLineWidth = 0.15;
394  model.m_DefaultTextThickness = 0.15;
395 
397 
398  // Rebuild the draw list with the new parameters
400  m_parent->GetCanvas()->Refresh();
401 }
402 
403 
405 {
406  if( aItem == nullptr )
407  return false;
408 
409  wxString msg;
410 
411  // Import common parameters:
412  aItem->m_Info = m_textCtrlComment->GetValue();
413 
414  switch( m_choicePageOpt->GetSelection() )
415  {
416  default:
417  case 0: aItem->SetPage1Option( ALL_PAGES ); break;
418  case 1: aItem->SetPage1Option( FIRST_PAGE_ONLY ); break;
419  case 2: aItem->SetPage1Option( SUBSEQUENT_PAGES ); break;
420  }
421 
422  // Import thickness
425 
426  // Import Start point
429 
430  switch( m_comboBoxCornerPos->GetSelection() )
431  {
432  case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
433  case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
434  case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
435  case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
436  }
437 
438  // Import End point
441 
442  switch( m_comboBoxCornerEnd->GetSelection() )
443  {
444  case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
445  case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
446  case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
447  case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
448  }
449 
450  // Import Repeat prms
451  long itmp;
452  msg = m_textCtrlRepeatCount->GetValue();
453  msg.ToLong( &itmp );
454  aItem->m_RepeatCount = itmp;
455 
460 
461  if( aItem->GetType() == DS_DATA_ITEM::DS_TEXT )
462  {
463  DS_DATA_ITEM_TEXT* item = static_cast<DS_DATA_ITEM_TEXT*>( aItem );
464 
465  item->m_TextBase = m_stcText->GetValue();
466 
467  msg = m_textCtrlTextIncrement->GetValue();
468  msg.ToLong( &itmp );
469  item->m_IncrementLabel = itmp;
470 
471  item->m_Bold = m_checkBoxBold->IsChecked();
472  item->m_Italic = m_checkBoxItalic->IsChecked();
473 
474  switch( m_choiceHjustify->GetSelection() )
475  {
476  case 0: item->m_Hjustify = GR_TEXT_HJUSTIFY_LEFT; break;
477  case 1: item->m_Hjustify = GR_TEXT_HJUSTIFY_CENTER; break;
478  case 2: item->m_Hjustify = GR_TEXT_HJUSTIFY_RIGHT; break;
479  }
480 
481  switch( m_choiceVjustify->GetSelection() )
482  {
483  case 0: item->m_Vjustify = GR_TEXT_VJUSTIFY_TOP; break;
484  case 1: item->m_Vjustify = GR_TEXT_VJUSTIFY_CENTER; break;
485  case 2: item->m_Vjustify = GR_TEXT_VJUSTIFY_BOTTOM; break;
486  }
487 
488  msg = m_textCtrlRotation->GetValue();
490 
491  // Import text size
492  item->m_TextSize.x =
494  item->m_TextSize.y =
496 
497  // Import constraints:
498  item->m_BoundingBoxSize.x =
500  item->m_BoundingBoxSize.y =
502  }
503 
504  if( aItem->GetType() == DS_DATA_ITEM::DS_POLYPOLYGON )
505  {
506  DS_DATA_ITEM_POLYGONS* item = static_cast<DS_DATA_ITEM_POLYGONS*>( aItem );
507 
508  msg = m_textCtrlRotation->GetValue();
510  }
511 
512  if( aItem->GetType() == DS_DATA_ITEM::DS_BITMAP )
513  {
514  DS_DATA_ITEM_BITMAP* item = static_cast<DS_DATA_ITEM_BITMAP*>( aItem );
515  long value;
516 
517  msg = m_textCtrlBitmapDPI->GetValue();
518 
519  if( msg.ToLong( &value ) )
520  item->SetPPI( (int)value );
521  }
522 
523  return true;
524 }
525 
526 
527 void PROPERTIES_FRAME::onScintillaCharAdded( wxStyledTextEvent &aEvent )
528 {
529  wxArrayString autocompleteTokens;
530  int pos = m_stcText->GetCurrentPos();
531  int start = m_stcText->WordStartPosition( pos, true );
532  wxString partial;
533 
534  if( start >= 2
535  && m_stcText->GetCharAt( start-2 ) == '$'
536  && m_stcText->GetCharAt( start-1 ) == '{' )
537  {
538  DS_DRAW_ITEM_LIST::GetTextVars( &autocompleteTokens );
539 
540  partial = m_stcText->GetTextRange( start, pos );
541 
542  for( std::pair<wxString, wxString> entry : m_parent->Prj().GetTextVars() )
543  autocompleteTokens.push_back( entry.first );
544  }
545 
546  m_scintillaTricks->DoAutocomplete( partial, autocompleteTokens );
547  m_stcText->SetFocus();
548 }
549 
550 
551 void PROPERTIES_FRAME::onHelp( wxCommandEvent& aEvent )
552 {
553  // Show the system variables for worksheet text:
554  HTML_MESSAGE_BOX dlg( this, _( "Predefined Keywords" ) );
555  wxString message;
556 
557  message << _( "Texts can include keywords." ) << "<br>";
558  message << _( "Keyword notation is ${keyword}" ) << "<br>";
559  message << _( "Each keyword is replaced by its value" ) << "<br><br>";
560  message << _( "These build-in keywords are always available:" ) << "<br><br>";
561  dlg.AddHTML_Text( message );
562 
563  message = "KICAD_VERSION\n";
564  message << "# " << _( "(sheet number)" ) << "\n";
565  message << "## " << _( "(sheet count)" ) << "\n";
566  message << "COMMENT1 thru COMMENT9\n";
567  message << "COMPANY\n";
568  message << "FILENAME\n";
569  message << "ISSUE_DATE\n";
570  message << "LAYER\n";
571  message << "PAPER " << _( "(paper size)" ) << "\n";
572  message << "REVISION\n";
573  message << "SHEETNAME\n";
574  message << "TITLE\n";
575 
576  dlg.ListSet( message );
577  dlg.ShowModal();
578 }
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, 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
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:141
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:1518
PAGE_OPTION GetPage1Option() const
Definition: ds_data_item.h:133
Class PANEL_PROPERTIES_BASE.