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_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
 
wxStaticText * m_staticText2
 
wxChoice * m_magneticPadChoice
 
wxStaticText * m_staticText21
 
wxChoice * m_magneticTrackChoice
 
wxStaticText * m_staticText211
 
wxChoice * m_magneticGraphicsChoice
 
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

◆ anonymous enum

Constructor & Destructor Documentation

◆ PANEL_PCBNEW_SETTINGS()

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, const wxString &name=wxEmptyString)

Member Function Documentation

◆ TransferDataFromWindow()

bool PANEL_PCBNEW_SETTINGS::TransferDataFromWindow ( )
overrideprotected

Definition at line 71 of file panel_pcbnew_settings.cpp.

72 {
73  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Frame->GetDisplayOptions();
74  displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0;
75 
76  m_Frame->SetUserUnits( m_UnitsSelection->GetSelection() == 0 ? INCHES : MILLIMETRES );
77 
78  m_Frame->SetRotationAngle( wxRound( 10.0 * wxAtof( m_RotationAngle->GetValue() ) ) );
79 
80  /* Updating the combobox to display the active layer. */
81  m_Frame->Settings().m_legacyDrcOn = m_DrcOn->GetValue();
82 
86 
93 
95 
96  // Apply changes to the GAL
98  KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
99  KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
100  settings->LoadDisplayOptions( displ_opts, m_Frame->ShowPageLimits() );
101 
102  return true;
103 }
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:935
MAGNETIC_PAD_OPTION_VALUES m_magneticPads
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:211
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
bool ShowPageLimits() const
Definition: draw_frame.h:392
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:161
MAGNETIC_PAD_OPTION_VALUES
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS *aOptions, bool aShowPageLimits)
Function LoadDisplayOptions Loads settings related to display options (high-contrast mode,...
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void SetShowPageLimits(bool aShow)
Definition: draw_frame.h:393
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:292

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, PCB_GENERAL_SETTINGS::m_magneticGraphics, PANEL_PCBNEW_SETTINGS_BASE::m_magneticGraphicsChoice, PANEL_PCBNEW_SETTINGS_BASE::m_magneticPadChoice, PCB_GENERAL_SETTINGS::m_magneticPads, PANEL_PCBNEW_SETTINGS_BASE::m_magneticTrackChoice, 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().

◆ TransferDataToWindow()

bool PANEL_PCBNEW_SETTINGS::TransferDataToWindow ( )
overrideprotected

Definition at line 42 of file panel_pcbnew_settings.cpp.

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 );
64 
66 
67  return true;
68 }
MAGNETIC_PAD_OPTION_VALUES m_magneticPads
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
bool ShowPageLimits() const
Definition: draw_frame.h:392
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:291
Definition: common.h:161
int GetRotationAngle() const
Function GetRotationAngle() Returns the angle used for rotate operations.

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, PCB_GENERAL_SETTINGS::m_magneticGraphics, PANEL_PCBNEW_SETTINGS_BASE::m_magneticGraphicsChoice, PANEL_PCBNEW_SETTINGS_BASE::m_magneticPadChoice, PCB_GENERAL_SETTINGS::m_magneticPads, PANEL_PCBNEW_SETTINGS_BASE::m_magneticTrackChoice, 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().

Member Data Documentation

◆ m_dragSelects

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_dragSelects
protectedinherited

◆ m_DrcOn

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_DrcOn
protectedinherited

◆ m_Frame

PCB_EDIT_FRAME* PANEL_PCBNEW_SETTINGS::m_Frame
private

Definition at line 36 of file panel_pcbnew_settings.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

◆ m_magneticGraphicsChoice

wxChoice* PANEL_PCBNEW_SETTINGS_BASE::m_magneticGraphicsChoice
protectedinherited

◆ m_magneticPadChoice

wxChoice* PANEL_PCBNEW_SETTINGS_BASE::m_magneticPadChoice
protectedinherited

◆ m_magneticTrackChoice

wxChoice* PANEL_PCBNEW_SETTINGS_BASE::m_magneticTrackChoice
protectedinherited

◆ m_PolarDisplay

wxRadioBox* PANEL_PCBNEW_SETTINGS_BASE::m_PolarDisplay
protectedinherited

◆ m_RotationAngle

wxTextCtrl* PANEL_PCBNEW_SETTINGS_BASE::m_RotationAngle
protectedinherited

◆ m_Segments_45_Only_Ctrl

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Segments_45_Only_Ctrl
protectedinherited

◆ m_Show_Page_Limits

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Show_Page_Limits
protectedinherited

◆ m_staticText2

wxStaticText* PANEL_PCBNEW_SETTINGS_BASE::m_staticText2
protectedinherited

◆ m_staticText21

wxStaticText* PANEL_PCBNEW_SETTINGS_BASE::m_staticText21
protectedinherited

◆ m_staticText211

wxStaticText* PANEL_PCBNEW_SETTINGS_BASE::m_staticText211
protectedinherited

◆ m_staticTextRotationAngle

wxStaticText* PANEL_PCBNEW_SETTINGS_BASE::m_staticTextRotationAngle
protectedinherited

◆ m_Track_45_Only_Ctrl

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Track_45_Only_Ctrl
protectedinherited

◆ m_Track_DoubleSegm_Ctrl

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_Track_DoubleSegm_Ctrl
protectedinherited

◆ m_TrackAutodel

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_TrackAutodel
protectedinherited

◆ m_UnitsSelection

wxRadioBox* PANEL_PCBNEW_SETTINGS_BASE::m_UnitsSelection
protectedinherited

◆ m_UseEditKeyForWidth

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_UseEditKeyForWidth
protectedinherited

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