Implement Reset to Defaults for all preferences panels.
This commit is contained in:
parent
4cf3f44532
commit
a6dd1bf09b
|
@ -107,3 +107,21 @@ bool PANEL_3D_COLORS::TransferDataFromWindow()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_3D_COLORS::ResetPanel()
|
||||||
|
{
|
||||||
|
COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
|
||||||
|
|
||||||
|
m_backgroundTop->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_BACKGROUND_TOP ), false );
|
||||||
|
m_backgroundBottom->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_BACKGROUND_BOTTOM ), false );
|
||||||
|
m_silkscreenTop->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SILKSCREEN_TOP ), false );
|
||||||
|
m_silkscreenBottom->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SILKSCREEN_BOTTOM ), false );
|
||||||
|
m_solderMaskTop->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SOLDERMASK_TOP ), false );
|
||||||
|
m_solderMaskBottom->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SOLDERMASK_BOTTOM ), false );
|
||||||
|
m_solderPaste->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_SOLDERPASTE ), false );
|
||||||
|
m_surfaceFinish->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_COPPER ), false );
|
||||||
|
m_boardBody->SetSwatchColor( colors->GetDefaultColor( LAYER_3D_BOARD ), false );
|
||||||
|
|
||||||
|
m_boardStackupRB->SetValue( true );
|
||||||
|
}
|
|
@ -32,11 +32,10 @@ class PANEL_3D_COLORS : public PANEL_3D_COLORS_BASE
|
||||||
public:
|
public:
|
||||||
explicit PANEL_3D_COLORS( wxWindow* aParent );
|
explicit PANEL_3D_COLORS( wxWindow* aParent );
|
||||||
|
|
||||||
/// Automatically called when clicking on the OK button
|
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
/// Automatically called after creating the dialog
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version 3.9.0 Aug 10 2021)
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_3D_COLORS_BASE::PANEL_3D_COLORS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bSizerMain;
|
wxBoxSizer* bSizerMain;
|
||||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<property name="file">panel_3D_colors_base</property>
|
<property name="file">panel_3D_colors_base</property>
|
||||||
<property name="first_id">1000</property>
|
<property name="first_id">1000</property>
|
||||||
<property name="help_provider">none</property>
|
<property name="help_provider">none</property>
|
||||||
<property name="image_path_wrapper_function_name"></property>
|
|
||||||
<property name="indent_with_spaces"></property>
|
<property name="indent_with_spaces"></property>
|
||||||
<property name="internationalize">1</property>
|
<property name="internationalize">1</property>
|
||||||
<property name="name">panel_3D_colors_base</property>
|
<property name="name">panel_3D_colors_base</property>
|
||||||
|
@ -26,7 +25,6 @@
|
||||||
<property name="skip_php_events">1</property>
|
<property name="skip_php_events">1</property>
|
||||||
<property name="skip_python_events">1</property>
|
<property name="skip_python_events">1</property>
|
||||||
<property name="ui_table">UI</property>
|
<property name="ui_table">UI</property>
|
||||||
<property name="use_array_enum">0</property>
|
|
||||||
<property name="use_enum">0</property>
|
<property name="use_enum">0</property>
|
||||||
<property name="use_microsoft_bom">0</property>
|
<property name="use_microsoft_bom">0</property>
|
||||||
<object class="Panel" expanded="1">
|
<object class="Panel" expanded="1">
|
||||||
|
@ -46,9 +44,8 @@
|
||||||
<property name="name">PANEL_3D_COLORS_BASE</property>
|
<property name="name">PANEL_3D_COLORS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; ; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="two_step_creation">0</property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version 3.9.0 Aug 10 2021)
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
class COLOR_SWATCH;
|
class COLOR_SWATCH;
|
||||||
|
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -29,7 +30,7 @@ class COLOR_SWATCH;
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_3D_COLORS_BASE
|
/// Class PANEL_3D_COLORS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_3D_COLORS_BASE : public wxPanel
|
class PANEL_3D_COLORS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -58,7 +59,6 @@ class PANEL_3D_COLORS_BASE : public wxPanel
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PANEL_3D_COLORS_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 );
|
PANEL_3D_COLORS_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 );
|
||||||
|
|
||||||
~PANEL_3D_COLORS_BASE();
|
~PANEL_3D_COLORS_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,32 +41,38 @@ void PANEL_3D_DISPLAY_OPTIONS::OnCheckEnableAnimation( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_3D_DISPLAY_OPTIONS::loadViewSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
// Check/uncheck checkboxes
|
||||||
|
m_checkBoxRealisticMode->SetValue( aCfg->m_Render.realistic );
|
||||||
|
m_checkBoxBoardBody->SetValue( aCfg->m_Render.show_board_body );
|
||||||
|
m_checkBoxAreas->SetValue( aCfg->m_Render.show_zones );
|
||||||
|
m_checkBoxSilkscreen->SetValue( aCfg->m_Render.show_silkscreen );
|
||||||
|
m_checkBoxSolderMask->SetValue( aCfg->m_Render.show_soldermask );
|
||||||
|
m_checkBoxSolderpaste->SetValue( aCfg->m_Render.show_solderpaste );
|
||||||
|
m_checkBoxAdhesive->SetValue( aCfg->m_Render.show_adhesive );
|
||||||
|
m_checkBoxComments->SetValue( aCfg->m_Render.show_comments );
|
||||||
|
m_checkBoxECO->SetValue( aCfg->m_Render.show_eco );
|
||||||
|
m_checkBoxSubtractMaskFromSilk->SetValue( aCfg->m_Render.subtract_mask_from_silk );
|
||||||
|
m_checkBoxClipSilkOnViaAnnulus->SetValue( aCfg->m_Render.clip_silk_on_via_annulus );
|
||||||
|
m_checkBoxRenderPlatedPadsAsPlated->SetValue( aCfg->m_Render.renderPlatedPadsAsPlated );
|
||||||
|
|
||||||
|
m_materialProperties->SetSelection( aCfg->m_Render.material_mode );
|
||||||
|
|
||||||
|
// Camera Options
|
||||||
|
m_checkBoxEnableAnimation->SetValue( aCfg->m_Camera.animation_enabled );
|
||||||
|
m_sliderAnimationSpeed->SetValue( aCfg->m_Camera.moving_speed_multiplier );
|
||||||
|
m_staticAnimationSpeed->Enable( aCfg->m_Camera.animation_enabled );
|
||||||
|
m_sliderAnimationSpeed->Enable( aCfg->m_Camera.animation_enabled );
|
||||||
|
m_spinCtrlRotationAngle->SetValue( aCfg->m_Camera.rotation_increment );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow()
|
bool PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||||
|
|
||||||
// Check/uncheck checkboxes
|
loadViewSettings( cfg );
|
||||||
m_checkBoxRealisticMode->SetValue( cfg->m_Render.realistic );
|
|
||||||
m_checkBoxBoardBody->SetValue( cfg->m_Render.show_board_body );
|
|
||||||
m_checkBoxAreas->SetValue( cfg->m_Render.show_zones );
|
|
||||||
m_checkBoxSilkscreen->SetValue( cfg->m_Render.show_silkscreen );
|
|
||||||
m_checkBoxSolderMask->SetValue( cfg->m_Render.show_soldermask );
|
|
||||||
m_checkBoxSolderpaste->SetValue( cfg->m_Render.show_solderpaste );
|
|
||||||
m_checkBoxAdhesive->SetValue( cfg->m_Render.show_adhesive );
|
|
||||||
m_checkBoxComments->SetValue( cfg->m_Render.show_comments );
|
|
||||||
m_checkBoxECO->SetValue( cfg->m_Render.show_eco );
|
|
||||||
m_checkBoxSubtractMaskFromSilk->SetValue( cfg->m_Render.subtract_mask_from_silk );
|
|
||||||
m_checkBoxClipSilkOnViaAnnulus->SetValue( cfg->m_Render.clip_silk_on_via_annulus );
|
|
||||||
m_checkBoxRenderPlatedPadsAsPlated->SetValue( cfg->m_Render.renderPlatedPadsAsPlated );
|
|
||||||
|
|
||||||
m_materialProperties->SetSelection( cfg->m_Render.material_mode );
|
|
||||||
|
|
||||||
// Camera Options
|
|
||||||
m_checkBoxEnableAnimation->SetValue( cfg->m_Camera.animation_enabled );
|
|
||||||
m_sliderAnimationSpeed->SetValue( cfg->m_Camera.moving_speed_multiplier );
|
|
||||||
m_staticAnimationSpeed->Enable( cfg->m_Camera.animation_enabled );
|
|
||||||
m_sliderAnimationSpeed->Enable( cfg->m_Camera.animation_enabled );
|
|
||||||
m_spinCtrlRotationAngle->SetValue( cfg->m_Camera.rotation_increment );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -103,3 +109,12 @@ bool PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_3D_DISPLAY_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
EDA_3D_VIEWER_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadViewSettings( &cfg );
|
||||||
|
}
|
|
@ -36,11 +36,13 @@ public:
|
||||||
|
|
||||||
void OnCheckEnableAnimation( wxCommandEvent& WXUNUSED( event ) ) override;
|
void OnCheckEnableAnimation( wxCommandEvent& WXUNUSED( event ) ) override;
|
||||||
|
|
||||||
/// Automatically called when clicking on the OK button
|
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
/// Automatically called after creating the dialog
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadViewSettings( EDA_3D_VIEWER_SETTINGS* aCfg );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bSizerMain;
|
wxBoxSizer* bSizerMain;
|
||||||
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
|
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_3D_DISPLAY_OPTIONS_BASE</property>
|
<property name="name">PANEL_3D_DISPLAY_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; ; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_3D_DISPLAY_OPTIONS_BASE
|
/// Class PANEL_3D_DISPLAY_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_3D_DISPLAY_OPTIONS_BASE : public wxPanel
|
class PANEL_3D_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -37,21 +37,27 @@ PANEL_3D_OPENGL_OPTIONS::PANEL_3D_OPENGL_OPTIONS( wxWindow* aParent ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_3D_OPENGL_OPTIONS::loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
m_checkBoxCuThickness->SetValue( aCfg->m_Render.opengl_copper_thickness );
|
||||||
|
m_checkBoxBoundingBoxes->SetValue( aCfg->m_Render.opengl_show_model_bbox );
|
||||||
|
m_checkBoxHighlightOnRollOver->SetValue( aCfg->m_Render.opengl_highlight_on_rollover );
|
||||||
|
|
||||||
|
m_choiceAntiAliasing->SetSelection( aCfg->m_Render.opengl_AA_mode );
|
||||||
|
m_selectionColorSwatch->SetSwatchColor( aCfg->m_Render.opengl_selection_color, false );
|
||||||
|
|
||||||
|
m_checkBoxDisableAAMove->SetValue( aCfg->m_Render.opengl_AA_disableOnMove );
|
||||||
|
m_checkBoxDisableMoveThickness->SetValue( aCfg->m_Render.opengl_thickness_disableOnMove );
|
||||||
|
m_checkBoxDisableMoveVias->SetValue( aCfg->m_Render.opengl_vias_disableOnMove );
|
||||||
|
m_checkBoxDisableMoveHoles->SetValue( aCfg->m_Render.opengl_holes_disableOnMove );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow()
|
bool PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||||
|
|
||||||
m_checkBoxCuThickness->SetValue( cfg->m_Render.opengl_copper_thickness );
|
loadSettings( cfg );
|
||||||
m_checkBoxBoundingBoxes->SetValue( cfg->m_Render.opengl_show_model_bbox );
|
|
||||||
m_checkBoxHighlightOnRollOver->SetValue( cfg->m_Render.opengl_highlight_on_rollover );
|
|
||||||
|
|
||||||
m_choiceAntiAliasing->SetSelection( cfg->m_Render.opengl_AA_mode );
|
|
||||||
m_selectionColorSwatch->SetSwatchColor( cfg->m_Render.opengl_selection_color, false );
|
|
||||||
|
|
||||||
m_checkBoxDisableAAMove->SetValue( cfg->m_Render.opengl_AA_disableOnMove );
|
|
||||||
m_checkBoxDisableMoveThickness->SetValue( cfg->m_Render.opengl_thickness_disableOnMove );
|
|
||||||
m_checkBoxDisableMoveVias->SetValue( cfg->m_Render.opengl_vias_disableOnMove );
|
|
||||||
m_checkBoxDisableMoveHoles->SetValue( cfg->m_Render.opengl_holes_disableOnMove );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -75,3 +81,12 @@ bool PANEL_3D_OPENGL_OPTIONS::TransferDataFromWindow()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_3D_OPENGL_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
EDA_3D_VIEWER_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadSettings( &cfg );
|
||||||
|
}
|
|
@ -33,11 +33,13 @@ class PANEL_3D_OPENGL_OPTIONS : public PANEL_3D_OPENGL_OPTIONS_BASE
|
||||||
public:
|
public:
|
||||||
explicit PANEL_3D_OPENGL_OPTIONS( wxWindow* aParent );
|
explicit PANEL_3D_OPENGL_OPTIONS( wxWindow* aParent );
|
||||||
|
|
||||||
/// Automatically called when clicking on the OK button
|
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
/// Automatically called after creating the dialog
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version 3.9.0 Aug 10 2021)
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_3D_OPENGL_OPTIONS_BASE::PANEL_3D_OPENGL_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_3D_OPENGL_OPTIONS_BASE::PANEL_3D_OPENGL_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bSizerMain;
|
wxBoxSizer* bSizerMain;
|
||||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<property name="file">panel_3D_opengl_options_base</property>
|
<property name="file">panel_3D_opengl_options_base</property>
|
||||||
<property name="first_id">1000</property>
|
<property name="first_id">1000</property>
|
||||||
<property name="help_provider">none</property>
|
<property name="help_provider">none</property>
|
||||||
<property name="image_path_wrapper_function_name"></property>
|
|
||||||
<property name="indent_with_spaces"></property>
|
<property name="indent_with_spaces"></property>
|
||||||
<property name="internationalize">1</property>
|
<property name="internationalize">1</property>
|
||||||
<property name="name">panel_3D_opengl_optionS_base</property>
|
<property name="name">panel_3D_opengl_optionS_base</property>
|
||||||
|
@ -26,7 +25,6 @@
|
||||||
<property name="skip_php_events">1</property>
|
<property name="skip_php_events">1</property>
|
||||||
<property name="skip_python_events">1</property>
|
<property name="skip_python_events">1</property>
|
||||||
<property name="ui_table">UI</property>
|
<property name="ui_table">UI</property>
|
||||||
<property name="use_array_enum">0</property>
|
|
||||||
<property name="use_enum">0</property>
|
<property name="use_enum">0</property>
|
||||||
<property name="use_microsoft_bom">0</property>
|
<property name="use_microsoft_bom">0</property>
|
||||||
<object class="Panel" expanded="1">
|
<object class="Panel" expanded="1">
|
||||||
|
@ -46,9 +44,8 @@
|
||||||
<property name="name">PANEL_3D_OPENGL_OPTIONS_BASE</property>
|
<property name="name">PANEL_3D_OPENGL_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; ; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="two_step_creation">0</property>
|
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version 3.9.0 Aug 10 2021)
|
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
class COLOR_SWATCH;
|
class COLOR_SWATCH;
|
||||||
|
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -30,7 +31,7 @@ class COLOR_SWATCH;
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_3D_OPENGL_OPTIONS_BASE
|
/// Class PANEL_3D_OPENGL_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_3D_OPENGL_OPTIONS_BASE : public wxPanel
|
class PANEL_3D_OPENGL_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -50,7 +51,6 @@ class PANEL_3D_OPENGL_OPTIONS_BASE : public wxPanel
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PANEL_3D_OPENGL_OPTIONS_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 );
|
PANEL_3D_OPENGL_OPTIONS_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 );
|
||||||
|
|
||||||
~PANEL_3D_OPENGL_OPTIONS_BASE();
|
~PANEL_3D_OPENGL_OPTIONS_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,39 +34,29 @@ PANEL_3D_RAYTRACING_OPTIONS::PANEL_3D_RAYTRACING_OPTIONS( wxWindow* aParent ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PANEL_3D_RAYTRACING_OPTIONS::ResetPanel()
|
void PANEL_3D_RAYTRACING_OPTIONS::loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
m_cbRaytracing_renderShadows->SetValue( aCfg->m_Render.raytrace_shadows );
|
||||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
m_cbRaytracing_addFloor->SetValue( aCfg->m_Render.raytrace_backfloor );
|
||||||
|
m_cbRaytracing_showRefractions->SetValue( aCfg->m_Render.raytrace_refractions );
|
||||||
|
m_cbRaytracing_showReflections->SetValue( aCfg->m_Render.raytrace_reflections );
|
||||||
|
m_cbRaytracing_postProcessing->SetValue( aCfg->m_Render.raytrace_post_processing );
|
||||||
|
m_cbRaytracing_antiAliasing->SetValue( aCfg->m_Render.raytrace_anti_aliasing );
|
||||||
|
m_cbRaytracing_proceduralTextures->SetValue( aCfg->m_Render.raytrace_procedural_textures );
|
||||||
|
|
||||||
cfg->m_Render.raytrace_lightColorCamera = COLOR4D( 0.2, 0.2, 0.2, 1.0 );
|
m_numSamples_Shadows->SetValue( aCfg->m_Render.raytrace_nrsamples_shadows );
|
||||||
cfg->m_Render.raytrace_lightColorTop = COLOR4D( 0.247, 0.247, 0.247, 1.0 );
|
m_numSamples_Reflections->SetValue( aCfg->m_Render.raytrace_nrsamples_reflections );
|
||||||
cfg->m_Render.raytrace_lightColorBottom = COLOR4D( 0.247, 0.247, 0.247, 1.0 );
|
m_numSamples_Refractions->SetValue( aCfg->m_Render.raytrace_nrsamples_refractions );
|
||||||
|
|
||||||
const std::vector<int> default_elevation =
|
m_spreadFactor_Shadows->SetValue( StringFromValue( EDA_UNITS::PERCENT,
|
||||||
{
|
aCfg->m_Render.raytrace_spread_shadows * 100.0f ) );
|
||||||
67, 67, 67, 67, -67, -67, -67, -67,
|
m_spreadFactor_Reflections->SetValue( StringFromValue( EDA_UNITS::PERCENT,
|
||||||
};
|
aCfg->m_Render.raytrace_spread_reflections * 100.0f ) );
|
||||||
|
m_spreadFactor_Refractions->SetValue( StringFromValue( EDA_UNITS::PERCENT,
|
||||||
|
aCfg->m_Render.raytrace_spread_refractions * 100.0f ) );
|
||||||
|
|
||||||
const std::vector<int> default_azimuth =
|
m_recursiveLevel_Reflections->SetValue( aCfg->m_Render.raytrace_recursivelevel_reflections );
|
||||||
{
|
m_recursiveLevel_Refractions->SetValue( aCfg->m_Render.raytrace_recursivelevel_refractions );
|
||||||
45, 135, 225, 315, 45, 135, 225, 315,
|
|
||||||
};
|
|
||||||
|
|
||||||
for( size_t i = 0; i < 8; ++i )
|
|
||||||
{
|
|
||||||
cfg->m_Render.raytrace_lightElevation[i] = default_elevation[i];
|
|
||||||
cfg->m_Render.raytrace_lightAzimuth[i] = default_azimuth[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
TransferColorDataToWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PANEL_3D_RAYTRACING_OPTIONS::TransferColorDataToWindow()
|
|
||||||
{
|
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
|
||||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
|
||||||
|
|
||||||
auto transfer_color =
|
auto transfer_color =
|
||||||
[]( COLOR4D aColor, COLOR_SWATCH *aTarget )
|
[]( COLOR4D aColor, COLOR_SWATCH *aTarget )
|
||||||
|
@ -82,37 +72,37 @@ void PANEL_3D_RAYTRACING_OPTIONS::TransferColorDataToWindow()
|
||||||
aCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED, aValue ) );
|
aCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED, aValue ) );
|
||||||
};
|
};
|
||||||
|
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColorCamera, m_colourPickerCameraLight );
|
transfer_color( aCfg->m_Render.raytrace_lightColorCamera, m_colourPickerCameraLight );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColorTop, m_colourPickerTopLight );
|
transfer_color( aCfg->m_Render.raytrace_lightColorTop, m_colourPickerTopLight );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColorBottom, m_colourPickerBottomLight );
|
transfer_color( aCfg->m_Render.raytrace_lightColorBottom, m_colourPickerBottomLight );
|
||||||
|
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[0], m_colourPickerLight1 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[0], m_colourPickerLight1 );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[1], m_colourPickerLight2 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[1], m_colourPickerLight2 );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[2], m_colourPickerLight3 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[2], m_colourPickerLight3 );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[3], m_colourPickerLight4 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[3], m_colourPickerLight4 );
|
||||||
|
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[4], m_colourPickerLight5 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[4], m_colourPickerLight5 );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[5], m_colourPickerLight6 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[5], m_colourPickerLight6 );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[6], m_colourPickerLight7 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[6], m_colourPickerLight7 );
|
||||||
transfer_color( cfg->m_Render.raytrace_lightColor[7], m_colourPickerLight8 );
|
transfer_color( aCfg->m_Render.raytrace_lightColor[7], m_colourPickerLight8 );
|
||||||
|
|
||||||
transfer_value( m_lightElevation1, cfg->m_Render.raytrace_lightElevation[0] );
|
transfer_value( m_lightElevation1, aCfg->m_Render.raytrace_lightElevation[0] );
|
||||||
transfer_value( m_lightElevation2, cfg->m_Render.raytrace_lightElevation[1] );
|
transfer_value( m_lightElevation2, aCfg->m_Render.raytrace_lightElevation[1] );
|
||||||
transfer_value( m_lightElevation3, cfg->m_Render.raytrace_lightElevation[2] );
|
transfer_value( m_lightElevation3, aCfg->m_Render.raytrace_lightElevation[2] );
|
||||||
transfer_value( m_lightElevation4, cfg->m_Render.raytrace_lightElevation[3] );
|
transfer_value( m_lightElevation4, aCfg->m_Render.raytrace_lightElevation[3] );
|
||||||
transfer_value( m_lightElevation5, cfg->m_Render.raytrace_lightElevation[4] );
|
transfer_value( m_lightElevation5, aCfg->m_Render.raytrace_lightElevation[4] );
|
||||||
transfer_value( m_lightElevation6, cfg->m_Render.raytrace_lightElevation[5] );
|
transfer_value( m_lightElevation6, aCfg->m_Render.raytrace_lightElevation[5] );
|
||||||
transfer_value( m_lightElevation7, cfg->m_Render.raytrace_lightElevation[6] );
|
transfer_value( m_lightElevation7, aCfg->m_Render.raytrace_lightElevation[6] );
|
||||||
transfer_value( m_lightElevation8, cfg->m_Render.raytrace_lightElevation[7] );
|
transfer_value( m_lightElevation8, aCfg->m_Render.raytrace_lightElevation[7] );
|
||||||
|
|
||||||
transfer_value( m_lightAzimuth1, cfg->m_Render.raytrace_lightAzimuth[0] );
|
transfer_value( m_lightAzimuth1, aCfg->m_Render.raytrace_lightAzimuth[0] );
|
||||||
transfer_value( m_lightAzimuth2, cfg->m_Render.raytrace_lightAzimuth[1] );
|
transfer_value( m_lightAzimuth2, aCfg->m_Render.raytrace_lightAzimuth[1] );
|
||||||
transfer_value( m_lightAzimuth3, cfg->m_Render.raytrace_lightAzimuth[2] );
|
transfer_value( m_lightAzimuth3, aCfg->m_Render.raytrace_lightAzimuth[2] );
|
||||||
transfer_value( m_lightAzimuth4, cfg->m_Render.raytrace_lightAzimuth[3] );
|
transfer_value( m_lightAzimuth4, aCfg->m_Render.raytrace_lightAzimuth[3] );
|
||||||
transfer_value( m_lightAzimuth5, cfg->m_Render.raytrace_lightAzimuth[4] );
|
transfer_value( m_lightAzimuth5, aCfg->m_Render.raytrace_lightAzimuth[4] );
|
||||||
transfer_value( m_lightAzimuth6, cfg->m_Render.raytrace_lightAzimuth[5] );
|
transfer_value( m_lightAzimuth6, aCfg->m_Render.raytrace_lightAzimuth[5] );
|
||||||
transfer_value( m_lightAzimuth7, cfg->m_Render.raytrace_lightAzimuth[6] );
|
transfer_value( m_lightAzimuth7, aCfg->m_Render.raytrace_lightAzimuth[6] );
|
||||||
transfer_value( m_lightAzimuth8, cfg->m_Render.raytrace_lightAzimuth[7] );
|
transfer_value( m_lightAzimuth8, aCfg->m_Render.raytrace_lightAzimuth[7] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,29 +111,7 @@ bool PANEL_3D_RAYTRACING_OPTIONS::TransferDataToWindow()
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||||
|
|
||||||
m_cbRaytracing_renderShadows->SetValue( cfg->m_Render.raytrace_shadows );
|
loadSettings( cfg );
|
||||||
m_cbRaytracing_addFloor->SetValue( cfg->m_Render.raytrace_backfloor );
|
|
||||||
m_cbRaytracing_showRefractions->SetValue( cfg->m_Render.raytrace_refractions );
|
|
||||||
m_cbRaytracing_showReflections->SetValue( cfg->m_Render.raytrace_reflections );
|
|
||||||
m_cbRaytracing_postProcessing->SetValue( cfg->m_Render.raytrace_post_processing );
|
|
||||||
m_cbRaytracing_antiAliasing->SetValue( cfg->m_Render.raytrace_anti_aliasing );
|
|
||||||
m_cbRaytracing_proceduralTextures->SetValue( cfg->m_Render.raytrace_procedural_textures );
|
|
||||||
|
|
||||||
m_numSamples_Shadows->SetValue( cfg->m_Render.raytrace_nrsamples_shadows );
|
|
||||||
m_numSamples_Reflections->SetValue( cfg->m_Render.raytrace_nrsamples_reflections );
|
|
||||||
m_numSamples_Refractions->SetValue( cfg->m_Render.raytrace_nrsamples_refractions );
|
|
||||||
|
|
||||||
m_spreadFactor_Shadows->SetValue( StringFromValue( EDA_UNITS::PERCENT,
|
|
||||||
cfg->m_Render.raytrace_spread_shadows * 100.0f ) );
|
|
||||||
m_spreadFactor_Reflections->SetValue( StringFromValue( EDA_UNITS::PERCENT,
|
|
||||||
cfg->m_Render.raytrace_spread_reflections * 100.0f ) );
|
|
||||||
m_spreadFactor_Refractions->SetValue( StringFromValue( EDA_UNITS::PERCENT,
|
|
||||||
cfg->m_Render.raytrace_spread_refractions * 100.0f ) );
|
|
||||||
|
|
||||||
m_recursiveLevel_Reflections->SetValue( cfg->m_Render.raytrace_recursivelevel_reflections );
|
|
||||||
m_recursiveLevel_Refractions->SetValue( cfg->m_Render.raytrace_recursivelevel_refractions );
|
|
||||||
|
|
||||||
TransferColorDataToWindow();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -215,3 +183,12 @@ bool PANEL_3D_RAYTRACING_OPTIONS::TransferDataFromWindow()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_3D_RAYTRACING_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
EDA_3D_VIEWER_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadSettings( &cfg );
|
||||||
|
}
|
|
@ -33,15 +33,13 @@ class PANEL_3D_RAYTRACING_OPTIONS : public PANEL_3D_RAYTRACING_OPTIONS_BASE
|
||||||
public:
|
public:
|
||||||
explicit PANEL_3D_RAYTRACING_OPTIONS( wxWindow* aParent );
|
explicit PANEL_3D_RAYTRACING_OPTIONS( wxWindow* aParent );
|
||||||
|
|
||||||
void ResetPanel() override;
|
|
||||||
|
|
||||||
/// Automatically called when clicking on the OK button
|
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
/// Automatically called after creating the dialog
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
void TransferColorDataToWindow();
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
|
||||||
expand.push_back( book->GetPageCount() );
|
expand.push_back( book->GetPageCount() );
|
||||||
|
|
||||||
book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) );
|
book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SYM_DISPLAY_OPTIONS ), _( "Display Options" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SYM_DISP_OPTIONS ), _( "Display Options" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SYM_EDIT_OPTIONS ), _( "Editing Options" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SYM_EDIT_OPTIONS ), _( "Editing Options" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SYM_COLORS ), _( "Colors" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SYM_COLORS ), _( "Colors" ) );
|
||||||
|
|
||||||
|
@ -1032,7 +1032,7 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
|
||||||
expand.push_back( book->GetPageCount() );
|
expand.push_back( book->GetPageCount() );
|
||||||
|
|
||||||
book->AddPage( new wxPanel( book ), _( "Schematic Editor" ) );
|
book->AddPage( new wxPanel( book ), _( "Schematic Editor" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SCH_DISPLAY_OPTIONS ), _( "Display Options" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SCH_DISP_OPTIONS ), _( "Display Options" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SCH_EDIT_OPTIONS ), _( "Editing Options" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SCH_EDIT_OPTIONS ), _( "Editing Options" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SCH_COLORS ), _( "Colors" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SCH_COLORS ), _( "Colors" ) );
|
||||||
book->AddSubPage( CREATE_PANEL( PANEL_SCH_FIELD_NAME_TEMPLATES ), _( "Field Name Templates" ) );
|
book->AddSubPage( CREATE_PANEL( PANEL_SCH_FIELD_NAME_TEMPLATES ), _( "Field Name Templates" ) );
|
||||||
|
|
|
@ -253,3 +253,17 @@ bool GAL_OPTIONS_PANEL::TransferDataFromWindow()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool GAL_OPTIONS_PANEL::ResetPanel( APP_SETTINGS_BASE* aAppSettings )
|
||||||
|
{
|
||||||
|
APP_SETTINGS_BASE* saved = m_cfg;
|
||||||
|
|
||||||
|
m_cfg = aAppSettings;
|
||||||
|
TransferDataToWindow();
|
||||||
|
m_cfg = saved;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -364,11 +364,15 @@ void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
|
||||||
// Enable the reset button only if the page is re-settable
|
// Enable the reset button only if the page is re-settable
|
||||||
if( m_resetButton )
|
if( m_resetButton )
|
||||||
{
|
{
|
||||||
if( auto panel = dynamic_cast<RESETTABLE_PANEL*>( m_treebook->GetPage( page ) ) )
|
// NB: dynamic_cast doesn't work over Kiway.
|
||||||
|
wxWindow* panel = m_treebook->GetPage( page );
|
||||||
|
|
||||||
|
if( panel && panel->GetWindowStyle() & wxRESETTABLE )
|
||||||
{
|
{
|
||||||
m_resetButton->SetLabel( wxString::Format( _( "Reset %s to Defaults" ),
|
m_resetButton->SetLabel( wxString::Format( _( "Reset %s to Defaults" ),
|
||||||
m_treebook->GetPageText( page ) ) );
|
m_treebook->GetPageText( page ) ) );
|
||||||
m_resetButton->SetToolTip( panel->GetResetTooltip() );
|
m_resetButton->SetToolTip( panel->GetHelpTextAtPoint( wxPoint( -INT_MAX, INT_MAX ),
|
||||||
|
wxHelpEvent::Origin_Unknown ) );
|
||||||
m_resetButton->Enable( true );
|
m_resetButton->Enable( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -378,6 +382,7 @@ void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
|
||||||
m_resetButton->Enable( false );
|
m_resetButton->Enable( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_resetButton->GetParent()->Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work around an OSX bug where the wxGrid children don't get placed correctly until
|
// Work around an OSX bug where the wxGrid children don't get placed correctly until
|
||||||
|
@ -403,8 +408,12 @@ void PAGED_DIALOG::OnResetButton( wxCommandEvent& aEvent )
|
||||||
if( sel == wxNOT_FOUND )
|
if( sel == wxNOT_FOUND )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RESETTABLE_PANEL* panel = dynamic_cast<RESETTABLE_PANEL*>( m_treebook->GetPage( sel ) );
|
// NB: dynamic_cast doesn't work over Kiway
|
||||||
|
wxWindow* panel = m_treebook->GetPage( sel );
|
||||||
|
|
||||||
if( panel )
|
if( panel )
|
||||||
panel->ResetPanel();
|
{
|
||||||
|
wxCommandEvent resetCommand( wxEVT_COMMAND_BUTTON_CLICKED, ID_RESET_PANEL );
|
||||||
|
panel->ProcessWindowEvent( resetCommand );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,7 @@ set( EESCHEMA_DLGS
|
||||||
dialogs/panel_setup_formatting_base.cpp
|
dialogs/panel_setup_formatting_base.cpp
|
||||||
dialogs/panel_setup_pinmap.cpp
|
dialogs/panel_setup_pinmap.cpp
|
||||||
dialogs/panel_setup_pinmap_base.cpp
|
dialogs/panel_setup_pinmap_base.cpp
|
||||||
|
dialogs/panel_sym_display_options.cpp
|
||||||
dialogs/panel_sym_editing_options.cpp
|
dialogs/panel_sym_editing_options.cpp
|
||||||
dialogs/panel_sym_editing_options_base.cpp
|
dialogs/panel_sym_editing_options_base.cpp
|
||||||
dialogs/panel_sym_color_settings.cpp
|
dialogs/panel_sym_color_settings.cpp
|
||||||
|
|
|
@ -41,11 +41,8 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( wxWindow* aParen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
|
void PANEL_EESCHEMA_DISPLAY_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* cfg )
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
|
||||||
EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
|
|
||||||
|
|
||||||
m_checkShowHiddenPins->SetValue( cfg->m_Appearance.show_hidden_pins );
|
m_checkShowHiddenPins->SetValue( cfg->m_Appearance.show_hidden_pins );
|
||||||
m_checkShowHiddenFields->SetValue( cfg->m_Appearance.show_hidden_fields );
|
m_checkShowHiddenFields->SetValue( cfg->m_Appearance.show_hidden_fields );
|
||||||
m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
|
m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
|
||||||
|
@ -59,6 +56,15 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
m_checkCrossProbeCenter->SetValue( cfg->m_CrossProbing.center_on_items );
|
m_checkCrossProbeCenter->SetValue( cfg->m_CrossProbing.center_on_items );
|
||||||
m_checkCrossProbeZoom->SetValue( cfg->m_CrossProbing.zoom_to_fit );
|
m_checkCrossProbeZoom->SetValue( cfg->m_CrossProbing.zoom_to_fit );
|
||||||
m_checkCrossProbeAutoHighlight->SetValue( cfg->m_CrossProbing.auto_highlight );
|
m_checkCrossProbeAutoHighlight->SetValue( cfg->m_CrossProbing.auto_highlight );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
|
EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
|
loadEEschemaSettings( cfg );
|
||||||
|
|
||||||
m_galOptsPanel->TransferDataToWindow();
|
m_galOptsPanel->TransferDataToWindow();
|
||||||
|
|
||||||
|
@ -91,3 +97,14 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_EESCHEMA_DISPLAY_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
EESCHEMA_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadEEschemaSettings( &cfg );
|
||||||
|
|
||||||
|
m_galOptsPanel->ResetPanel( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
class APP_SETTINGS_BASE;
|
class APP_SETTINGS_BASE;
|
||||||
class GAL_OPTIONS_PANEL;
|
class GAL_OPTIONS_PANEL;
|
||||||
|
class EESCHEMA_SETTINGS;
|
||||||
|
|
||||||
|
|
||||||
class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE
|
class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE
|
||||||
|
@ -31,10 +32,15 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BAS
|
||||||
public:
|
public:
|
||||||
PANEL_EESCHEMA_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings );
|
PANEL_EESCHEMA_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings );
|
||||||
|
|
||||||
private:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadEEschemaSettings( EESCHEMA_SETTINGS* aCfg );
|
||||||
|
|
||||||
|
private:
|
||||||
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bPanelSizer;
|
wxBoxSizer* bPanelSizer;
|
||||||
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE</property>
|
<property name="name">PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
@ -28,7 +29,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE
|
/// Class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel
|
class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -47,36 +47,43 @@ PANEL_EESCHEMA_EDITING_OPTIONS::PANEL_EESCHEMA_EDITING_OPTIONS( wxWindow* aWindo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
m_hPitch.SetValue( Mils2iu( aCfg->m_Drawing.default_repeat_offset_x ) );
|
||||||
|
m_vPitch.SetValue( Mils2iu( aCfg->m_Drawing.default_repeat_offset_y ) );
|
||||||
|
m_spinLabelRepeatStep->SetValue( aCfg->m_Drawing.repeat_label_increment );
|
||||||
|
|
||||||
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
|
COLOR_SETTINGS* settings = mgr.GetColorSettings();
|
||||||
|
COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
||||||
|
|
||||||
|
m_borderColorSwatch->SetSwatchBackground( schematicBackground );
|
||||||
|
m_borderColorSwatch->SetSwatchColor( aCfg->m_Drawing.default_sheet_border_color, false );
|
||||||
|
|
||||||
|
m_backgroundColorSwatch->SetSwatchBackground( schematicBackground );
|
||||||
|
m_backgroundColorSwatch->SetSwatchColor( aCfg->m_Drawing.default_sheet_background_color, false );
|
||||||
|
|
||||||
|
m_checkHVOrientation->SetValue( aCfg->m_Drawing.hv_lines_only );
|
||||||
|
m_footprintPreview->SetValue( aCfg->m_Appearance.footprint_preview );
|
||||||
|
m_navigatorStaysOpen->SetValue( aCfg->m_Appearance.navigator_stays_open );
|
||||||
|
|
||||||
|
m_checkAutoplaceFields->SetValue( aCfg->m_AutoplaceFields.enable );
|
||||||
|
m_checkAutoplaceJustify->SetValue( aCfg->m_AutoplaceFields.allow_rejustify );
|
||||||
|
m_checkAutoplaceAlign->SetValue( aCfg->m_AutoplaceFields.align_to_grid );
|
||||||
|
|
||||||
|
m_mouseDragIsDrag->SetValue( !aCfg->m_Input.drag_is_move );
|
||||||
|
m_cbPinSelectionOpt->SetValue( aCfg->m_Selection.select_pin_selects_symbol );
|
||||||
|
|
||||||
|
m_cbAutoStartWires->SetValue( aCfg->m_Drawing.auto_start_wires );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow()
|
bool PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
|
EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
m_hPitch.SetValue( Mils2iu( cfg->m_Drawing.default_repeat_offset_x ) );
|
loadEEschemaSettings( cfg );
|
||||||
m_vPitch.SetValue( Mils2iu( cfg->m_Drawing.default_repeat_offset_y ) );
|
|
||||||
m_spinLabelRepeatStep->SetValue( cfg->m_Drawing.repeat_label_increment );
|
|
||||||
|
|
||||||
COLOR_SETTINGS* settings = mgr.GetColorSettings();
|
|
||||||
COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
|
||||||
|
|
||||||
m_borderColorSwatch->SetSwatchBackground( schematicBackground );
|
|
||||||
m_borderColorSwatch->SetSwatchColor( cfg->m_Drawing.default_sheet_border_color, false );
|
|
||||||
|
|
||||||
m_backgroundColorSwatch->SetSwatchBackground( schematicBackground );
|
|
||||||
m_backgroundColorSwatch->SetSwatchColor( cfg->m_Drawing.default_sheet_background_color, false );
|
|
||||||
|
|
||||||
m_checkHVOrientation->SetValue( cfg->m_Drawing.hv_lines_only );
|
|
||||||
m_footprintPreview->SetValue( cfg->m_Appearance.footprint_preview );
|
|
||||||
m_navigatorStaysOpen->SetValue( cfg->m_Appearance.navigator_stays_open );
|
|
||||||
|
|
||||||
m_checkAutoplaceFields->SetValue( cfg->m_AutoplaceFields.enable );
|
|
||||||
m_checkAutoplaceJustify->SetValue( cfg->m_AutoplaceFields.allow_rejustify );
|
|
||||||
m_checkAutoplaceAlign->SetValue( cfg->m_AutoplaceFields.align_to_grid );
|
|
||||||
|
|
||||||
m_mouseDragIsDrag->SetValue( !cfg->m_Input.drag_is_move );
|
|
||||||
m_cbPinSelectionOpt->SetValue( cfg->m_Selection.select_pin_selects_symbol );
|
|
||||||
|
|
||||||
m_cbAutoStartWires->SetValue( cfg->m_Drawing.auto_start_wires );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -111,3 +118,12 @@ bool PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_EESCHEMA_EDITING_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
EESCHEMA_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadEEschemaSettings( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,15 @@ class PANEL_EESCHEMA_EDITING_OPTIONS : public PANEL_EESCHEMA_EDITING_OPTIONS_BAS
|
||||||
public:
|
public:
|
||||||
PANEL_EESCHEMA_EDITING_OPTIONS( wxWindow* aWindow, EDA_BASE_FRAME* aUnitsProvider );
|
PANEL_EESCHEMA_EDITING_OPTIONS( wxWindow* aWindow, EDA_BASE_FRAME* aUnitsProvider );
|
||||||
|
|
||||||
private:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadEEschemaSettings( EESCHEMA_SETTINGS* aCfg );
|
||||||
|
|
||||||
|
private:
|
||||||
UNIT_BINDER m_hPitch;
|
UNIT_BINDER m_hPitch;
|
||||||
UNIT_BINDER m_vPitch;
|
UNIT_BINDER m_vPitch;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_EESCHEMA_EDITING_OPTIONS_BASE::PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_EESCHEMA_EDITING_OPTIONS_BASE::PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bPanelSizer;
|
wxBoxSizer* bPanelSizer;
|
||||||
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_EESCHEMA_EDITING_OPTIONS_BASE</property>
|
<property name="name">PANEL_EESCHEMA_EDITING_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
#include "widgets/color_swatch.h"
|
#include "widgets/color_swatch.h"
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_EESCHEMA_EDITING_OPTIONS_BASE
|
/// Class PANEL_EESCHEMA_EDITING_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_EESCHEMA_EDITING_OPTIONS_BASE : public wxPanel
|
class PANEL_EESCHEMA_EDITING_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <settings/settings_manager.h>
|
||||||
|
#include <symbol_editor_settings.h>
|
||||||
|
#include <panel_sym_display_options.h>
|
||||||
|
#include <widgets/gal_options_panel.h>
|
||||||
|
#include <widgets/ui_common.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
|
||||||
|
|
||||||
|
PANEL_SYM_DISPLAY_OPTIONS::PANEL_SYM_DISPLAY_OPTIONS( wxWindow* aParent,
|
||||||
|
APP_SETTINGS_BASE* aAppSettings ) :
|
||||||
|
RESETTABLE_PANEL( aParent )
|
||||||
|
{
|
||||||
|
wxBoxSizer* bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
wxBoxSizer* bLeftCol = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_galOptsPanel = new GAL_OPTIONS_PANEL( this, aAppSettings );
|
||||||
|
bLeftCol->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
|
||||||
|
|
||||||
|
bPanelSizer->Add( bLeftCol, 1, wxEXPAND, 0 );
|
||||||
|
bPanelSizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
this->SetSizer( bPanelSizer );
|
||||||
|
this->Layout();
|
||||||
|
bPanelSizer->Fit( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_SYM_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
m_galOptsPanel->TransferDataToWindow();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_SYM_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
|
{
|
||||||
|
m_galOptsPanel->TransferDataFromWindow();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_SYM_DISPLAY_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
SYMBOL_EDITOR_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
m_galOptsPanel->ResetPanel( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PANEL_SYM_DISPLAY_OPTIONS_H
|
||||||
|
#define PANEL_SYM_DISPLAY_OPTIONS_H
|
||||||
|
|
||||||
|
#include <widgets/resettable_panel.h>
|
||||||
|
|
||||||
|
|
||||||
|
class APP_SETTINGS_BASE;
|
||||||
|
class GAL_OPTIONS_PANEL;
|
||||||
|
|
||||||
|
|
||||||
|
class PANEL_SYM_DISPLAY_OPTIONS : public RESETTABLE_PANEL
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PANEL_SYM_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings );
|
||||||
|
|
||||||
|
bool TransferDataToWindow() override;
|
||||||
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // PANEL_SYM_DISPLAY_OPTIONS_H
|
|
@ -39,19 +39,25 @@ PANEL_SYM_EDITING_OPTIONS::PANEL_SYM_EDITING_OPTIONS( wxWindow* aWindow,
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_SYM_EDITING_OPTIONS::loadSymEditorSettings( SYMBOL_EDITOR_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
m_lineWidth.SetValue( Mils2iu( aCfg->m_Defaults.line_width ) );
|
||||||
|
m_textSize.SetValue( Mils2iu( aCfg->m_Defaults.text_size ) );
|
||||||
|
m_pinLength.SetValue( Mils2iu( aCfg->m_Defaults.pin_length ) );
|
||||||
|
m_pinNumberSize.SetValue( Mils2iu( aCfg->m_Defaults.pin_num_size ) );
|
||||||
|
m_pinNameSize.SetValue( Mils2iu( aCfg->m_Defaults.pin_name_size ) );
|
||||||
|
m_choicePinDisplacement->SetSelection( aCfg->m_Repeat.pin_step == 50 ? 1 : 0 );
|
||||||
|
m_spinRepeatLabel->SetValue( aCfg->m_Repeat.label_delta );
|
||||||
|
m_cbShowPinElectricalType->SetValue( aCfg->m_ShowPinElectricalType );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_SYM_EDITING_OPTIONS::TransferDataToWindow()
|
bool PANEL_SYM_EDITING_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
SYMBOL_EDITOR_SETTINGS* settings = mgr.GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
|
SYMBOL_EDITOR_SETTINGS* settings = mgr.GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
|
||||||
|
|
||||||
m_lineWidth.SetValue( Mils2iu( settings->m_Defaults.line_width ) );
|
loadSymEditorSettings( settings );
|
||||||
m_textSize.SetValue( Mils2iu( settings->m_Defaults.text_size ) );
|
|
||||||
m_pinLength.SetValue( Mils2iu( settings->m_Defaults.pin_length ) );
|
|
||||||
m_pinNumberSize.SetValue( Mils2iu( settings->m_Defaults.pin_num_size ) );
|
|
||||||
m_pinNameSize.SetValue( Mils2iu( settings->m_Defaults.pin_name_size ) );
|
|
||||||
m_choicePinDisplacement->SetSelection( settings->m_Repeat.pin_step == 50 ? 1 : 0 );
|
|
||||||
m_spinRepeatLabel->SetValue( settings->m_Repeat.label_delta );
|
|
||||||
m_cbShowPinElectricalType->SetValue( settings->m_ShowPinElectricalType );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -75,3 +81,12 @@ bool PANEL_SYM_EDITING_OPTIONS::TransferDataFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_SYM_EDITING_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
SYMBOL_EDITOR_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadSymEditorSettings( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,15 @@ class PANEL_SYM_EDITING_OPTIONS : public PANEL_SYM_EDITING_OPTIONS_BASE
|
||||||
public:
|
public:
|
||||||
PANEL_SYM_EDITING_OPTIONS( wxWindow* aWindow, EDA_BASE_FRAME* aUnitsProvider );
|
PANEL_SYM_EDITING_OPTIONS( wxWindow* aWindow, EDA_BASE_FRAME* aUnitsProvider );
|
||||||
|
|
||||||
private:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadSymEditorSettings( SYMBOL_EDITOR_SETTINGS* aCfg );
|
||||||
|
|
||||||
|
private:
|
||||||
UNIT_BINDER m_lineWidth;
|
UNIT_BINDER m_lineWidth;
|
||||||
UNIT_BINDER m_textSize;
|
UNIT_BINDER m_textSize;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_SYM_EDITING_OPTIONS_BASE::PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_SYM_EDITING_OPTIONS_BASE::PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* p1mainSizer;
|
wxBoxSizer* p1mainSizer;
|
||||||
p1mainSizer = new wxBoxSizer( wxHORIZONTAL );
|
p1mainSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_SYM_EDITING_OPTIONS_BASE</property>
|
<property name="name">PANEL_SYM_EDITING_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -30,7 +31,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_SYM_EDITING_OPTIONS_BASE
|
/// Class PANEL_SYM_EDITING_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_SYM_EDITING_OPTIONS_BASE : public wxPanel
|
class PANEL_SYM_EDITING_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
#include <panel_sym_editing_options.h>
|
#include <panel_sym_editing_options.h>
|
||||||
#include <dialogs/panel_gal_display_options.h>
|
#include <dialogs/panel_gal_display_options.h>
|
||||||
#include <panel_eeschema_display_options.h>
|
#include <panel_eeschema_display_options.h>
|
||||||
|
#include <panel_sym_display_options.h>
|
||||||
|
|
||||||
// The main sheet of the project
|
// The main sheet of the project
|
||||||
SCH_SHEET* g_RootSheet = nullptr;
|
SCH_SHEET* g_RootSheet = nullptr;
|
||||||
|
@ -175,12 +176,12 @@ static struct IFACE : public KIFACE_BASE
|
||||||
// Dialog has completed; nothing to return.
|
// Dialog has completed; nothing to return.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
case PANEL_SYM_DISPLAY_OPTIONS:
|
case PANEL_SYM_DISP_OPTIONS:
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
|
APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
|
||||||
|
|
||||||
return new PANEL_GAL_DISPLAY_OPTIONS( aParent, cfg );
|
return new PANEL_SYM_DISPLAY_OPTIONS( aParent, cfg );
|
||||||
}
|
}
|
||||||
|
|
||||||
case PANEL_SYM_EDIT_OPTIONS:
|
case PANEL_SYM_EDIT_OPTIONS:
|
||||||
|
@ -213,7 +214,7 @@ static struct IFACE : public KIFACE_BASE
|
||||||
case PANEL_SYM_COLORS:
|
case PANEL_SYM_COLORS:
|
||||||
return new PANEL_SYM_COLOR_SETTINGS( aParent );
|
return new PANEL_SYM_COLOR_SETTINGS( aParent );
|
||||||
|
|
||||||
case PANEL_SCH_DISPLAY_OPTIONS:
|
case PANEL_SCH_DISP_OPTIONS:
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
|
APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
|
* Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@ -50,30 +50,36 @@ PANEL_GERBVIEW_DISPLAY_OPTIONS::PANEL_GERBVIEW_DISPLAY_OPTIONS( wxWindow* aParen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow( )
|
void PANEL_GERBVIEW_DISPLAY_OPTIONS::loadSettings( GERBVIEW_SETTINGS* aCfg )
|
||||||
{
|
{
|
||||||
m_galOptsPanel->TransferDataToWindow();
|
|
||||||
|
|
||||||
GERBVIEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
|
|
||||||
|
|
||||||
// Show Option Draw polygons
|
// Show Option Draw polygons
|
||||||
m_OptDisplayPolygons->SetValue( !cfg->m_Display.m_DisplayPolygonsFill );
|
m_OptDisplayPolygons->SetValue( !aCfg->m_Display.m_DisplayPolygonsFill );
|
||||||
|
|
||||||
// Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
|
// Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
|
||||||
m_OptDisplayLines->SetValue( !cfg->m_Display.m_DisplayLinesFill );
|
m_OptDisplayLines->SetValue( !aCfg->m_Display.m_DisplayLinesFill );
|
||||||
m_OptDisplayFlashedItems->SetValue( !cfg->m_Display.m_DisplayFlashedItemsFill );
|
m_OptDisplayFlashedItems->SetValue( !aCfg->m_Display.m_DisplayFlashedItemsFill );
|
||||||
m_OptDisplayDCodes->SetValue( cfg->m_Appearance.show_dcodes );
|
m_OptDisplayDCodes->SetValue( aCfg->m_Appearance.show_dcodes );
|
||||||
|
|
||||||
for( unsigned i = 0; i < arrayDim( gerberPageSizeList ); ++i )
|
for( unsigned i = 0; i < arrayDim( gerberPageSizeList ); ++i )
|
||||||
{
|
{
|
||||||
if( gerberPageSizeList[i] == cfg->m_Appearance.page_type )
|
if( gerberPageSizeList[i] == aCfg->m_Appearance.page_type )
|
||||||
{
|
{
|
||||||
m_PageSize->SetSelection( i );
|
m_PageSize->SetSelection( i );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ShowPageLimitsOpt->SetValue( cfg->m_Display.m_DisplayPageLimits );
|
m_ShowPageLimitsOpt->SetValue( aCfg->m_Display.m_DisplayPageLimits );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
m_galOptsPanel->TransferDataToWindow();
|
||||||
|
|
||||||
|
GERBVIEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
|
||||||
|
|
||||||
|
loadSettings( cfg );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -96,3 +102,15 @@ bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_GERBVIEW_DISPLAY_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
GERBVIEW_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadSettings( &cfg );
|
||||||
|
|
||||||
|
m_galOptsPanel->ResetPanel( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,15 @@ public:
|
||||||
PANEL_GERBVIEW_DISPLAY_OPTIONS( wxWindow* aParent );
|
PANEL_GERBVIEW_DISPLAY_OPTIONS( wxWindow* aParent );
|
||||||
~PANEL_GERBVIEW_DISPLAY_OPTIONS() {};
|
~PANEL_GERBVIEW_DISPLAY_OPTIONS() {};
|
||||||
|
|
||||||
private:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadSettings( GERBVIEW_SETTINGS* aCfg );
|
||||||
|
|
||||||
|
private:
|
||||||
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bDialogSizer;
|
wxBoxSizer* bDialogSizer;
|
||||||
bDialogSizer = new wxBoxSizer( wxVERTICAL );
|
bDialogSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE</property>
|
<property name="name">PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE
|
/// Class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE : public wxPanel
|
class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
|
|
||||||
virtual void ResetPanel() override;
|
virtual void ResetPanel() override;
|
||||||
|
|
||||||
virtual wxString GetResetTooltip() override
|
virtual wxString GetResetTooltip() const override
|
||||||
{
|
{
|
||||||
return _( "Reset all colors in this theme to the KiCad defaults" );
|
return _( "Reset all colors in this theme to the KiCad defaults" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,11 +65,11 @@ enum FRAME_T
|
||||||
|
|
||||||
FRAME_T_COUNT,
|
FRAME_T_COUNT,
|
||||||
|
|
||||||
PANEL_SYM_DISPLAY_OPTIONS = FRAME_T_COUNT,
|
PANEL_SYM_DISP_OPTIONS = FRAME_T_COUNT,
|
||||||
PANEL_SYM_EDIT_OPTIONS,
|
PANEL_SYM_EDIT_OPTIONS,
|
||||||
PANEL_SYM_COLORS,
|
PANEL_SYM_COLORS,
|
||||||
|
|
||||||
PANEL_SCH_DISPLAY_OPTIONS,
|
PANEL_SCH_DISP_OPTIONS,
|
||||||
PANEL_SCH_EDIT_OPTIONS,
|
PANEL_SCH_EDIT_OPTIONS,
|
||||||
PANEL_SCH_COLORS,
|
PANEL_SCH_COLORS,
|
||||||
PANEL_SCH_FIELD_NAME_TEMPLATES,
|
PANEL_SCH_FIELD_NAME_TEMPLATES,
|
||||||
|
|
|
@ -90,6 +90,7 @@ enum main_id
|
||||||
|
|
||||||
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
||||||
ID_PREFERENCES_CONFIGURE_PATHS,
|
ID_PREFERENCES_CONFIGURE_PATHS,
|
||||||
|
ID_PREFERENCES_RESET_PANEL,
|
||||||
ID_EDIT_SYMBOL_LIBRARY_TABLE,
|
ID_EDIT_SYMBOL_LIBRARY_TABLE,
|
||||||
ID_EDIT_FOOTPRINT_LIBRARY_TABLE,
|
ID_EDIT_FOOTPRINT_LIBRARY_TABLE,
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
|
|
||||||
void ResetPanel() override;
|
void ResetPanel() override;
|
||||||
|
|
||||||
wxString GetResetTooltip() override
|
wxString GetResetTooltip() const override
|
||||||
{
|
{
|
||||||
return _( "Reset all hotkeys to the built-in KiCad defaults" );
|
return _( "Reset all hotkeys to the built-in KiCad defaults" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,8 @@ public:
|
||||||
*/
|
*/
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
bool ResetPanel( APP_SETTINGS_BASE* aAppSettings );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxBoxSizer* m_mainSizer;
|
wxBoxSizer* m_mainSizer;
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,13 @@
|
||||||
#define RESETTABLE_PANEL_H_
|
#define RESETTABLE_PANEL_H_
|
||||||
|
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
|
#include <id.h>
|
||||||
|
|
||||||
class PAGED_DIALOG;
|
class PAGED_DIALOG;
|
||||||
|
|
||||||
|
#define wxRESETTABLE 0x00008000
|
||||||
|
#define ID_RESET_PANEL ID_PREFERENCES_RESET_PANEL
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wxPanel that is designed to be reset in a standard manner.
|
* A wxPanel that is designed to be reset in a standard manner.
|
||||||
*/
|
*/
|
||||||
|
@ -35,8 +39,16 @@ public:
|
||||||
const wxSize& aSize = wxSize( -1,-1 ),
|
const wxSize& aSize = wxSize( -1,-1 ),
|
||||||
long aStyle = wxTAB_TRAVERSAL,
|
long aStyle = wxTAB_TRAVERSAL,
|
||||||
const wxString& aName = wxEmptyString )
|
const wxString& aName = wxEmptyString )
|
||||||
: wxPanel( aParent, aId, aPos, aSize, aStyle, aName )
|
: wxPanel( aParent, aId, aPos, aSize, aStyle | wxRESETTABLE, aName )
|
||||||
{
|
{
|
||||||
|
Bind( wxEVT_COMMAND_BUTTON_CLICKED,
|
||||||
|
[&]( wxCommandEvent& aCmd )
|
||||||
|
{
|
||||||
|
if( aCmd.GetId() == ID_RESET_PANEL )
|
||||||
|
ResetPanel();
|
||||||
|
else
|
||||||
|
aCmd.Skip();
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,10 +61,21 @@ public:
|
||||||
*
|
*
|
||||||
* @return the tooltip
|
* @return the tooltip
|
||||||
*/
|
*/
|
||||||
virtual wxString GetResetTooltip()
|
virtual wxString GetResetTooltip() const
|
||||||
{
|
{
|
||||||
return _( "Reset all settings on this page to their default" );
|
return _( "Reset all settings on this page to their default" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.
|
||||||
|
*/
|
||||||
|
wxString GetHelpTextAtPoint( const wxPoint& aPt, wxHelpEvent::Origin aOrigin ) const override
|
||||||
|
{
|
||||||
|
if( aPt == wxPoint( -INT_MAX, INT_MAX ) )
|
||||||
|
return GetResetTooltip();
|
||||||
|
else
|
||||||
|
return wxPanel::GetHelpTextAtPoint( aPt, aOrigin );
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,6 +22,7 @@ set( DIALOGS_SRCS
|
||||||
dialogs/design_inspector.cpp
|
dialogs/design_inspector.cpp
|
||||||
dialogs/panel_pl_editor_color_settings.cpp
|
dialogs/panel_pl_editor_color_settings.cpp
|
||||||
dialogs/panel_pl_editor_color_settings_base.cpp
|
dialogs/panel_pl_editor_color_settings_base.cpp
|
||||||
|
dialogs/panel_pl_editor_display_options.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( PL_EDITOR_SRCS
|
set( PL_EDITOR_SRCS
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@ -70,4 +70,12 @@ bool PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataFromWindow()
|
||||||
cfg->m_ColorTheme = colors->GetFilename();
|
cfg->m_ColorTheme = colors->GetFilename();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_PL_EDITOR_COLOR_SETTINGS::ResetPanel()
|
||||||
|
{
|
||||||
|
m_themes->SetStringSelection( _( "KiCad Default" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@ -28,10 +28,10 @@ class PANEL_PL_EDITOR_COLOR_SETTINGS : public PANEL_PL_EDITOR_COLOR_SETTINGS_BAS
|
||||||
public:
|
public:
|
||||||
PANEL_PL_EDITOR_COLOR_SETTINGS( wxWindow* aParent );
|
PANEL_PL_EDITOR_COLOR_SETTINGS( wxWindow* aParent );
|
||||||
|
|
||||||
private:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_PL_EDITOR_COLOR_SETTINGS_BASE::PANEL_PL_EDITOR_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_PL_EDITOR_COLOR_SETTINGS_BASE::PANEL_PL_EDITOR_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* p1mainSizer;
|
wxBoxSizer* p1mainSizer;
|
||||||
p1mainSizer = new wxBoxSizer( wxHORIZONTAL );
|
p1mainSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_PL_EDITOR_COLOR_SETTINGS_BASE</property>
|
<property name="name">PANEL_PL_EDITOR_COLOR_SETTINGS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_PL_EDITOR_COLOR_SETTINGS_BASE
|
/// Class PANEL_PL_EDITOR_COLOR_SETTINGS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_PL_EDITOR_COLOR_SETTINGS_BASE : public wxPanel
|
class PANEL_PL_EDITOR_COLOR_SETTINGS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <settings/settings_manager.h>
|
||||||
|
#include <pl_editor_settings.h>
|
||||||
|
#include <panel_pl_editor_display_options.h>
|
||||||
|
#include <widgets/gal_options_panel.h>
|
||||||
|
#include <widgets/ui_common.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
|
||||||
|
|
||||||
|
PANEL_PL_EDITOR_DISPLAY_OPTIONS::PANEL_PL_EDITOR_DISPLAY_OPTIONS( wxWindow* aParent,
|
||||||
|
APP_SETTINGS_BASE* aAppSettings ) :
|
||||||
|
RESETTABLE_PANEL( aParent )
|
||||||
|
{
|
||||||
|
wxBoxSizer* bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
wxBoxSizer* bLeftCol = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
m_galOptsPanel = new GAL_OPTIONS_PANEL( this, aAppSettings );
|
||||||
|
bLeftCol->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
|
||||||
|
|
||||||
|
bPanelSizer->Add( bLeftCol, 1, wxEXPAND, 0 );
|
||||||
|
bPanelSizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
this->SetSizer( bPanelSizer );
|
||||||
|
this->Layout();
|
||||||
|
bPanelSizer->Fit( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_PL_EDITOR_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
m_galOptsPanel->TransferDataToWindow();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_PL_EDITOR_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
|
{
|
||||||
|
m_galOptsPanel->TransferDataFromWindow();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_PL_EDITOR_DISPLAY_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
PL_EDITOR_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
m_galOptsPanel->ResetPanel( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PANEL_PL_EDITOR_DISPLAY_OPTIONS_H
|
||||||
|
#define PANEL_PL_EDITOR_DISPLAY_OPTIONS_H
|
||||||
|
|
||||||
|
#include <widgets/resettable_panel.h>
|
||||||
|
|
||||||
|
|
||||||
|
class APP_SETTINGS_BASE;
|
||||||
|
class GAL_OPTIONS_PANEL;
|
||||||
|
|
||||||
|
|
||||||
|
class PANEL_PL_EDITOR_DISPLAY_OPTIONS : public RESETTABLE_PANEL
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PANEL_PL_EDITOR_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BASE* aAppSettings );
|
||||||
|
|
||||||
|
bool TransferDataToWindow() override;
|
||||||
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // PANEL_PL_EDITOR_DISPLAY_OPTIONS_H
|
|
@ -31,7 +31,7 @@
|
||||||
#include <gestfich.h>
|
#include <gestfich.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
#include <settings/settings_manager.h>
|
#include <settings/settings_manager.h>
|
||||||
#include <dialogs/panel_gal_display_options.h>
|
#include <dialogs/panel_pl_editor_display_options.h>
|
||||||
#include <dialogs/panel_pl_editor_color_settings.h>
|
#include <dialogs/panel_pl_editor_color_settings.h>
|
||||||
|
|
||||||
#include "pl_editor_frame.h"
|
#include "pl_editor_frame.h"
|
||||||
|
@ -65,7 +65,7 @@ static struct IFACE : public KIFACE_BASE
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<PL_EDITOR_SETTINGS>();
|
APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<PL_EDITOR_SETTINGS>();
|
||||||
|
|
||||||
return new PANEL_GAL_DISPLAY_OPTIONS( aParent, cfg );
|
return new PANEL_PL_EDITOR_DISPLAY_OPTIONS( aParent, cfg );
|
||||||
}
|
}
|
||||||
|
|
||||||
case PANEL_DS_COLORS:
|
case PANEL_DS_COLORS:
|
||||||
|
|
|
@ -47,6 +47,22 @@ PANEL_DISPLAY_OPTIONS::PANEL_DISPLAY_OPTIONS( wxWindow* aParent, APP_SETTINGS_BA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_DISPLAY_OPTIONS::loadPCBSettings( PCBNEW_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
int i = UTIL::GetConfigForVal( clearanceModeMap, aCfg->m_Display.m_ShowTrackClearanceMode );
|
||||||
|
m_OptDisplayTracksClearance->SetSelection( i );
|
||||||
|
|
||||||
|
m_OptDisplayPadClearence->SetValue( aCfg->m_Display.m_DisplayPadClearance );
|
||||||
|
m_OptDisplayPadNumber->SetValue( aCfg->m_Display.m_DisplayPadNum );
|
||||||
|
m_OptDisplayPadNoConn->SetValue( aCfg->m_Display.m_DisplayPadNoConnects );
|
||||||
|
m_ShowNetNamesOption->SetSelection( aCfg->m_Display.m_DisplayNetNamesMode );
|
||||||
|
m_live3Drefresh->SetValue( aCfg->m_Display.m_Live3DRefresh );
|
||||||
|
m_checkCrossProbeCenter->SetValue( aCfg->m_CrossProbing.center_on_items );
|
||||||
|
m_checkCrossProbeZoom->SetValue( aCfg->m_CrossProbing.zoom_to_fit );
|
||||||
|
m_checkCrossProbeAutoHighlight->SetValue( aCfg->m_CrossProbing.auto_highlight );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_DISPLAY_OPTIONS::TransferDataToWindow()
|
bool PANEL_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
if( m_isPCBEdit )
|
if( m_isPCBEdit )
|
||||||
|
@ -54,17 +70,7 @@ bool PANEL_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
||||||
|
|
||||||
int i = UTIL::GetConfigForVal( clearanceModeMap, cfg->m_Display.m_ShowTrackClearanceMode );
|
loadPCBSettings( cfg );
|
||||||
m_OptDisplayTracksClearance->SetSelection( i );
|
|
||||||
|
|
||||||
m_OptDisplayPadClearence->SetValue( cfg->m_Display.m_DisplayPadClearance );
|
|
||||||
m_OptDisplayPadNumber->SetValue( cfg->m_Display.m_DisplayPadNum );
|
|
||||||
m_OptDisplayPadNoConn->SetValue( cfg->m_Display.m_DisplayPadNoConnects );
|
|
||||||
m_ShowNetNamesOption->SetSelection( cfg->m_Display.m_DisplayNetNamesMode );
|
|
||||||
m_live3Drefresh->SetValue( cfg->m_Display.m_Live3DRefresh );
|
|
||||||
m_checkCrossProbeCenter->SetValue( cfg->m_CrossProbing.center_on_items );
|
|
||||||
m_checkCrossProbeZoom->SetValue( cfg->m_CrossProbing.zoom_to_fit );
|
|
||||||
m_checkCrossProbeAutoHighlight->SetValue( cfg->m_CrossProbing.auto_highlight );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_galOptsPanel->TransferDataToWindow();
|
m_galOptsPanel->TransferDataToWindow();
|
||||||
|
@ -102,3 +108,15 @@ bool PANEL_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_DISPLAY_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
PCBNEW_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
if( m_isPCBEdit )
|
||||||
|
loadPCBSettings( &cfg );
|
||||||
|
|
||||||
|
m_galOptsPanel->ResetPanel( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "panel_display_options_base.h"
|
#include "panel_display_options_base.h"
|
||||||
|
|
||||||
|
class PCBNEW_SETTINGS;
|
||||||
class APP_SETTINGS_BASE;
|
class APP_SETTINGS_BASE;
|
||||||
class GAL_OPTIONS_PANEL;
|
class GAL_OPTIONS_PANEL;
|
||||||
|
|
||||||
|
@ -32,6 +33,11 @@ public:
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadPCBSettings( PCBNEW_SETTINGS* aCfg );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isPCBEdit;
|
bool m_isPCBEdit;
|
||||||
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_DISPLAY_OPTIONS_BASE::PANEL_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_DISPLAY_OPTIONS_BASE::PANEL_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bMainSizer;
|
wxBoxSizer* bMainSizer;
|
||||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_DISPLAY_OPTIONS_BASE</property>
|
<property name="name">PANEL_DISPLAY_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_DISPLAY_OPTIONS_BASE
|
/// Class PANEL_DISPLAY_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_DISPLAY_OPTIONS_BASE : public wxPanel
|
class PANEL_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,41 @@ PANEL_EDIT_OPTIONS::PANEL_EDIT_OPTIONS( wxWindow* aParent, bool isFootprintEdito
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_EDIT_OPTIONS::loadPCBSettings( PCBNEW_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
m_rotationAngle->SetValue( AngleToStringDegrees( (double) aCfg->m_RotationAngle ) );
|
||||||
|
m_magneticPadChoice->SetSelection( static_cast<int>( aCfg->m_MagneticItems.pads ) );
|
||||||
|
m_magneticTrackChoice->SetSelection( static_cast<int>( aCfg->m_MagneticItems.tracks ) );
|
||||||
|
m_magneticGraphicsChoice->SetSelection( !aCfg->m_MagneticItems.graphics );
|
||||||
|
m_flipLeftRight->SetValue( aCfg->m_FlipLeftRight );
|
||||||
|
m_cbPcbGraphic45Mode->SetValue( aCfg->m_Use45DegreeLimit );
|
||||||
|
|
||||||
|
/* Set display options */
|
||||||
|
m_OptDisplayCurvedRatsnestLines->SetValue( aCfg->m_Display.m_DisplayRatsnestLinesCurved );
|
||||||
|
m_showSelectedRatsnest->SetValue( aCfg->m_Display.m_ShowModuleRatsnest );
|
||||||
|
|
||||||
|
switch( aCfg->m_TrackDragAction )
|
||||||
|
{
|
||||||
|
case TRACK_DRAG_ACTION::MOVE: m_rbTrackDragMove->SetValue( true ); break;
|
||||||
|
case TRACK_DRAG_ACTION::DRAG: m_rbTrackDrag45->SetValue( true ); break;
|
||||||
|
case TRACK_DRAG_ACTION::DRAG_FREE_ANGLE: m_rbTrackDragFree->SetValue( true ); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_showPageLimits->SetValue( aCfg->m_ShowPageLimits );
|
||||||
|
m_autoRefillZones->SetValue( aCfg->m_AutoRefillZones );
|
||||||
|
m_allowFreePads->SetValue( aCfg->m_AllowFreePads );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_EDIT_OPTIONS::loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg )
|
||||||
|
{
|
||||||
|
m_rotationAngle->SetValue( AngleToStringDegrees( (double) aCfg->m_RotationAngle ) );
|
||||||
|
m_magneticPads->SetValue( aCfg->m_MagneticItems.pads == MAGNETIC_OPTIONS::CAPTURE_ALWAYS );
|
||||||
|
m_magneticGraphics->SetValue( aCfg->m_MagneticItems.graphics );
|
||||||
|
m_cbFpGraphic45Mode->SetValue( aCfg->m_Use45Limit );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_EDIT_OPTIONS::TransferDataToWindow()
|
bool PANEL_EDIT_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
|
@ -59,36 +94,13 @@ bool PANEL_EDIT_OPTIONS::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
FOOTPRINT_EDITOR_SETTINGS* cfg = mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
FOOTPRINT_EDITOR_SETTINGS* cfg = mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
||||||
|
|
||||||
m_rotationAngle->SetValue( AngleToStringDegrees( (double) cfg->m_RotationAngle ) );
|
loadFPSettings( cfg );
|
||||||
m_magneticPads->SetValue( cfg->m_MagneticItems.pads == MAGNETIC_OPTIONS::CAPTURE_ALWAYS );
|
|
||||||
m_magneticGraphics->SetValue( cfg->m_MagneticItems.graphics );
|
|
||||||
m_cbFpGraphic45Mode->SetValue( cfg->m_Use45Limit );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
||||||
|
|
||||||
m_rotationAngle->SetValue( AngleToStringDegrees( (double) cfg->m_RotationAngle ) );
|
loadPCBSettings( cfg );
|
||||||
m_magneticPadChoice->SetSelection( static_cast<int>( cfg->m_MagneticItems.pads ) );
|
|
||||||
m_magneticTrackChoice->SetSelection( static_cast<int>( cfg->m_MagneticItems.tracks ) );
|
|
||||||
m_magneticGraphicsChoice->SetSelection( !cfg->m_MagneticItems.graphics );
|
|
||||||
m_flipLeftRight->SetValue( cfg->m_FlipLeftRight );
|
|
||||||
m_cbPcbGraphic45Mode->SetValue( cfg->m_Use45DegreeLimit );
|
|
||||||
|
|
||||||
/* Set display options */
|
|
||||||
m_OptDisplayCurvedRatsnestLines->SetValue( cfg->m_Display.m_DisplayRatsnestLinesCurved );
|
|
||||||
m_showSelectedRatsnest->SetValue( cfg->m_Display.m_ShowModuleRatsnest );
|
|
||||||
|
|
||||||
switch( cfg->m_TrackDragAction )
|
|
||||||
{
|
|
||||||
case TRACK_DRAG_ACTION::MOVE: m_rbTrackDragMove->SetValue( true ); break;
|
|
||||||
case TRACK_DRAG_ACTION::DRAG: m_rbTrackDrag45->SetValue( true ); break;
|
|
||||||
case TRACK_DRAG_ACTION::DRAG_FREE_ANGLE: m_rbTrackDragFree->SetValue( true ); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_showPageLimits->SetValue( cfg->m_ShowPageLimits );
|
|
||||||
m_autoRefillZones->SetValue( cfg->m_AutoRefillZones );
|
|
||||||
m_allowFreePads->SetValue( cfg->m_AllowFreePads );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -143,3 +155,22 @@ bool PANEL_EDIT_OPTIONS::TransferDataFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_EDIT_OPTIONS::ResetPanel()
|
||||||
|
{
|
||||||
|
if( m_isFootprintEditor )
|
||||||
|
{
|
||||||
|
FOOTPRINT_EDITOR_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadFPSettings( &cfg );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PCBNEW_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadPCBSettings( &cfg );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,15 +28,24 @@
|
||||||
#include "panel_edit_options_base.h"
|
#include "panel_edit_options_base.h"
|
||||||
|
|
||||||
|
|
||||||
|
class FOOTPRINT_EDITOR_SETTINGS;
|
||||||
|
class PCBNEW_SETTINGS;
|
||||||
|
|
||||||
|
|
||||||
class PANEL_EDIT_OPTIONS : public PANEL_EDIT_OPTIONS_BASE
|
class PANEL_EDIT_OPTIONS : public PANEL_EDIT_OPTIONS_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_EDIT_OPTIONS( wxWindow* aParent, bool isFootprintEditor );
|
PANEL_EDIT_OPTIONS( wxWindow* aParent, bool isFootprintEditor );
|
||||||
|
|
||||||
protected:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg );
|
||||||
|
void loadPCBSettings( PCBNEW_SETTINGS* aCfg );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isFootprintEditor;
|
bool m_isFootprintEditor;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bPanelSizer;
|
wxBoxSizer* bPanelSizer;
|
||||||
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_EDIT_OPTIONS_BASE</property>
|
<property name="name">PANEL_EDIT_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_EDIT_OPTIONS_BASE
|
/// Class PANEL_EDIT_OPTIONS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_EDIT_OPTIONS_BASE : public wxPanel
|
class PANEL_EDIT_OPTIONS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ PANEL_FP_EDITOR_DEFAULTS::~PANEL_FP_EDITOR_DEFAULTS()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow()
|
void PANEL_FP_EDITOR_DEFAULTS::loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg )
|
||||||
{
|
{
|
||||||
wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
|
wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND );
|
||||||
|
|
||||||
|
@ -226,12 +226,9 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow()
|
||||||
m_graphicsGrid->SetReadOnly( row, col ); \
|
m_graphicsGrid->SetReadOnly( row, col ); \
|
||||||
m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
|
m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
|
||||||
|
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
|
||||||
FOOTPRINT_EDITOR_SETTINGS* cfg = mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
|
||||||
|
|
||||||
for( int i = 0; i < ROW_COUNT; ++i )
|
for( int i = 0; i < ROW_COUNT; ++i )
|
||||||
{
|
{
|
||||||
SET_MILS_CELL( i, COL_LINE_THICKNESS, cfg->m_DesignSettings.m_LineThickness[ i ] );
|
SET_MILS_CELL( i, COL_LINE_THICKNESS, aCfg->m_DesignSettings.m_LineThickness[ i ] );
|
||||||
|
|
||||||
if( i == ROW_EDGES || i == ROW_COURTYARD )
|
if( i == ROW_EDGES || i == ROW_COURTYARD )
|
||||||
{
|
{
|
||||||
|
@ -242,10 +239,10 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SET_MILS_CELL( i, COL_TEXT_WIDTH, cfg->m_DesignSettings.m_TextSize[ i ].x );
|
SET_MILS_CELL( i, COL_TEXT_WIDTH, aCfg->m_DesignSettings.m_TextSize[ i ].x );
|
||||||
SET_MILS_CELL( i, COL_TEXT_HEIGHT, cfg->m_DesignSettings.m_TextSize[ i ].y );
|
SET_MILS_CELL( i, COL_TEXT_HEIGHT, aCfg->m_DesignSettings.m_TextSize[ i ].y );
|
||||||
SET_MILS_CELL( i, COL_TEXT_THICKNESS, cfg->m_DesignSettings.m_TextThickness[ i ] );
|
SET_MILS_CELL( i, COL_TEXT_THICKNESS, aCfg->m_DesignSettings.m_TextThickness[ i ] );
|
||||||
m_graphicsGrid->SetCellValue( i, COL_TEXT_ITALIC, cfg->m_DesignSettings.m_TextItalic[ i ] ? "1" : "" );
|
m_graphicsGrid->SetCellValue( i, COL_TEXT_ITALIC, aCfg->m_DesignSettings.m_TextItalic[ i ] ? "1" : "" );
|
||||||
|
|
||||||
auto attr = new wxGridCellAttr;
|
auto attr = new wxGridCellAttr;
|
||||||
attr->SetRenderer( new wxGridCellBoolRenderer() );
|
attr->SetRenderer( new wxGridCellBoolRenderer() );
|
||||||
|
@ -256,11 +253,12 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Footprint defaults
|
// Footprint defaults
|
||||||
m_textItemsGrid->GetTable()->AppendRows( cfg->m_DesignSettings.m_DefaultFPTextItems.size() );
|
m_textItemsGrid->GetTable()->DeleteRows( 0, m_textItemsGrid->GetNumberRows() );
|
||||||
|
m_textItemsGrid->GetTable()->AppendRows( aCfg->m_DesignSettings.m_DefaultFPTextItems.size() );
|
||||||
|
|
||||||
for( size_t i = 0; i < cfg->m_DesignSettings.m_DefaultFPTextItems.size(); ++i )
|
for( size_t i = 0; i < aCfg->m_DesignSettings.m_DefaultFPTextItems.size(); ++i )
|
||||||
{
|
{
|
||||||
TEXT_ITEM_INFO item = cfg->m_DesignSettings.m_DefaultFPTextItems[i];
|
TEXT_ITEM_INFO item = aCfg->m_DesignSettings.m_DefaultFPTextItems[i];
|
||||||
|
|
||||||
m_textItemsGrid->GetTable()->SetValue( i, 0, item.m_Text );
|
m_textItemsGrid->GetTable()->SetValue( i, 0, item.m_Text );
|
||||||
m_textItemsGrid->GetTable()->SetValueAsBool( i, 1, item.m_Visible );
|
m_textItemsGrid->GetTable()->SetValueAsBool( i, 1, item.m_Visible );
|
||||||
|
@ -280,6 +278,15 @@ bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow()
|
||||||
m_graphicsGrid->SetRowLabelSize( m_graphicsGrid->GetVisibleWidth( -1, true, true, true ) );
|
m_graphicsGrid->SetRowLabelSize( m_graphicsGrid->GetVisibleWidth( -1, true, true, true ) );
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_FP_EDITOR_DEFAULTS::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
|
FOOTPRINT_EDITOR_SETTINGS* cfg = mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
||||||
|
|
||||||
|
loadFPSettings( cfg );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -438,3 +445,12 @@ void PANEL_FP_EDITOR_DEFAULTS::OnDeleteTextItem( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_FP_EDITOR_DEFAULTS::ResetPanel()
|
||||||
|
{
|
||||||
|
FOOTPRINT_EDITOR_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadFPSettings( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <panel_fp_editor_defaults_base.h>
|
#include <panel_fp_editor_defaults_base.h>
|
||||||
|
|
||||||
class PAGED_DIALOG;
|
class PAGED_DIALOG;
|
||||||
|
class FOOTPRINT_EDITOR_SETTINGS;
|
||||||
|
|
||||||
|
|
||||||
class PANEL_FP_EDITOR_DEFAULTS : public PANEL_FP_EDITOR_DEFAULTS_BASE
|
class PANEL_FP_EDITOR_DEFAULTS : public PANEL_FP_EDITOR_DEFAULTS_BASE
|
||||||
|
@ -31,6 +32,11 @@ public:
|
||||||
PANEL_FP_EDITOR_DEFAULTS( wxWindow* aParent, EDA_BASE_FRAME* aUnitsProvider );
|
PANEL_FP_EDITOR_DEFAULTS( wxWindow* aParent, EDA_BASE_FRAME* aUnitsProvider );
|
||||||
~PANEL_FP_EDITOR_DEFAULTS() override;
|
~PANEL_FP_EDITOR_DEFAULTS() override;
|
||||||
|
|
||||||
|
bool TransferDataToWindow() override;
|
||||||
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void OnAddTextItem( wxCommandEvent& event ) override;
|
virtual void OnAddTextItem( wxCommandEvent& event ) override;
|
||||||
virtual void OnDeleteTextItem( wxCommandEvent& event ) override;
|
virtual void OnDeleteTextItem( wxCommandEvent& event ) override;
|
||||||
|
@ -41,8 +47,7 @@ private:
|
||||||
|
|
||||||
bool validateData();
|
bool validateData();
|
||||||
|
|
||||||
bool TransferDataToWindow() override;
|
void loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg );
|
||||||
bool TransferDataFromWindow() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EDA_UNITS m_units = EDA_UNITS::MILLIMETRES;
|
EDA_UNITS m_units = EDA_UNITS::MILLIMETRES;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_FP_EDITOR_DEFAULTS_BASE::PANEL_FP_EDITOR_DEFAULTS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_FP_EDITOR_DEFAULTS_BASE::PANEL_FP_EDITOR_DEFAULTS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bSizerMain;
|
wxBoxSizer* bSizerMain;
|
||||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="name">PANEL_FP_EDITOR_DEFAULTS_BASE</property>
|
<property name="name">PANEL_FP_EDITOR_DEFAULTS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
class WX_GRID;
|
class WX_GRID;
|
||||||
|
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -33,7 +34,7 @@ class WX_GRID;
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_FP_EDITOR_DEFAULTS_BASE
|
/// Class PANEL_FP_EDITOR_DEFAULTS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_FP_EDITOR_DEFAULTS_BASE : public wxPanel
|
class PANEL_FP_EDITOR_DEFAULTS_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,11 @@ PANEL_PCBNEW_DISPLAY_ORIGIN::PANEL_PCBNEW_DISPLAY_ORIGIN( wxWindow* aParent ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataToWindow()
|
void PANEL_PCBNEW_DISPLAY_ORIGIN::loadPCBSettings( PCBNEW_SETTINGS* aCfg )
|
||||||
{
|
{
|
||||||
PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
|
int origin = 0;
|
||||||
int origin = 0;
|
|
||||||
|
|
||||||
switch( cfg->m_Display.m_DisplayOrigin )
|
switch( aCfg->m_Display.m_DisplayOrigin )
|
||||||
{
|
{
|
||||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: origin = 0; break;
|
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: origin = 0; break;
|
||||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = 1; break;
|
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = 1; break;
|
||||||
|
@ -47,8 +46,16 @@ bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataToWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_DisplayOrigin->SetSelection( origin );
|
m_DisplayOrigin->SetSelection( origin );
|
||||||
m_XAxisDirection->SetSelection( cfg->m_Display.m_DisplayInvertXAxis ? 1 : 0 );
|
m_XAxisDirection->SetSelection( aCfg->m_Display.m_DisplayInvertXAxis ? 1 : 0 );
|
||||||
m_YAxisDirection->SetSelection( cfg->m_Display.m_DisplayInvertYAxis ? 0 : 1 );
|
m_YAxisDirection->SetSelection( aCfg->m_Display.m_DisplayInvertYAxis ? 0 : 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
|
||||||
|
|
||||||
|
loadPCBSettings( cfg );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -70,3 +77,14 @@ bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataFromWindow()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PANEL_PCBNEW_DISPLAY_ORIGIN::ResetPanel()
|
||||||
|
{
|
||||||
|
PCBNEW_SETTINGS cfg;
|
||||||
|
cfg.Load(); // Loading without a file will init to defaults
|
||||||
|
|
||||||
|
loadPCBSettings( &cfg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,13 @@ class PANEL_PCBNEW_DISPLAY_ORIGIN : public PANEL_PCBNEW_DISPLAY_ORIGIN_BASE
|
||||||
public:
|
public:
|
||||||
PANEL_PCBNEW_DISPLAY_ORIGIN( wxWindow* aParent );
|
PANEL_PCBNEW_DISPLAY_ORIGIN( wxWindow* aParent );
|
||||||
|
|
||||||
protected:
|
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
bool TransferDataFromWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
|
||||||
|
void ResetPanel() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadPCBSettings( PCBNEW_SETTINGS* aCfg );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::PANEL_PCBNEW_DISPLAY_ORIGIN_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
|
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::PANEL_PCBNEW_DISPLAY_ORIGIN_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
wxBoxSizer* bPanelSizer;
|
wxBoxSizer* bPanelSizer;
|
||||||
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
@ -62,6 +62,7 @@ PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::PANEL_PCBNEW_DISPLAY_ORIGIN_BASE( wxWindow* pa
|
||||||
|
|
||||||
this->SetSizer( bPanelSizer );
|
this->SetSizer( bPanelSizer );
|
||||||
this->Layout();
|
this->Layout();
|
||||||
|
bPanelSizer->Fit( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE()
|
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE()
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">PANEL_PCBNEW_DISPLAY_ORIGIN_BASE</property>
|
<property name="name">PANEL_PCBNEW_DISPLAY_ORIGIN_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">500,300</property>
|
<property name="size">-1,-1</property>
|
||||||
<property name="subclass">; ; forward_declare</property>
|
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
#include "widgets/resettable_panel.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/radiobox.h>
|
#include <wx/radiobox.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -24,7 +25,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class PANEL_PCBNEW_DISPLAY_ORIGIN_BASE
|
/// Class PANEL_PCBNEW_DISPLAY_ORIGIN_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PANEL_PCBNEW_DISPLAY_ORIGIN_BASE : public wxPanel
|
class PANEL_PCBNEW_DISPLAY_ORIGIN_BASE : public RESETTABLE_PANEL
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ class PANEL_PCBNEW_DISPLAY_ORIGIN_BASE : public wxPanel
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
PANEL_PCBNEW_DISPLAY_ORIGIN_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 );
|
||||||
~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE();
|
~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue