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 }
 

Protected Member Functions

bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 

Protected Attributes

wxRadioBox * m_PolarDisplay
 
wxRadioBox * m_UnitsSelection
 
wxCheckBox * m_Segments_45_Only_Ctrl
 
wxCheckBox * m_UseEditKeyForWidth
 
wxCheckBox * m_FlipLeftRight
 
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_showGlobalRatsnest
 
wxCheckBox * m_showSelectedRatsnest
 
wxCheckBox * m_OptDisplayCurvedRatsnestLines
 
wxCheckBox * m_Show_Page_Limits
 

Private Attributes

PCB_EDIT_FRAMEm_Frame
 

Detailed Description

Definition at line 33 of file panel_pcbnew_settings.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited

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 72 of file panel_pcbnew_settings.cpp.

73 {
74  m_Frame->SetShowPolarCoords( m_PolarDisplay->GetSelection() != 0 );
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 
87 
89 
90  // Apply changes to the GAL
92  KIGFX::VIEW* view = m_Frame->GetCanvas()->GetView();
93  KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
94  KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
95 
97  displ_opts->m_ShowGlobalRatsnest = m_showGlobalRatsnest->GetValue();
98  displ_opts->m_ShowModuleRatsnest = m_showSelectedRatsnest->GetValue();
99 
100  settings->LoadDisplayOptions( displ_opts, m_Frame->ShowPageLimits() );
101  view->RecacheAllItems();
103 
104  m_Frame->GetCanvas()->Refresh();
105 
106  return true;
107 }
void SetUserUnits(EDA_UNITS_T aUnits)
void SetShowPolarCoords(bool aShow)
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1402
MAGNETIC_OPTIONS m_MagneticTracks
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:226
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
Auxiliary rendering target (noncached)
Definition: definitions.h:49
Class PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:61
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
MAGNETIC_OPTIONS m_MagneticPads
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:238
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:585
PCB_GENERAL_SETTINGS & Settings()
Definition: common.h:155
MAGNETIC_OPTIONS
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
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...
void SetShowPageLimits(bool aShow)
Class VIEW.
Definition: view.h:61
void SetRotationAngle(int aRotationAngle)
Function SetRotationAngle() Sets the angle used for rotate operations.

References PCB_BASE_FRAME::GetCanvas(), PCB_BASE_FRAME::GetDisplayOptions(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), PCB_DRAW_PANEL_GAL::GetView(), INCHES, PCB_DISPLAY_OPTIONS::m_DisplayRatsnestLinesCurved, PCB_GENERAL_SETTINGS::m_EditHotkeyChangesTrackWidth, PANEL_PCBNEW_SETTINGS_BASE::m_FlipLeftRight, PCB_GENERAL_SETTINGS::m_FlipLeftRight, m_Frame, 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_OptDisplayCurvedRatsnestLines, 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_showGlobalRatsnest, PCB_DISPLAY_OPTIONS::m_ShowGlobalRatsnest, PCB_DISPLAY_OPTIONS::m_ShowModuleRatsnest, PANEL_PCBNEW_SETTINGS_BASE::m_showSelectedRatsnest, PANEL_PCBNEW_SETTINGS_BASE::m_UnitsSelection, PCB_GENERAL_SETTINGS::m_Use45DegreeGraphicSegments, PANEL_PCBNEW_SETTINGS_BASE::m_UseEditKeyForWidth, KIGFX::VIEW::MarkTargetDirty(), MILLIMETRES, KIGFX::VIEW::RecacheAllItems(), EDA_DRAW_PANEL_GAL::Refresh(), PCB_BASE_EDIT_FRAME::SetRotationAngle(), EDA_DRAW_FRAME::SetShowPageLimits(), EDA_DRAW_FRAME::SetShowPolarCoords(), PCB_BASE_FRAME::Settings(), EDA_BASE_FRAME::SetUserUnits(), EDA_DRAW_FRAME::ShowPageLimits(), and KIGFX::TARGET_NONCACHED.

◆ TransferDataToWindow()

bool PANEL_PCBNEW_SETTINGS::TransferDataToWindow ( )
overrideprotected

Definition at line 42 of file panel_pcbnew_settings.cpp.

43 {
45  const PCB_GENERAL_SETTINGS& general_opts = m_Frame->Settings();
46 
47  /* Set display options */
48  m_PolarDisplay->SetSelection( m_Frame->GetShowPolarCoords() ? 1 : 0 );
49  m_UnitsSelection->SetSelection( m_Frame->GetUserUnits() == INCHES ? 0 : 1 );
51  m_showGlobalRatsnest->SetValue( displ_opts->m_ShowGlobalRatsnest );
52  m_showSelectedRatsnest->SetValue( displ_opts->m_ShowModuleRatsnest );
54 
55  wxString rotationAngle;
56  rotationAngle = AngleToStringDegrees( (double)m_Frame->GetRotationAngle() );
57  m_RotationAngle->SetValue( rotationAngle );
58 
59  m_Segments_45_Only_Ctrl->SetValue( general_opts.m_Use45DegreeGraphicSegments );
60  m_magneticPadChoice->SetSelection( general_opts.m_MagneticPads );
61  m_magneticTrackChoice->SetSelection( general_opts.m_MagneticTracks );
62  m_magneticGraphicsChoice->SetSelection( !general_opts.m_MagneticGraphics );
63  m_UseEditKeyForWidth->SetValue( general_opts.m_EditHotkeyChangesTrackWidth );
64  m_FlipLeftRight->SetValue( general_opts.m_FlipLeftRight );
65 
67 
68  return true;
69 }
MAGNETIC_OPTIONS m_MagneticTracks
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
bool ShowPageLimits() const
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
MAGNETIC_OPTIONS m_MagneticPads
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:426
Definition: common.h:155
int GetRotationAngle() const
Function GetRotationAngle() Returns the angle used for rotate operations.
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.

References AngleToStringDegrees(), PCB_BASE_FRAME::GetDisplayOptions(), PCB_BASE_EDIT_FRAME::GetRotationAngle(), EDA_DRAW_FRAME::GetShowPolarCoords(), EDA_BASE_FRAME::GetUserUnits(), INCHES, PCB_DISPLAY_OPTIONS::m_DisplayRatsnestLinesCurved, PCB_GENERAL_SETTINGS::m_EditHotkeyChangesTrackWidth, PANEL_PCBNEW_SETTINGS_BASE::m_FlipLeftRight, PCB_GENERAL_SETTINGS::m_FlipLeftRight, m_Frame, 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_OptDisplayCurvedRatsnestLines, 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_showGlobalRatsnest, PCB_DISPLAY_OPTIONS::m_ShowGlobalRatsnest, PCB_DISPLAY_OPTIONS::m_ShowModuleRatsnest, PANEL_PCBNEW_SETTINGS_BASE::m_showSelectedRatsnest, 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_FlipLeftRight

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_FlipLeftRight
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_OptDisplayCurvedRatsnestLines

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_OptDisplayCurvedRatsnestLines
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_showGlobalRatsnest

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_showGlobalRatsnest
protectedinherited

◆ m_showSelectedRatsnest

wxCheckBox* PANEL_PCBNEW_SETTINGS_BASE::m_showSelectedRatsnest
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_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: