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 42 of file properties_frame.h.

Constructor & Destructor Documentation

PROPERTIES_FRAME::PROPERTIES_FRAME ( PL_EDITOR_FRAME aParent)

Definition at line 36 of file properties_frame.cpp.

References m_parent.

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

Definition at line 43 of file properties_frame.cpp.

44 {
45 }

Member Function Documentation

void PROPERTIES_FRAME::CopyPrmsFromGeneralToPanel ( )

Definition at line 54 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().

55 {
56  wxString msg;
57 
58  // Set default parameters
59  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultLineWidth );
60  m_textCtrlDefaultLineWidth->SetValue( msg );
61 
62  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultTextSize.x );
63  m_textCtrlDefaultTextSizeX->SetValue( msg );
64  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultTextSize.y );
65  m_textCtrlDefaultTextSizeY->SetValue( msg );
66 
67  msg.Printf( wxT("%.3f"), WORKSHEET_DATAITEM::m_DefaultTextThickness );
68  m_textCtrlDefaultTextThickness->SetValue( msg );
69 
70  // Set page margins values
72  msg.Printf( wxT("%.3f"), pglayout.GetRightMargin() );
73  m_textCtrlRightMargin->SetValue( msg );
74  msg.Printf( wxT("%.3f"), pglayout.GetBottomMargin() );
75  m_textCtrlDefaultBottomMargin->SetValue( msg );
76 
77  msg.Printf( wxT("%.3f"), pglayout.GetLeftMargin() );
78  m_textCtrlLeftMargin->SetValue( msg );
79  msg.Printf( wxT("%.3f"), pglayout.GetTopMargin() );
80  m_textCtrlTopMargin->SetValue( msg );
81 }
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
wxTextCtrl * m_textCtrlDefaultTextSizeX
void PROPERTIES_FRAME::CopyPrmsFromItemToPanel ( WORKSHEET_DATAITEM aItem)

Definition at line 118 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().

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

Definition at line 84 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().

85 {
86  wxString msg;
87 
88  // Import default parameters from widgets
89  msg = m_textCtrlDefaultLineWidth->GetValue();
91 
92  msg = m_textCtrlDefaultTextSizeX->GetValue();
94  msg = m_textCtrlDefaultTextSizeY->GetValue();
96 
97  msg = m_textCtrlDefaultTextThickness->GetValue();
99 
100  // Get page margins values
102 
103  msg = m_textCtrlRightMargin->GetValue();
105  msg = m_textCtrlDefaultBottomMargin->GetValue();
107 
108  // cordinates of the left top corner are the left and top margins
109  msg = m_textCtrlLeftMargin->GetValue();
111  msg = m_textCtrlTopMargin->GetValue();
113 
114  return true;
115 }
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
double DoubleValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:302
wxTextCtrl * m_textCtrlDefaultTextSizeX
void SetRightMargin(double aMargin)
bool PROPERTIES_FRAME::CopyPrmsFromPanelToItem ( WORKSHEET_DATAITEM aItem)

Definition at line 337 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().

338 {
339  if( aItem == NULL )
340  return false;
341 
342  wxString msg;
343 
344  // Import common parameters:
345  aItem->m_Info = m_textCtrlComment->GetValue();
346 
347  switch( m_choicePageOpt->GetSelection() )
348  {
349  default:
350  case 0:
351  aItem->SetPage1Option( 0 );
352  break;
353 
354  case 1:
355  aItem->SetPage1Option( 1 );
356  break;
357 
358  case 2:
359  aItem->SetPage1Option( -1 );
360  break;
361  }
362 
363  // Import thickness
364  msg = m_textCtrlThickness->GetValue();
366 
367  // Import Start point
368  msg = m_textCtrlPosX->GetValue();
370 
371  msg = m_textCtrlPosY->GetValue();
373 
374  switch( m_comboBoxCornerPos->GetSelection() )
375  {
376  case 2: aItem->m_Pos.m_Anchor = RB_CORNER; break;
377  case 0: aItem->m_Pos.m_Anchor = RT_CORNER; break;
378  case 3: aItem->m_Pos.m_Anchor = LB_CORNER; break;
379  case 1: aItem->m_Pos.m_Anchor = LT_CORNER; break;
380  }
381 
382  // Import End point
383  msg = m_textCtrlEndX->GetValue();
385 
386  msg = m_textCtrlEndY->GetValue();
388 
389  switch( m_comboBoxCornerEnd->GetSelection() )
390  {
391  case 2: aItem->m_End.m_Anchor = RB_CORNER; break;
392  case 0: aItem->m_End.m_Anchor = RT_CORNER; break;
393  case 3: aItem->m_End.m_Anchor = LB_CORNER; break;
394  case 1: aItem->m_End.m_Anchor = LT_CORNER; break;
395  }
396 
397  // Import Repeat prms
398  long itmp;
399  msg = m_textCtrlRepeatCount->GetValue();
400  msg.ToLong( &itmp );
401  aItem->m_RepeatCount = itmp;
402 
403  msg = m_textCtrlStepX->GetValue();
405 
406  msg = m_textCtrlStepY->GetValue();
408 
409  if( aItem->GetType() == WORKSHEET_DATAITEM::WS_TEXT )
410  {
412 
413  item->m_TextBase = m_textCtrlText->GetValue();
414 
415  msg = m_textCtrlTextIncrement->GetValue();
416  msg.ToLong( &itmp );
417  item->m_IncrementLabel = itmp;
418 
419  item->SetBold( m_checkBoxBold->IsChecked() );
420  item->SetItalic( m_checkBoxItalic->IsChecked() );
421 
422  switch( m_choiceHjustify->GetSelection() )
423  {
424  case 0: item->m_Hjustify = GR_TEXT_HJUSTIFY_LEFT; break;
425  case 1: item->m_Hjustify = GR_TEXT_HJUSTIFY_CENTER; break;
426  case 2: item->m_Hjustify = GR_TEXT_HJUSTIFY_RIGHT; break;
427  }
428  switch( m_choiceVjustify->GetSelection() )
429  {
430  case 0: item->m_Vjustify = GR_TEXT_VJUSTIFY_TOP; break;
431  case 1: item->m_Vjustify = GR_TEXT_VJUSTIFY_CENTER; break;
432  case 2: item->m_Vjustify = GR_TEXT_VJUSTIFY_BOTTOM; break;
433  }
434 
435  msg = m_textCtrlRotation->GetValue();
437 
438  // Import text size
439  msg = m_textCtrlTextSizeX->GetValue();
441 
442  msg = m_textCtrlTextSizeY->GetValue();
444 
445  // Import constraints:
446  msg = m_textCtrlConstraintX->GetValue();
448 
449  msg = m_textCtrlConstraintY->GetValue();
451  }
452 
454  {
456 
457  msg = m_textCtrlRotation->GetValue();
459  }
460 
461  if( aItem->GetType() == WORKSHEET_DATAITEM::WS_BITMAP )
462  {
464  // Set definition in PPI
465  long value;
466  msg = m_textCtrlBitmapPPI->GetValue();
467  if( msg.ToLong( &value ) )
468  item->SetPPI( (int)value );
469  }
470 
471  return true;
472 }
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:302
wxSize PROPERTIES_FRAME::GetMinSize ( ) const
override

Definition at line 47 of file properties_frame.cpp.

Referenced by PL_EDITOR_FRAME::PL_EDITOR_FRAME().

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

Reimplemented from PANEL_PROPERTIES_BASE.

Definition at line 301 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().

302 {
304 
306  if( item )
307  {
308  CopyPrmsFromPanelToItem( item );
309  // Be sure what is displayed is what is set for item
310  // (mainly, texts can be modified if they contain "\n")
311  CopyPrmsFromItemToPanel( item );
312  }
313 
315 
316  // Refresh values, exactly as they are converted, to avoid any mistake
318 
319  m_parent->OnModify();
320  m_parent->GetCanvas()->Refresh();
321 }
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:325
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:331
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 323 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.

324 {
327  // default thickness in mm
330 
332  m_parent->GetCanvas()->Refresh();
333 }
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:325
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:331
DPOINT DSIZE
Definition: vector2d.h:595
#define TB_DEFAULT_TEXTSIZE
static double m_DefaultTextThickness
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 44 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: