KiCad PCB EDA Suite
PANEL_SETUP_FORMATTING Class Reference

#include <panel_setup_formatting.h>

Inheritance diagram for PANEL_SETUP_FORMATTING:
PANEL_SETUP_FORMATTING_BASE

Public Member Functions

 PANEL_SETUP_FORMATTING (wxWindow *aWindow, SCH_EDIT_FRAME *aFrame)
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void ImportSettingsFrom (SCHEMATIC_SETTINGS &aSettings)
 

Protected Attributes

wxStaticText * m_staticText26
 
wxChoice * m_choiceSeparatorRefId
 
wxStaticText * m_textSizeLabel
 
wxTextCtrl * m_textSizeCtrl
 
wxStaticText * m_textSizeUnits
 
wxStaticText * m_textOffsetRatioLabel
 
wxTextCtrl * m_textOffsetRatioCtrl
 
wxStaticText * m_offsetRatioUnits
 
wxStaticText * m_lineWidthLabel
 
wxTextCtrl * m_lineWidthCtrl
 
wxStaticText * m_lineWidthUnits
 
wxStaticText * m_pinSymbolSizeLabel
 
wxTextCtrl * m_pinSymbolSizeCtrl
 
wxStaticText * m_pinSymbolSizeUnits
 
wxStaticText * m_busWidthLabel
 
wxTextCtrl * m_busWidthCtrl
 
wxStaticText * m_busWidthUnits
 
wxStaticText * m_wireWidthLabel
 
wxTextCtrl * m_wireWidthCtrl
 
wxStaticText * m_wireWidthUnits
 
wxStaticText * m_jctSizeLabel
 
wxTextCtrl * m_jctSizeCtrl
 
wxStaticText * m_jctSizeUnits
 

Private Attributes

SCH_EDIT_FRAMEm_frame
 
UNIT_BINDER m_textSize
 
UNIT_BINDER m_lineWidth
 
UNIT_BINDER m_busWidth
 
UNIT_BINDER m_wireWidth
 
UNIT_BINDER m_pinSymbolSize
 
UNIT_BINDER m_junctionSize
 

Detailed Description

Definition at line 31 of file panel_setup_formatting.h.

Constructor & Destructor Documentation

◆ PANEL_SETUP_FORMATTING()

PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING ( wxWindow *  aWindow,
SCH_EDIT_FRAME aFrame 
)

Definition at line 35 of file panel_setup_formatting.cpp.

35  :
36  PANEL_SETUP_FORMATTING_BASE( aWindow ),
37  m_frame( aFrame ),
44 {
45 }
PANEL_SETUP_FORMATTING_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

Member Function Documentation

◆ ImportSettingsFrom()

void PANEL_SETUP_FORMATTING::ImportSettingsFrom ( SCHEMATIC_SETTINGS aSettings)

Definition at line 141 of file panel_setup_formatting.cpp.

142 {
149 
150  wxString offsetRatio = wxString::Format( "%f", aSettings.m_TextOffsetRatio * 100.0 );
151  m_textOffsetRatioCtrl->SetValue( offsetRatio );
152 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...

References Format(), m_busWidth, SCHEMATIC_SETTINGS::m_DefaultBusThickness, SCHEMATIC_SETTINGS::m_DefaultLineWidth, SCHEMATIC_SETTINGS::m_DefaultTextSize, SCHEMATIC_SETTINGS::m_DefaultWireThickness, m_junctionSize, SCHEMATIC_SETTINGS::m_JunctionSize, m_lineWidth, m_pinSymbolSize, SCHEMATIC_SETTINGS::m_PinSymbolSize, SCHEMATIC_SETTINGS::m_TextOffsetRatio, PANEL_SETUP_FORMATTING_BASE::m_textOffsetRatioCtrl, m_textSize, m_wireWidth, and UNIT_BINDER::SetValue().

Referenced by DIALOG_SCHEMATIC_SETUP::OnAuxiliaryAction().

◆ TransferDataFromWindow()

bool PANEL_SETUP_FORMATTING::TransferDataFromWindow ( )
override

Definition at line 87 of file panel_setup_formatting.cpp.

88 {
90 
91  // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
92  int firstRefId, refSeparator;
93 
94  switch( m_choiceSeparatorRefId->GetSelection() )
95  {
96  default:
97  case 0: firstRefId = 'A'; refSeparator = 0; break;
98  case 1: firstRefId = 'A'; refSeparator = '.'; break;
99  case 2: firstRefId = 'A'; refSeparator = '-'; break;
100  case 3: firstRefId = 'A'; refSeparator = '_'; break;
101  case 4: firstRefId = '1'; refSeparator = '.'; break;
102  case 5: firstRefId = '1'; refSeparator = '-'; break;
103  case 6: firstRefId = '1'; refSeparator = '_'; break;
104  }
105 
106  if( refSeparator != LIB_PART::GetSubpartIdSeparator() ||
107  firstRefId != LIB_PART::GetSubpartFirstId() )
108  {
109  LIB_PART::SetSubpartIdNotation( refSeparator, firstRefId );
110  }
111 
112  settings.m_DefaultTextSize = (int) m_textSize.GetValue();
113  settings.m_DefaultLineWidth = (int) m_lineWidth.GetValue();
114  settings.m_DefaultWireThickness = (int) m_wireWidth.GetValue();
115  settings.m_DefaultBusThickness = (int) m_busWidth.GetValue();
116  settings.m_PinSymbolSize = (int) m_pinSymbolSize.GetValue();
117  settings.m_JunctionSize = (int) m_junctionSize.GetValue();
118 
120 
121  double dtmp = 0.0;
122  wxString msg = m_textOffsetRatioCtrl->GetValue();
123  msg.ToDouble( &dtmp );
124  settings.m_TextOffsetRatio = dtmp / 100.0;
125 
132 
135  m_frame->GetCanvas()->Refresh();
136 
137  return true;
138 }
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:138
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1444
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
static int GetSubpartIdSeparator()
Item is being added to the view.
Definition: view_item.h:62
static int GetSubpartFirstId()
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SCHEMATIC & Schematic() const
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...
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '.
These settings were stored in SCH_BASE_FRAME previously.
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
void SetDefaultPenWidth(int aWidth)
void MarkDirty()
Function MarkDirty() Forces redraw of view on the next rendering.
Definition: view.h:610

References SCH_BASE_FRAME::GetCanvas(), SCH_BASE_FRAME::GetRenderSettings(), LIB_PART::GetSubpartFirstId(), LIB_PART::GetSubpartIdSeparator(), UNIT_BINDER::GetValue(), SCH_DRAW_PANEL::GetView(), m_busWidth, PANEL_SETUP_FORMATTING_BASE::m_choiceSeparatorRefId, SCHEMATIC_SETTINGS::m_DefaultBusThickness, KIGFX::SCH_RENDER_SETTINGS::m_DefaultBusThickness, SCHEMATIC_SETTINGS::m_DefaultLineWidth, SCHEMATIC_SETTINGS::m_DefaultTextSize, SCHEMATIC_SETTINGS::m_DefaultWireThickness, KIGFX::SCH_RENDER_SETTINGS::m_DefaultWireThickness, m_frame, m_junctionSize, SCHEMATIC_SETTINGS::m_JunctionSize, KIGFX::SCH_RENDER_SETTINGS::m_JunctionSize, m_lineWidth, m_pinSymbolSize, SCHEMATIC_SETTINGS::m_PinSymbolSize, KIGFX::SCH_RENDER_SETTINGS::m_PinSymbolSize, SCHEMATIC_SETTINGS::m_TextOffsetRatio, KIGFX::SCH_RENDER_SETTINGS::m_TextOffsetRatio, PANEL_SETUP_FORMATTING_BASE::m_textOffsetRatioCtrl, m_textSize, m_wireWidth, KIGFX::VIEW::MarkDirty(), EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::REPAINT, SCH_EDIT_FRAME::SaveProjectSettings(), SCH_EDIT_FRAME::Schematic(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), LIB_PART::SetSubpartIdNotation(), SCHEMATIC::Settings(), and KIGFX::VIEW::UpdateAllItems().

◆ TransferDataToWindow()

bool PANEL_SETUP_FORMATTING::TransferDataToWindow ( )
override

Definition at line 48 of file panel_setup_formatting.cpp.

49 {
51 
52  // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
53  int refStyleSelection;
54 
56  {
57  default:
58  case 0: refStyleSelection = 0; break;
59  case '.': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 4 : 1; break;
60  case '-': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 5 : 2; break;
61  case '_': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 6 : 3; break;
62  }
63 
64  m_choiceSeparatorRefId->SetSelection( refStyleSelection );
65 
72 
79 
80  wxString offsetRatio = wxString::Format( "%f", settings.m_TextOffsetRatio * 100.0 );
81  m_textOffsetRatioCtrl->SetValue( offsetRatio );
82 
83  return true;
84 }
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:138
static int GetSubpartIdSeparator()
static int GetSubpartFirstId()
SCHEMATIC & Schematic() const
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
These settings were stored in SCH_BASE_FRAME previously.
virtual void SetUnits(EDA_UNITS aUnits, bool aUseMils=false)
Function SetUnits Normally not needed (as the UNIT_BINDER inherits from the parent frame),...
Definition: unit_binder.cpp:79

References Format(), LIB_PART::GetSubpartFirstId(), LIB_PART::GetSubpartIdSeparator(), INCHES, m_busWidth, PANEL_SETUP_FORMATTING_BASE::m_choiceSeparatorRefId, SCHEMATIC_SETTINGS::m_DefaultBusThickness, SCHEMATIC_SETTINGS::m_DefaultLineWidth, SCHEMATIC_SETTINGS::m_DefaultTextSize, SCHEMATIC_SETTINGS::m_DefaultWireThickness, m_frame, m_junctionSize, SCHEMATIC_SETTINGS::m_JunctionSize, m_lineWidth, m_pinSymbolSize, SCHEMATIC_SETTINGS::m_PinSymbolSize, SCHEMATIC_SETTINGS::m_TextOffsetRatio, PANEL_SETUP_FORMATTING_BASE::m_textOffsetRatioCtrl, m_textSize, m_wireWidth, SCH_EDIT_FRAME::Schematic(), SCHEMATIC::Settings(), UNIT_BINDER::SetUnits(), and UNIT_BINDER::SetValue().

Member Data Documentation

◆ m_busWidth

UNIT_BINDER PANEL_SETUP_FORMATTING::m_busWidth
private

◆ m_busWidthCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_busWidthCtrl
protectedinherited

◆ m_busWidthLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_busWidthLabel
protectedinherited

◆ m_busWidthUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_busWidthUnits
protectedinherited

◆ m_choiceSeparatorRefId

wxChoice* PANEL_SETUP_FORMATTING_BASE::m_choiceSeparatorRefId
protectedinherited

◆ m_frame

SCH_EDIT_FRAME* PANEL_SETUP_FORMATTING::m_frame
private

Definition at line 33 of file panel_setup_formatting.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

◆ m_jctSizeCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_jctSizeCtrl
protectedinherited

◆ m_jctSizeLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_jctSizeLabel
protectedinherited

◆ m_jctSizeUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_jctSizeUnits
protectedinherited

◆ m_junctionSize

UNIT_BINDER PANEL_SETUP_FORMATTING::m_junctionSize
private

◆ m_lineWidth

UNIT_BINDER PANEL_SETUP_FORMATTING::m_lineWidth
private

◆ m_lineWidthCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_lineWidthCtrl
protectedinherited

◆ m_lineWidthLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_lineWidthLabel
protectedinherited

◆ m_lineWidthUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_lineWidthUnits
protectedinherited

◆ m_offsetRatioUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_offsetRatioUnits
protectedinherited

◆ m_pinSymbolSize

UNIT_BINDER PANEL_SETUP_FORMATTING::m_pinSymbolSize
private

◆ m_pinSymbolSizeCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_pinSymbolSizeCtrl
protectedinherited

◆ m_pinSymbolSizeLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_pinSymbolSizeLabel
protectedinherited

◆ m_pinSymbolSizeUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_pinSymbolSizeUnits
protectedinherited

◆ m_staticText26

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_staticText26
protectedinherited

◆ m_textOffsetRatioCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_textOffsetRatioCtrl
protectedinherited

◆ m_textOffsetRatioLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_textOffsetRatioLabel
protectedinherited

◆ m_textSize

UNIT_BINDER PANEL_SETUP_FORMATTING::m_textSize
private

◆ m_textSizeCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_textSizeCtrl
protectedinherited

◆ m_textSizeLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_textSizeLabel
protectedinherited

◆ m_textSizeUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_textSizeUnits
protectedinherited

◆ m_wireWidth

UNIT_BINDER PANEL_SETUP_FORMATTING::m_wireWidth
private

◆ m_wireWidthCtrl

wxTextCtrl* PANEL_SETUP_FORMATTING_BASE::m_wireWidthCtrl
protectedinherited

◆ m_wireWidthLabel

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_wireWidthLabel
protectedinherited

◆ m_wireWidthUnits

wxStaticText* PANEL_SETUP_FORMATTING_BASE::m_wireWidthUnits
protectedinherited

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