KiCad PCB EDA Suite
PROPERTIES_FRAME Class Reference

Class PROPERTIES_FRAME display properties of the current item. More...

#include <properties_frame.h>

Inheritance diagram for PROPERTIES_FRAME:
PANEL_PROPERTIES_BASE

Public Member Functions

 PROPERTIES_FRAME (PL_EDITOR_FRAME *aParent)
 
 ~PROPERTIES_FRAME ()
 
void OnAcceptPrms (wxCommandEvent &event) override
 
void OnSetDefaultValues (wxCommandEvent &event) override
 
void CopyPrmsFromGeneralToPanel ()
 
bool CopyPrmsFromPanelToGeneral ()
 
void CopyPrmsFromItemToPanel (WORKSHEET_DATAITEM *aItem)
 
bool CopyPrmsFromPanelToItem (WORKSHEET_DATAITEM *aItem)
 
wxSize GetMinSize () const override
 

Protected Attributes

wxNotebook * m_notebook
 
wxScrolledWindow * m_swItemProperties
 
wxStaticText * m_staticTextType
 
wxTextCtrl * m_textCtrlType
 
wxStaticText * m_staticTextPageOpt
 
wxChoice * m_choicePageOpt
 
wxStaticLine * m_staticline5
 
wxBoxSizer * m_SizerTextOptions
 
wxStaticText * m_staticTextText
 
wxTextCtrl * m_textCtrlText
 
wxStaticText * m_staticTextHjust
 
wxChoice * m_choiceHjustify
 
wxCheckBox * m_checkBoxBold
 
wxStaticText * m_staticTextVjust
 
wxChoice * m_choiceVjustify
 
wxCheckBox * m_checkBoxItalic
 
wxStaticText * m_staticTexTsizeX
 
wxTextCtrl * m_textCtrlTextSizeX
 
wxStaticText * m_staticTextTsizeY
 
wxTextCtrl * m_textCtrlTextSizeY
 
wxStaticText * m_staticTextConstraints
 
wxStaticText * m_staticTextConstraintX
 
wxTextCtrl * m_textCtrlConstraintX
 
wxStaticText * m_staticTextConstraintY
 
wxTextCtrl * m_textCtrlConstraintY
 
wxStaticLine * m_staticline6
 
wxButton * m_buttonOK
 
wxStaticLine * m_staticline8
 
wxStaticText * m_staticTextComment
 
wxTextCtrl * m_textCtrlComment
 
wxStaticLine * m_staticline2
 
wxStaticText * m_staticTextPosX
 
wxTextCtrl * m_textCtrlPosX
 
wxStaticText * m_staticTextPosY
 
wxTextCtrl * m_textCtrlPosY
 
wxStaticText * m_staticTextOrgPos
 
wxComboBox * m_comboBoxCornerPos
 
wxBoxSizer * m_SizerEndPosition
 
wxStaticText * m_staticTextEndX
 
wxTextCtrl * m_textCtrlEndX
 
wxStaticText * m_staticTextEndY
 
wxTextCtrl * m_textCtrlEndY
 
wxStaticText * m_staticTextOrgEnd
 
wxComboBox * m_comboBoxCornerEnd
 
wxBoxSizer * m_SizerLineThickness
 
wxStaticText * m_staticTextThickness
 
wxTextCtrl * m_textCtrlThickness
 
wxStaticText * m_staticTextInfoThickness
 
wxBoxSizer * m_SizerRotation
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticTextRot
 
wxTextCtrl * m_textCtrlRotation
 
wxBoxSizer * m_SizerBitmapPPI
 
wxStaticText * m_staticTextBitmapPPI
 
wxTextCtrl * m_textCtrlBitmapPPI
 
wxStaticLine * m_staticline4
 
wxStaticText * m_staticTextRepeatPrms
 
wxStaticText * m_staticTextRepeatCnt
 
wxTextCtrl * m_textCtrlRepeatCount
 
wxBoxSizer * m_SizerTextIncrementLabel
 
wxStaticText * m_staticTextInclabel
 
wxTextCtrl * m_textCtrlTextIncrement
 
wxStaticText * m_staticTextStepX
 
wxTextCtrl * m_textCtrlStepX
 
wxStaticText * m_staticTextStepY
 
wxTextCtrl * m_textCtrlStepY
 
wxScrolledWindow * m_swGeneralOpts
 
wxStaticText * m_staticTextDefVal
 
wxStaticText * m_staticTextDefTsX
 
wxTextCtrl * m_textCtrlDefaultTextSizeX
 
wxStaticText * m_staticTextDefTsY
 
wxTextCtrl * m_textCtrlDefaultTextSizeY
 
wxStaticText * m_staticTextDefLineW
 
wxTextCtrl * m_textCtrlDefaultLineWidth
 
wxStaticText * m_staticText22
 
wxTextCtrl * m_textCtrlDefaultTextThickness
 
wxButton * m_buttonDefault
 
wxStaticLine * m_staticline9
 
wxStaticText * m_staticTextMargins
 
wxStaticText * m_staticTextLeftMargin
 
wxTextCtrl * m_textCtrlLeftMargin
 
wxStaticText * m_staticTextDefRightMargin
 
wxTextCtrl * m_textCtrlRightMargin
 
wxStaticText * m_staticTextTopMargin
 
wxTextCtrl * m_textCtrlTopMargin
 
wxStaticText * m_staticTextBottomMargin
 
wxTextCtrl * m_textCtrlDefaultBottomMargin
 
wxButton * m_buttonGeneralOptsOK
 

Private Attributes

PL_EDITOR_FRAMEm_parent
 

Detailed Description

Class PROPERTIES_FRAME display properties of the current item.

Definition at line 41 of file properties_frame.h.

Constructor & Destructor Documentation

PROPERTIES_FRAME::PROPERTIES_FRAME ( PL_EDITOR_FRAME aParent)

Definition at line 35 of file properties_frame.cpp.

References m_parent.

35  :
36  PANEL_PROPERTIES_BASE( aParent )
37 {
38  m_parent = aParent;
39 }
PANEL_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL)
PL_EDITOR_FRAME * m_parent
PROPERTIES_FRAME::~PROPERTIES_FRAME ( )

Definition at line 42 of file properties_frame.cpp.

43 {
44 }

Member Function Documentation

void PROPERTIES_FRAME::CopyPrmsFromGeneralToPanel ( )

Definition at line 53 of file properties_frame.cpp.

References WORKSHEET_LAYOUT::GetBottomMargin(), WORKSHEET_LAYOUT::GetLeftMargin(), WORKSHEET_LAYOUT::GetRightMargin(), WORKSHEET_LAYOUT::GetTheInstance(), WORKSHEET_LAYOUT::GetTopMargin(), WORKSHEET_DATAITEM::m_DefaultLineWidth, WORKSHEET_DATAITEM::m_DefaultTextSize, WORKSHEET_DATAITEM::m_DefaultTextThickness, PANEL_PROPERTIES_BASE::m_textCtrlDefaultBottomMargin, PANEL_PROPERTIES_BASE::m_textCtrlDefaultLineWidth, PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextSizeX, PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextSizeY, PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextThickness, PANEL_PROPERTIES_BASE::m_textCtrlLeftMargin, PANEL_PROPERTIES_BASE::m_textCtrlRightMargin, and PANEL_PROPERTIES_BASE::m_textCtrlTopMargin.

Referenced by OnAcceptPrms(), PL_EDITOR_FRAME::OnNewPageLayout(), and OnSetDefaultValues().

54 {
55  wxString msg;
56 
57  // Set default parameters
58  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultLineWidth );
59  m_textCtrlDefaultLineWidth->SetValue( msg );
60 
61  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultTextSize.x );
62  m_textCtrlDefaultTextSizeX->SetValue( msg );
63  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultTextSize.y );
64  m_textCtrlDefaultTextSizeY->SetValue( msg );
65 
66  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultTextThickness );
67  m_textCtrlDefaultTextThickness->SetValue( msg );
68 
69  // Set page margins values
71  msg.Printf( wxT("%.3f"), pglayout.GetRightMargin() );
72  m_textCtrlRightMargin->SetValue( msg );
73  msg.Printf( wxT("%.3f"), pglayout.GetBottomMargin() );
74  m_textCtrlDefaultBottomMargin->SetValue( msg );
75 
76  msg.Printf( wxT("%.3f"), pglayout.GetLeftMargin() );
77  m_textCtrlLeftMargin->SetValue( msg );
78  msg.Printf( wxT("%.3f"), pglayout.GetTopMargin() );
79  m_textCtrlTopMargin->SetValue( msg );
80 }
static DSIZE m_DefaultTextSize
wxTextCtrl * m_textCtrlDefaultTextThickness
wxTextCtrl * m_textCtrlDefaultBottomMargin
wxTextCtrl * m_textCtrlDefaultLineWidth
static WORKSHEET_LAYOUT & GetTheInstance()
static function: returns the instance of WORKSHEET_LAYOUT used in the application ...
wxTextCtrl * m_textCtrlDefaultTextSizeY
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
static double m_DefaultTextThickness
static double m_DefaultLineWidth
wxTextCtrl * m_textCtrlDefaultTextSizeX
void PROPERTIES_FRAME::CopyPrmsFromItemToPanel ( WORKSHEET_DATAITEM aItem)

Definition at line 117 of file properties_frame.cpp.

References WORKSHEET_DATAITEM::GetClassName(), WORKSHEET_DATAITEM::GetPage1Option(), WORKSHEET_DATAITEM_BITMAP::GetPPI(), WORKSHEET_DATAITEM::GetType(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, WORKSHEET_DATAITEM_TEXT::IsBold(), WORKSHEET_DATAITEM_TEXT::IsItalic(), LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, WORKSHEET_DATAITEM_TEXT::m_BoundingBoxSize, PANEL_PROPERTIES_BASE::m_checkBoxBold, PANEL_PROPERTIES_BASE::m_checkBoxItalic, PANEL_PROPERTIES_BASE::m_choiceHjustify, PANEL_PROPERTIES_BASE::m_choicePageOpt, PANEL_PROPERTIES_BASE::m_choiceVjustify, PANEL_PROPERTIES_BASE::m_comboBoxCornerEnd, PANEL_PROPERTIES_BASE::m_comboBoxCornerPos, WORKSHEET_DATAITEM::m_End, WORKSHEET_DATAITEM_TEXT::m_FullText, WORKSHEET_DATAITEM_TEXT::m_Hjustify, WORKSHEET_DATAITEM::m_IncrementLabel, WORKSHEET_DATAITEM::m_IncrementVector, WORKSHEET_DATAITEM::m_Info, WORKSHEET_DATAITEM::m_LineWidth, WORKSHEET_DATAITEM_POLYPOLYGON::m_Orient, WORKSHEET_DATAITEM_TEXT::m_Orient, POINT_COORD::m_Pos, WORKSHEET_DATAITEM::m_Pos, WORKSHEET_DATAITEM::m_RepeatCount, PANEL_PROPERTIES_BASE::m_SizerBitmapPPI, PANEL_PROPERTIES_BASE::m_SizerEndPosition, PANEL_PROPERTIES_BASE::m_SizerLineThickness, PANEL_PROPERTIES_BASE::m_SizerRotation, PANEL_PROPERTIES_BASE::m_SizerTextIncrementLabel, PANEL_PROPERTIES_BASE::m_SizerTextOptions, PANEL_PROPERTIES_BASE::m_staticTextInfoThickness, PANEL_PROPERTIES_BASE::m_swItemProperties, WORKSHEET_DATAITEM_TEXT::m_TextBase, PANEL_PROPERTIES_BASE::m_textCtrlBitmapPPI, PANEL_PROPERTIES_BASE::m_textCtrlComment, PANEL_PROPERTIES_BASE::m_textCtrlConstraintX, PANEL_PROPERTIES_BASE::m_textCtrlConstraintY, PANEL_PROPERTIES_BASE::m_textCtrlEndX, PANEL_PROPERTIES_BASE::m_textCtrlEndY, PANEL_PROPERTIES_BASE::m_textCtrlPosX, PANEL_PROPERTIES_BASE::m_textCtrlPosY, PANEL_PROPERTIES_BASE::m_textCtrlRepeatCount, PANEL_PROPERTIES_BASE::m_textCtrlRotation, PANEL_PROPERTIES_BASE::m_textCtrlStepX, PANEL_PROPERTIES_BASE::m_textCtrlStepY, PANEL_PROPERTIES_BASE::m_textCtrlText, PANEL_PROPERTIES_BASE::m_textCtrlTextIncrement, PANEL_PROPERTIES_BASE::m_textCtrlTextSizeX, PANEL_PROPERTIES_BASE::m_textCtrlTextSizeY, PANEL_PROPERTIES_BASE::m_textCtrlThickness, PANEL_PROPERTIES_BASE::m_textCtrlType, WORKSHEET_DATAITEM_TEXT::m_TextSize, WORKSHEET_DATAITEM_TEXT::m_Vjustify, RB_CORNER, WORKSHEET_DATAITEM_TEXT::ReplaceAntiSlashSequence(), RT_CORNER, WORKSHEET_DATAITEM::WS_BITMAP, WORKSHEET_DATAITEM::WS_POLYPOLYGON, WORKSHEET_DATAITEM::WS_RECT, WORKSHEET_DATAITEM::WS_SEGMENT, WORKSHEET_DATAITEM::WS_TEXT, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by OnAcceptPrms(), PL_EDITOR_FRAME::OnLeftClick(), and PL_EDITOR_FRAME::OnTreeSelection().

118 {
119  wxString msg;
120 
121  // Set parameters common to all WORKSHEET_DATAITEM types
122  m_textCtrlType->SetValue( aItem->GetClassName() );
123  m_textCtrlComment->SetValue( aItem->m_Info );
124 
125  switch( aItem->GetPage1Option() )
126  {
127  default:
128  case 0:
129  m_choicePageOpt->SetSelection( 0 );
130  break;
131 
132  case 1:
133  m_choicePageOpt->SetSelection( 1 );
134  break;
135 
136  case -1:
137  m_choicePageOpt->SetSelection( 2 );
138  break;
139  }
140 
141  // Position/ start point
142  msg.Printf( wxT("%.3f"), aItem->m_Pos.m_Pos.x );
143  m_textCtrlPosX->SetValue( msg );
144  msg.Printf( wxT("%.3f"), aItem->m_Pos.m_Pos.y );
145  m_textCtrlPosY->SetValue( msg );
146 
147  switch( aItem->m_Pos.m_Anchor )
148  {
149  case RB_CORNER: // right bottom corner
150  m_comboBoxCornerPos->SetSelection( 2 ); break;
151  case RT_CORNER: // right top corner
152  m_comboBoxCornerPos->SetSelection( 0 ); break;
153  case LB_CORNER: // left bottom corner
154  m_comboBoxCornerPos->SetSelection( 3 ); break;
155  case LT_CORNER: // left top corner
156  m_comboBoxCornerPos->SetSelection( 1 ); break;
157  }
158 
159  // End point
160  msg.Printf( wxT("%.3f"), aItem->m_End.m_Pos.x );
161  m_textCtrlEndX->SetValue( msg );
162  msg.Printf( wxT("%.3f"), aItem->m_End.m_Pos.y );
163  m_textCtrlEndY->SetValue( msg );
164 
165  switch( aItem->m_End.m_Anchor )
166  {
167  case RB_CORNER: // right bottom corner
168  m_comboBoxCornerEnd->SetSelection( 2 ); break;
169  case RT_CORNER: // right top corner
170  m_comboBoxCornerEnd->SetSelection( 0 ); break;
171  case LB_CORNER: // left bottom corner
172  m_comboBoxCornerEnd->SetSelection( 3 ); break;
173  case LT_CORNER: // left top corner
174  m_comboBoxCornerEnd->SetSelection( 1 ); break;
175  }
176 
177  msg.Printf( wxT("%.3f"), aItem->m_LineWidth );
178  m_textCtrlThickness->SetValue( msg );
179 
180  // Now, set prms more specific to WORKSHEET_DATAITEM types
181  // For a given type, disable widgets which are not relevant,
182  // and be sure widgets which are relevant are enabled
183  if( aItem->GetType() == WORKSHEET_DATAITEM::WS_TEXT )
184  {
185  m_SizerTextOptions->Show(true);
186  m_SizerTextIncrementLabel->Show( true );
187 
189  item->m_FullText = item->m_TextBase;
190  // Replace our '\' 'n' sequence by the EOL char
191  item->ReplaceAntiSlashSequence();
192  m_textCtrlText->SetValue( item->m_FullText );
193 
194  msg.Printf( wxT("%d"), item->m_IncrementLabel );
195  m_textCtrlTextIncrement->SetValue( msg );
196 
197  // Rotation (poly and text)
198  msg.Printf( wxT("%.3f"), item->m_Orient );
199  m_textCtrlRotation->SetValue( msg );
200 
201  // Constraints:
202  msg.Printf( wxT("%.3f"), item->m_BoundingBoxSize.x );
203  m_textCtrlConstraintX->SetValue( msg );
204  msg.Printf( wxT("%.3f"), item->m_BoundingBoxSize.y );
205  m_textCtrlConstraintY->SetValue( msg );
206 
207  // Font Options
208  m_checkBoxBold->SetValue( item->IsBold() );
209  m_checkBoxItalic->SetValue( item->IsItalic() );
210  switch( item->m_Hjustify )
211  {
212  case GR_TEXT_HJUSTIFY_LEFT: m_choiceHjustify->SetSelection( 0 ); break;
213  case GR_TEXT_HJUSTIFY_CENTER: m_choiceHjustify->SetSelection( 1 ); break;
214  case GR_TEXT_HJUSTIFY_RIGHT: m_choiceHjustify->SetSelection( 2 ); break;
215  }
216  switch( item->m_Vjustify )
217  {
218  case GR_TEXT_VJUSTIFY_TOP: m_choiceVjustify->SetSelection( 0 ); break;
219  case GR_TEXT_VJUSTIFY_CENTER: m_choiceVjustify->SetSelection( 1 ); break;
220  case GR_TEXT_VJUSTIFY_BOTTOM: m_choiceVjustify->SetSelection( 2 ); break;
221  }
222 
223  // Text size
224  msg.Printf( wxT("%.3f"), item->m_TextSize.x );
225  m_textCtrlTextSizeX->SetValue( msg );
226  msg.Printf( wxT("%.3f"), item->m_TextSize.y );
227  m_textCtrlTextSizeY->SetValue( msg );
228  }
229  else
230  {
231  m_SizerTextOptions->Show(false);
232  m_SizerTextIncrementLabel->Show(false);
233  }
234 
236  {
238  // Rotation (poly and text)
239  msg.Printf( wxT("%.3f"), item->m_Orient );
240  m_textCtrlRotation->SetValue( msg );
241  }
242 
243  if( aItem->GetType() == WORKSHEET_DATAITEM::WS_BITMAP )
244  {
246  // select definition in PPI
247  msg.Printf( wxT("%d"), item->GetPPI() );
248  m_textCtrlBitmapPPI->SetValue( msg );
249  }
250 
251  switch( aItem->GetType() )
252  {
255  m_SizerBitmapPPI->Show( false );
256  m_SizerLineThickness->Show( true );
257  m_staticTextInfoThickness->Show( true );
258  m_SizerRotation->Show( false );
259  m_SizerEndPosition->Show(true);
260  break;
261 
263  m_SizerBitmapPPI->Show( false );
264  m_SizerLineThickness->Show( true );
265  m_staticTextInfoThickness->Show( true );
266  m_SizerRotation->Show( true );
267  m_SizerEndPosition->Show(false);
268  break;
269 
271  m_SizerBitmapPPI->Show( false );
272  m_SizerLineThickness->Show( true );
273  m_staticTextInfoThickness->Show( false ); // No defaut value for thickness
274  m_SizerRotation->Show( true );
275  m_SizerEndPosition->Show(false);
276  break;
277 
279  m_SizerBitmapPPI->Show( true );
280  m_SizerLineThickness->Show( false );
281  m_SizerRotation->Show( false );
282  m_SizerEndPosition->Show(false);
283  break;
284  }
285 
286  // Repeat parameters
287  msg.Printf( wxT("%d"), aItem->m_RepeatCount );
288  m_textCtrlRepeatCount->SetValue( msg );
289  msg.Printf( wxT("%.3f"), aItem->m_IncrementVector.x );
290  m_textCtrlStepX->SetValue( msg );
291  msg.Printf( wxT("%.3f"), aItem->m_IncrementVector.y );
292  m_textCtrlStepY->SetValue( msg );
293 
294  // The number of widgets was modified
295  m_swItemProperties->Layout();
296  m_swItemProperties->Refresh();
297 }
EDA_TEXT_HJUSTIFY_T m_Hjustify
wxScrolledWindow * m_swItemProperties
EDA_TEXT_VJUSTIFY_T m_Vjustify
wxStaticText * m_staticTextInfoThickness
wxBoxSizer * m_SizerTextIncrementLabel
WS_ItemType GetType() const
bool ReplaceAntiSlashSequence()
Replace the &#39;\&#39;&#39;n&#39; sequence by EOL and the sequence &#39;\&#39;&#39;\&#39; by only one &#39;\&#39; inside m_FullText...
const wxString GetClassName() const
bool PROPERTIES_FRAME::CopyPrmsFromPanelToGeneral ( )

Definition at line 83 of file properties_frame.cpp.

References DoubleValueFromString(), WORKSHEET_LAYOUT::GetTheInstance(), WORKSHEET_DATAITEM::m_DefaultLineWidth, WORKSHEET_DATAITEM::m_DefaultTextSize, WORKSHEET_DATAITEM::m_DefaultTextThickness, PANEL_PROPERTIES_BASE::m_textCtrlDefaultBottomMargin, PANEL_PROPERTIES_BASE::m_textCtrlDefaultLineWidth, PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextSizeX, PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextSizeY, PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextThickness, PANEL_PROPERTIES_BASE::m_textCtrlLeftMargin, PANEL_PROPERTIES_BASE::m_textCtrlRightMargin, PANEL_PROPERTIES_BASE::m_textCtrlTopMargin, WORKSHEET_LAYOUT::SetBottomMargin(), WORKSHEET_LAYOUT::SetLeftMargin(), WORKSHEET_LAYOUT::SetRightMargin(), WORKSHEET_LAYOUT::SetTopMargin(), UNSCALED_UNITS, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by OnAcceptPrms().

84 {
85  wxString msg;
86 
87  // Import default parameters from widgets
88  msg = m_textCtrlDefaultLineWidth->GetValue();
90 
91  msg = m_textCtrlDefaultTextSizeX->GetValue();
93  msg = m_textCtrlDefaultTextSizeY->GetValue();
95 
96  msg = m_textCtrlDefaultTextThickness->GetValue();
98 
99  // Get page margins values
101 
102  msg = m_textCtrlRightMargin->GetValue();
104  msg = m_textCtrlDefaultBottomMargin->GetValue();
106 
107  // cordinates of the left top corner are the left and top margins
108  msg = m_textCtrlLeftMargin->GetValue();
110  msg = m_textCtrlTopMargin->GetValue();
112 
113  return true;
114 }
static DSIZE m_DefaultTextSize
wxTextCtrl * m_textCtrlDefaultTextThickness
wxTextCtrl * m_textCtrlDefaultBottomMargin
wxTextCtrl * m_textCtrlDefaultLineWidth
void SetLeftMargin(double aMargin)
void SetTopMargin(double aMargin)
static WORKSHEET_LAYOUT & GetTheInstance()
static function: returns the instance of WORKSHEET_LAYOUT used in the application ...
wxTextCtrl * m_textCtrlDefaultTextSizeY
void SetBottomMargin(double aMargin)
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
static double m_DefaultTextThickness
static double m_DefaultLineWidth
double DoubleValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:303
wxTextCtrl * m_textCtrlDefaultTextSizeX
void SetRightMargin(double aMargin)
bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem ( WORKSHEET_DATAITEM aItem)

Definition at line 336 of file properties_frame.cpp.

References DoubleValueFromString(), WORKSHEET_DATAITEM::GetType(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, WORKSHEET_DATAITEM_TEXT::m_BoundingBoxSize, PANEL_PROPERTIES_BASE::m_checkBoxBold, PANEL_PROPERTIES_BASE::m_checkBoxItalic, PANEL_PROPERTIES_BASE::m_choiceHjustify, PANEL_PROPERTIES_BASE::m_choicePageOpt, PANEL_PROPERTIES_BASE::m_choiceVjustify, PANEL_PROPERTIES_BASE::m_comboBoxCornerEnd, PANEL_PROPERTIES_BASE::m_comboBoxCornerPos, WORKSHEET_DATAITEM::m_End, WORKSHEET_DATAITEM_TEXT::m_Hjustify, WORKSHEET_DATAITEM::m_IncrementLabel, WORKSHEET_DATAITEM::m_IncrementVector, WORKSHEET_DATAITEM::m_Info, WORKSHEET_DATAITEM::m_LineWidth, WORKSHEET_DATAITEM_POLYPOLYGON::m_Orient, WORKSHEET_DATAITEM_TEXT::m_Orient, POINT_COORD::m_Pos, WORKSHEET_DATAITEM::m_Pos, WORKSHEET_DATAITEM::m_RepeatCount, WORKSHEET_DATAITEM_TEXT::m_TextBase, PANEL_PROPERTIES_BASE::m_textCtrlBitmapPPI, PANEL_PROPERTIES_BASE::m_textCtrlComment, PANEL_PROPERTIES_BASE::m_textCtrlConstraintX, PANEL_PROPERTIES_BASE::m_textCtrlConstraintY, PANEL_PROPERTIES_BASE::m_textCtrlEndX, PANEL_PROPERTIES_BASE::m_textCtrlEndY, PANEL_PROPERTIES_BASE::m_textCtrlPosX, PANEL_PROPERTIES_BASE::m_textCtrlPosY, PANEL_PROPERTIES_BASE::m_textCtrlRepeatCount, PANEL_PROPERTIES_BASE::m_textCtrlRotation, PANEL_PROPERTIES_BASE::m_textCtrlStepX, PANEL_PROPERTIES_BASE::m_textCtrlStepY, PANEL_PROPERTIES_BASE::m_textCtrlText, PANEL_PROPERTIES_BASE::m_textCtrlTextIncrement, PANEL_PROPERTIES_BASE::m_textCtrlTextSizeX, PANEL_PROPERTIES_BASE::m_textCtrlTextSizeY, PANEL_PROPERTIES_BASE::m_textCtrlThickness, WORKSHEET_DATAITEM_TEXT::m_TextSize, WORKSHEET_DATAITEM_TEXT::m_Vjustify, RB_CORNER, RT_CORNER, WORKSHEET_DATAITEM_TEXT::SetBold(), WORKSHEET_DATAITEM_TEXT::SetItalic(), WORKSHEET_DATAITEM::SetPage1Option(), WORKSHEET_DATAITEM_BITMAP::SetPPI(), UNSCALED_UNITS, WORKSHEET_DATAITEM::WS_BITMAP, WORKSHEET_DATAITEM::WS_POLYPOLYGON, WORKSHEET_DATAITEM::WS_TEXT, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by OnAcceptPrms().

337 {
338  if( aItem == NULL )
339  return false;
340 
341  wxString msg;
342 
343  // Import common parameters:
344  aItem->m_Info = m_textCtrlComment->GetValue();
345 
346  switch( m_choicePageOpt->GetSelection() )
347  {
348  default:
349  case 0:
350  aItem->SetPage1Option( 0 );
351  break;
352 
353  case 1:
354  aItem->SetPage1Option( 1 );
355  break;
356 
357  case 2:
358  aItem->SetPage1Option( -1 );
359  break;
360  }
361 
362  // Import thickness
363  msg = m_textCtrlThickness->GetValue();
365 
366  // Import Start point
367  msg = m_textCtrlPosX->GetValue();
369 
370  msg = m_textCtrlPosY->GetValue();
372 
373  switch( m_comboBoxCornerPos->GetSelection() )
374  {
375  case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
376  case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
377  case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
378  case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
379  }
380 
381  // Import End point
382  msg = m_textCtrlEndX->GetValue();
384 
385  msg = m_textCtrlEndY->GetValue();
387 
388  switch( m_comboBoxCornerEnd->GetSelection() )
389  {
390  case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
391  case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
392  case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
393  case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
394  }
395 
396  // Import Repeat prms
397  long itmp;
398  msg = m_textCtrlRepeatCount->GetValue();
399  msg.ToLong( &itmp );
400  aItem->m_RepeatCount = itmp;
401 
402  msg = m_textCtrlStepX->GetValue();
404 
405  msg = m_textCtrlStepY->GetValue();
407 
408  if( aItem->GetType() == WORKSHEET_DATAITEM::WS_TEXT )
409  {
411 
412  item->m_TextBase = m_textCtrlText->GetValue();
413 
414  msg = m_textCtrlTextIncrement->GetValue();
415  msg.ToLong( &itmp );
416  item->m_IncrementLabel = itmp;
417 
418  item->SetBold( m_checkBoxBold->IsChecked() );
419  item->SetItalic( m_checkBoxItalic->IsChecked() );
420 
421  switch( m_choiceHjustify->GetSelection() )
422  {
423  case 0: item->m_Hjustify = GR_TEXT_HJUSTIFY_LEFT; break;
424  case 1: item->m_Hjustify = GR_TEXT_HJUSTIFY_CENTER; break;
425  case 2: item->m_Hjustify = GR_TEXT_HJUSTIFY_RIGHT; break;
426  }
427  switch( m_choiceVjustify->GetSelection() )
428  {
429  case 0: item->m_Vjustify = GR_TEXT_VJUSTIFY_TOP; break;
430  case 1: item->m_Vjustify = GR_TEXT_VJUSTIFY_CENTER; break;
431  case 2: item->m_Vjustify = GR_TEXT_VJUSTIFY_BOTTOM; break;
432  }
433 
434  msg = m_textCtrlRotation->GetValue();
436 
437  // Import text size
438  msg = m_textCtrlTextSizeX->GetValue();
440 
441  msg = m_textCtrlTextSizeY->GetValue();
443 
444  // Import constraints:
445  msg = m_textCtrlConstraintX->GetValue();
447 
448  msg = m_textCtrlConstraintY->GetValue();
450  }
451 
453  {
455 
456  msg = m_textCtrlRotation->GetValue();
458  }
459 
460  if( aItem->GetType() == WORKSHEET_DATAITEM::WS_BITMAP )
461  {
463  // Set definition in PPI
464  long value;
465  msg = m_textCtrlBitmapPPI->GetValue();
466  if( msg.ToLong( &value ) )
467  item->SetPPI( (int)value );
468  }
469 
470  return true;
471 }
EDA_TEXT_HJUSTIFY_T m_Hjustify
EDA_TEXT_VJUSTIFY_T m_Vjustify
void SetItalic(bool aState)
Function SetItalic Toggles on/off the italic option flag.
void SetPPI(int aBitmapPPI)
adjust the PPI of the bitmap
WS_ItemType GetType() const
void SetBold(bool aState)
Function SetBold Toggles on/off the bold option flag.
void SetPage1Option(int aChoice)
Set the option for page 1.
double DoubleValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:303
wxSize PROPERTIES_FRAME::GetMinSize ( ) const
override

Definition at line 46 of file properties_frame.cpp.

Referenced by PL_EDITOR_FRAME::PL_EDITOR_FRAME().

47 {
48  return wxSize( 150, -1 );
49 }
void PROPERTIES_FRAME::OnAcceptPrms ( wxCommandEvent &  event)
overridevirtual

Reimplemented from PANEL_PROPERTIES_BASE.

Definition at line 300 of file properties_frame.cpp.

References CopyPrmsFromGeneralToPanel(), CopyPrmsFromItemToPanel(), CopyPrmsFromPanelToGeneral(), CopyPrmsFromPanelToItem(), EDA_DRAW_FRAME::GetCanvas(), PL_EDITOR_FRAME::GetSelectedItem(), m_parent, PL_EDITOR_FRAME::OnModify(), EDA_DRAW_PANEL::Refresh(), and PL_EDITOR_FRAME::SaveCopyInUndoList().

301 {
303 
305  if( item )
306  {
307  CopyPrmsFromPanelToItem( item );
308  // Be sure what is displayed is what is set for item
309  // (mainly, texts can be modified if they contain "\n")
310  CopyPrmsFromItemToPanel( item );
311  }
312 
314 
315  // Refresh values, exactly as they are converted, to avoid any mistake
317 
318  m_parent->OnModify();
319  m_parent->GetCanvas()->Refresh();
320 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:338
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:351
void CopyPrmsFromItemToPanel(WORKSHEET_DATAITEM *aItem)
void OnModify()
Must be called after a change in order to set the "modify" flag of the current screen.
bool CopyPrmsFromPanelToItem(WORKSHEET_DATAITEM *aItem)
bool CopyPrmsFromPanelToGeneral()
WORKSHEET_DATAITEM * GetSelectedItem()
Function GetSelectedItem.
PL_EDITOR_FRAME * m_parent
void SaveCopyInUndoList()
Save a copy of the description (in a S expr string) for Undo/redo commands.
void CopyPrmsFromGeneralToPanel()
void PROPERTIES_FRAME::OnSetDefaultValues ( wxCommandEvent &  event)
overridevirtual

Reimplemented from PANEL_PROPERTIES_BASE.

Definition at line 322 of file properties_frame.cpp.

References CopyPrmsFromGeneralToPanel(), EDA_DRAW_FRAME::GetCanvas(), WORKSHEET_DATAITEM::m_DefaultLineWidth, WORKSHEET_DATAITEM::m_DefaultTextSize, WORKSHEET_DATAITEM::m_DefaultTextThickness, m_parent, EDA_DRAW_PANEL::Refresh(), and TB_DEFAULT_TEXTSIZE.

323 {
326  // default thickness in mm
329 
331  m_parent->GetCanvas()->Refresh();
332 }
static DSIZE m_DefaultTextSize
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:338
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:351
DPOINT DSIZE
Definition: vector2d.h:595
#define TB_DEFAULT_TEXTSIZE
static double m_DefaultTextThickness
static double m_DefaultLineWidth
PL_EDITOR_FRAME * m_parent
void CopyPrmsFromGeneralToPanel()

Member Data Documentation

wxButton* PANEL_PROPERTIES_BASE::m_buttonDefault
protectedinherited
wxButton* PANEL_PROPERTIES_BASE::m_buttonGeneralOptsOK
protectedinherited
wxButton* PANEL_PROPERTIES_BASE::m_buttonOK
protectedinherited
wxCheckBox* PANEL_PROPERTIES_BASE::m_checkBoxBold
protectedinherited
wxCheckBox* PANEL_PROPERTIES_BASE::m_checkBoxItalic
protectedinherited
wxChoice* PANEL_PROPERTIES_BASE::m_choiceHjustify
protectedinherited
wxChoice* PANEL_PROPERTIES_BASE::m_choicePageOpt
protectedinherited
wxChoice* PANEL_PROPERTIES_BASE::m_choiceVjustify
protectedinherited
wxComboBox* PANEL_PROPERTIES_BASE::m_comboBoxCornerEnd
protectedinherited
wxComboBox* PANEL_PROPERTIES_BASE::m_comboBoxCornerPos
protectedinherited
wxNotebook* PANEL_PROPERTIES_BASE::m_notebook
protectedinherited
PL_EDITOR_FRAME* PROPERTIES_FRAME::m_parent
private

Definition at line 43 of file properties_frame.h.

Referenced by OnAcceptPrms(), OnSetDefaultValues(), and PROPERTIES_FRAME().

wxBoxSizer* PANEL_PROPERTIES_BASE::m_SizerBitmapPPI
protectedinherited
wxBoxSizer* PANEL_PROPERTIES_BASE::m_SizerEndPosition
protectedinherited
wxBoxSizer* PANEL_PROPERTIES_BASE::m_SizerLineThickness
protectedinherited
wxBoxSizer* PANEL_PROPERTIES_BASE::m_SizerRotation
protectedinherited
wxBoxSizer* PANEL_PROPERTIES_BASE::m_SizerTextIncrementLabel
protectedinherited
wxBoxSizer* PANEL_PROPERTIES_BASE::m_SizerTextOptions
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline1
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline2
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline4
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline5
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline6
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline8
protectedinherited
wxStaticLine* PANEL_PROPERTIES_BASE::m_staticline9
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticText22
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextBitmapPPI
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextBottomMargin
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextComment
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextConstraints
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextConstraintX
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextConstraintY
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextDefLineW
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextDefRightMargin
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextDefTsX
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextDefTsY
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextDefVal
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextEndX
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextEndY
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextHjust
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextInclabel
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextInfoThickness
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextLeftMargin
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextMargins
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextOrgEnd
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextOrgPos
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextPageOpt
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextPosX
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextPosY
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextRepeatCnt
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextRepeatPrms
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextRot
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTexTsizeX
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextStepX
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextStepY
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextText
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextThickness
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextTopMargin
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextTsizeY
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextType
protectedinherited
wxStaticText* PANEL_PROPERTIES_BASE::m_staticTextVjust
protectedinherited
wxScrolledWindow* PANEL_PROPERTIES_BASE::m_swGeneralOpts
protectedinherited
wxScrolledWindow* PANEL_PROPERTIES_BASE::m_swItemProperties
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlBitmapPPI
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlComment
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlConstraintX
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlConstraintY
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlDefaultBottomMargin
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlDefaultLineWidth
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextSizeX
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextSizeY
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlDefaultTextThickness
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlEndX
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlEndY
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlLeftMargin
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlPosX
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlPosY
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlRepeatCount
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlRightMargin
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlRotation
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlStepX
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlStepY
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlText
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlTextIncrement
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlTextSizeX
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlTextSizeY
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlThickness
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlTopMargin
protectedinherited
wxTextCtrl* PANEL_PROPERTIES_BASE::m_textCtrlType
protectedinherited

The documentation for this class was generated from the following files: