KiCad PCB EDA Suite
PANEL_PCBNEW_SETTINGS Class Reference

#include <panel_pcbnew_settings.h>

Inheritance diagram for PANEL_PCBNEW_SETTINGS:
PANEL_PCBNEW_SETTINGS_BASE

Public Member Functions

 PANEL_PCBNEW_SETTINGS (PCB_EDIT_FRAME *aFrame, PAGED_DIALOG *aWindow)
 

Protected Types

enum  {
  wxID_POLAR_CTRL = 1000, wxID_UNITS, wxID_SEGMENTS45, wxID_MAGNETIC_TRACKS,
  wxID_DRC_ONOFF, wxID_TRACK_AUTODEL, wxID_TRACKS45
}
 

Protected Member Functions

bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 

Protected Attributes

wxRadioBox * m_PolarDisplay
 
wxRadioBox * m_UnitsSelection
 
wxCheckBox * m_Show_Page_Limits
 
wxCheckBox * m_Segments_45_Only_Ctrl
 
wxCheckBox * m_UseEditKeyForWidth
 
wxCheckBox * m_dragSelects
 
wxStaticText * m_staticTextRotationAngle
 
wxTextCtrl * m_RotationAngle
 
wxRadioBox * m_MagneticPadOptCtrl
 
wxRadioBox * m_MagneticTrackOptCtrl
 
wxCheckBox * m_DrcOn
 
wxCheckBox * m_TrackAutodel
 
wxCheckBox * m_Track_45_Only_Ctrl
 
wxCheckBox * m_Track_DoubleSegm_Ctrl
 

Private Attributes

PCB_EDIT_FRAMEm_Frame
 

Detailed Description

Definition at line 33 of file panel_pcbnew_settings.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

PANEL_PCBNEW_SETTINGS::PANEL_PCBNEW_SETTINGS ( PCB_EDIT_FRAME aFrame,
PAGED_DIALOG aWindow 
)

Definition at line 36 of file panel_pcbnew_settings.cpp.

36  :
37  PANEL_PCBNEW_SETTINGS_BASE( aParent->GetTreebook() ),
38  m_Frame( aFrame )
39 {}
PANEL_PCBNEW_SETTINGS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL)

Member Function Documentation

bool PANEL_PCBNEW_SETTINGS::TransferDataFromWindow ( )
overrideprotected

Definition at line 70 of file panel_pcbnew_settings.cpp.

References PCB_BASE_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), EDA_DRAW_PANEL_GAL::GetView(), INCHES, KIGFX::PCB_RENDER_SETTINGS::LoadDisplayOptions(), PANEL_PCBNEW_SETTINGS_BASE::m_dragSelects, PCB_GENERAL_SETTINGS::m_dragSelects, PANEL_PCBNEW_SETTINGS_BASE::m_DrcOn, PCB_GENERAL_SETTINGS::m_editActionChangesTrackWidth, m_Frame, PCB_GENERAL_SETTINGS::m_legacyAutoDeleteOldTrack, PCB_GENERAL_SETTINGS::m_legacyDrcOn, PCB_GENERAL_SETTINGS::m_legacyUse45DegreeTracks, PCB_GENERAL_SETTINGS::m_legacyUseTwoSegmentTracks, PANEL_PCBNEW_SETTINGS_BASE::m_MagneticPadOptCtrl, PCB_GENERAL_SETTINGS::m_magneticPads, PANEL_PCBNEW_SETTINGS_BASE::m_MagneticTrackOptCtrl, PCB_GENERAL_SETTINGS::m_magneticTracks, PANEL_PCBNEW_SETTINGS_BASE::m_PolarDisplay, PANEL_PCBNEW_SETTINGS_BASE::m_RotationAngle, PANEL_PCBNEW_SETTINGS_BASE::m_Segments_45_Only_Ctrl, PANEL_PCBNEW_SETTINGS_BASE::m_Show_Page_Limits, PANEL_PCBNEW_SETTINGS_BASE::m_Track_45_Only_Ctrl, PANEL_PCBNEW_SETTINGS_BASE::m_Track_DoubleSegm_Ctrl, PANEL_PCBNEW_SETTINGS_BASE::m_TrackAutodel, PANEL_PCBNEW_SETTINGS_BASE::m_UnitsSelection, PCB_GENERAL_SETTINGS::m_use45DegreeGraphicSegments, PANEL_PCBNEW_SETTINGS_BASE::m_UseEditKeyForWidth, MILLIMETRES, PCB_BASE_EDIT_FRAME::SetRotationAngle(), EDA_DRAW_FRAME::SetShowPageLimits(), PCB_BASE_FRAME::Settings(), EDA_DRAW_FRAME::SetUserUnits(), and EDA_DRAW_FRAME::ShowPageLimits().

71 {
72  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Frame->GetDisplayOptions();
73  displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0;
74 
75  m_Frame->SetUserUnits( m_UnitsSelection->GetSelection() == 0 ? INCHES : MILLIMETRES );
76 
77  m_Frame->SetRotationAngle( wxRound( 10.0 * wxAtof( m_RotationAngle->GetValue() ) ) );
78 
79  /* Updating the combobox to display the active layer. */
80  m_Frame->Settings().m_legacyDrcOn = m_DrcOn->GetValue();
81 
85 
91 
93 
94  // Apply changes to the GAL
96  KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
97  KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
98  settings->LoadDisplayOptions( displ_opts, m_Frame->ShowPageLimits() );
99 
100  return true;
101 }
bool ShowPageLimits() const
Definition: draw_frame.h:385
MAGNETIC_PAD_OPTION_VALUES m_magneticPads
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:211
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
static bool m_use45DegreeGraphicSegments
Class PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:62
MAGNETIC_PAD_OPTION_VALUES m_magneticTracks
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:223
PCB_GENERAL_SETTINGS & Settings()
Definition: common.h:160
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
MAGNETIC_PAD_OPTION_VALUES
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS *aOptions, bool aShowPageLimits)
Function LoadDisplayOptions Loads settings related to display options (high-contrast mode...
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:908
void SetShowPageLimits(bool aShow)
Definition: draw_frame.h:386
Class VIEW.
Definition: view.h:61
void SetRotationAngle(int aRotationAngle)
Function SetRotationAngle() Sets the angle used for rotate operations.
void SetUserUnits(EDA_UNITS_T aUnits)
Definition: draw_frame.h:285
bool PANEL_PCBNEW_SETTINGS::TransferDataToWindow ( )
overrideprotected

Definition at line 42 of file panel_pcbnew_settings.cpp.

References AngleToStringDegrees(), PCB_BASE_FRAME::GetDisplayOptions(), PCB_BASE_EDIT_FRAME::GetRotationAngle(), EDA_DRAW_FRAME::GetUserUnits(), INCHES, PANEL_PCBNEW_SETTINGS_BASE::m_dragSelects, PCB_GENERAL_SETTINGS::m_dragSelects, PANEL_PCBNEW_SETTINGS_BASE::m_DrcOn, PCB_GENERAL_SETTINGS::m_editActionChangesTrackWidth, m_Frame, PCB_GENERAL_SETTINGS::m_legacyAutoDeleteOldTrack, PCB_GENERAL_SETTINGS::m_legacyDrcOn, PCB_GENERAL_SETTINGS::m_legacyUse45DegreeTracks, PCB_GENERAL_SETTINGS::m_legacyUseTwoSegmentTracks, PANEL_PCBNEW_SETTINGS_BASE::m_MagneticPadOptCtrl, PCB_GENERAL_SETTINGS::m_magneticPads, PANEL_PCBNEW_SETTINGS_BASE::m_MagneticTrackOptCtrl, PCB_GENERAL_SETTINGS::m_magneticTracks, PANEL_PCBNEW_SETTINGS_BASE::m_PolarDisplay, PANEL_PCBNEW_SETTINGS_BASE::m_RotationAngle, PANEL_PCBNEW_SETTINGS_BASE::m_Segments_45_Only_Ctrl, PANEL_PCBNEW_SETTINGS_BASE::m_Show_Page_Limits, PANEL_PCBNEW_SETTINGS_BASE::m_Track_45_Only_Ctrl, PANEL_PCBNEW_SETTINGS_BASE::m_Track_DoubleSegm_Ctrl, PANEL_PCBNEW_SETTINGS_BASE::m_TrackAutodel, PANEL_PCBNEW_SETTINGS_BASE::m_UnitsSelection, PCB_GENERAL_SETTINGS::m_use45DegreeGraphicSegments, PANEL_PCBNEW_SETTINGS_BASE::m_UseEditKeyForWidth, PCB_BASE_FRAME::Settings(), and EDA_DRAW_FRAME::ShowPageLimits().

43 {
44  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Frame->GetDisplayOptions();
45 
46  /* Set display options */
47  m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 );
48  m_UnitsSelection->SetSelection( m_Frame->GetUserUnits() == INCHES ? 0 : 1 );
49 
50  wxString rotationAngle;
51  rotationAngle = AngleToStringDegrees( (double)m_Frame->GetRotationAngle() );
52  m_RotationAngle->SetValue( rotationAngle );
53 
54  m_DrcOn->SetValue( m_Frame->Settings().m_legacyDrcOn );
63 
65 
66  return true;
67 }
bool ShowPageLimits() const
Definition: draw_frame.h:385
MAGNETIC_PAD_OPTION_VALUES m_magneticPads
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
static bool m_use45DegreeGraphicSegments
MAGNETIC_PAD_OPTION_VALUES m_magneticTracks
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
PCB_GENERAL_SETTINGS & Settings()
wxString AngleToStringDegrees(double aAngle)
Function AngleToStringDegrees is a helper to convert the double aAngle (in internal unit) to a string...
Definition: base_units.cpp:421
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:284
Definition: common.h:160
int GetRotationAngle() const
Function GetRotationAngle() Returns the angle used for rotate operations.

Member Data Documentation

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_dragSelects
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_DrcOn
protectedinherited
PCB_EDIT_FRAME* PANEL_PCBNEW_SETTINGS::m_Frame
private

Definition at line 36 of file panel_pcbnew_settings.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

wxRadioBox* PANEL_PCBNEW_SETTINGS_BASE::m_MagneticPadOptCtrl
protectedinherited
wxRadioBox* PANEL_PCBNEW_SETTINGS_BASE::m_MagneticTrackOptCtrl
protectedinherited
wxRadioBox* PANEL_PCBNEW_SETTINGS_BASE::m_PolarDisplay
protectedinherited
wxTextCtrl* PANEL_PCBNEW_SETTINGS_BASE::m_RotationAngle
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Segments_45_Only_Ctrl
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Show_Page_Limits
protectedinherited
wxStaticText* PANEL_PCBNEW_SETTINGS_BASE::m_staticTextRotationAngle
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Track_45_Only_Ctrl
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Track_DoubleSegm_Ctrl
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_TrackAutodel
protectedinherited
wxRadioBox* PANEL_PCBNEW_SETTINGS_BASE::m_UnitsSelection
protectedinherited
wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_UseEditKeyForWidth
protectedinherited

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