Flatten one level of showElectricalTypes settings.
This commit is contained in:
parent
17fad3a9a4
commit
70fb5cac96
|
@ -59,7 +59,7 @@ bool PANEL_LIBEDIT_SETTINGS::TransferDataToWindow()
|
||||||
m_choicePinDisplacement->SetSelection( settings->m_Repeat.pin_step == 50 ? 1 : 0 );
|
m_choicePinDisplacement->SetSelection( settings->m_Repeat.pin_step == 50 ? 1 : 0 );
|
||||||
m_spinRepeatLabel->SetValue( settings->m_Repeat.label_delta );
|
m_spinRepeatLabel->SetValue( settings->m_Repeat.label_delta );
|
||||||
|
|
||||||
m_checkShowPinElectricalType->SetValue( m_frame->GetShowElectricalType() );
|
m_cbShowPinElectricalType->SetValue( m_frame->GetRenderSettings()->m_ShowPinsElectricalType );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -79,9 +79,7 @@ bool PANEL_LIBEDIT_SETTINGS::TransferDataFromWindow()
|
||||||
settings->m_Repeat.label_delta = m_spinRepeatLabel->GetValue();
|
settings->m_Repeat.label_delta = m_spinRepeatLabel->GetValue();
|
||||||
settings->m_Repeat.pin_step = m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100;
|
settings->m_Repeat.pin_step = m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100;
|
||||||
|
|
||||||
m_frame->SetShowElectricalType( m_checkShowPinElectricalType->GetValue() );
|
m_frame->GetRenderSettings()->m_ShowPinsElectricalType = m_cbShowPinElectricalType->GetValue();
|
||||||
|
|
||||||
m_frame->GetRenderSettings()->m_ShowPinsElectricalType = m_frame->GetShowElectricalType();
|
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -93,8 +93,8 @@ PANEL_LIBEDIT_SETTINGS_BASE::PANEL_LIBEDIT_SETTINGS_BASE( wxWindow* parent, wxWi
|
||||||
|
|
||||||
defaults->Add( fgSizer, 0, wxBOTTOM|wxEXPAND, 5 );
|
defaults->Add( fgSizer, 0, wxBOTTOM|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_checkShowPinElectricalType = new wxCheckBox( defaults->GetStaticBox(), wxID_ANY, _("Show pin &electrical type"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_cbShowPinElectricalType = new wxCheckBox( defaults->GetStaticBox(), wxID_ANY, _( "Show pin &electrical type"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
defaults->Add( m_checkShowPinElectricalType, 0, wxBOTTOM, 5 );
|
defaults->Add( m_cbShowPinElectricalType, 0, wxBOTTOM, 5 );
|
||||||
|
|
||||||
|
|
||||||
leftColumn->Add( defaults, 0, wxEXPAND|wxALL, 5 );
|
leftColumn->Add( defaults, 0, wxEXPAND|wxALL, 5 );
|
||||||
|
|
|
@ -1094,7 +1094,7 @@
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="moveable">1</property>
|
<property name="moveable">1</property>
|
||||||
<property name="name">m_checkShowPinElectricalType</property>
|
<property name="name">m_cbShowPinElectricalType</property>
|
||||||
<property name="pane_border">1</property>
|
<property name="pane_border">1</property>
|
||||||
<property name="pane_position"></property>
|
<property name="pane_position"></property>
|
||||||
<property name="pane_size"></property>
|
<property name="pane_size"></property>
|
||||||
|
|
|
@ -50,7 +50,7 @@ class PANEL_LIBEDIT_SETTINGS_BASE : public wxPanel
|
||||||
wxStaticText* m_pinNameSizeLabel;
|
wxStaticText* m_pinNameSizeLabel;
|
||||||
wxTextCtrl* m_pinNameSizeCtrl;
|
wxTextCtrl* m_pinNameSizeCtrl;
|
||||||
wxStaticText* m_pinNameSizeUnits;
|
wxStaticText* m_pinNameSizeUnits;
|
||||||
wxCheckBox* m_checkShowPinElectricalType;
|
wxCheckBox* m_cbShowPinElectricalType;
|
||||||
wxStaticText* m_hPitchLabel;
|
wxStaticText* m_hPitchLabel;
|
||||||
wxTextCtrl* m_hPitchCtrl;
|
wxTextCtrl* m_hPitchCtrl;
|
||||||
wxStaticText* m_hPitchUnits;
|
wxStaticText* m_hPitchUnits;
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
#include <dialog_helpers.h>
|
#include <dialog_helpers.h>
|
||||||
#include <dialog_choose_component.h>
|
#include <dialog_choose_component.h>
|
||||||
#include <eda_doc.h>
|
|
||||||
#include <eeschema_id.h>
|
#include <eeschema_id.h>
|
||||||
#include <eeschema_settings.h>
|
#include <eeschema_settings.h>
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
|
@ -37,7 +36,6 @@
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
#include <lib_view_frame.h>
|
#include <lib_view_frame.h>
|
||||||
#include <msgpanel.h>
|
#include <msgpanel.h>
|
||||||
#include <sch_draw_panel.h>
|
|
||||||
#include <sch_view.h>
|
#include <sch_view.h>
|
||||||
#include <sch_painter.h>
|
#include <sch_painter.h>
|
||||||
#include <symbol_lib_table.h>
|
#include <symbol_lib_table.h>
|
||||||
|
@ -134,15 +132,12 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
||||||
GetScreen()->m_Center = true; // Axis origin centered on screen.
|
GetScreen()->m_Center = true; // Axis origin centered on screen.
|
||||||
LoadSettings( config() );
|
LoadSettings( config() );
|
||||||
|
|
||||||
// Synchronize some draw options
|
|
||||||
SetShowElectricalType( true );
|
|
||||||
// Ensure axis are always drawn (initial default display was not drawn)
|
// Ensure axis are always drawn (initial default display was not drawn)
|
||||||
KIGFX::GAL_DISPLAY_OPTIONS& gal_opts = GetGalDisplayOptions();
|
KIGFX::GAL_DISPLAY_OPTIONS& gal_opts = GetGalDisplayOptions();
|
||||||
gal_opts.m_axesEnabled = true;
|
gal_opts.m_axesEnabled = true;
|
||||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||||
GetCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
GetCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||||
|
|
||||||
GetRenderSettings()->m_ShowPinsElectricalType = GetShowElectricalType();
|
|
||||||
GetRenderSettings()->m_ShowHiddenText = true;
|
GetRenderSettings()->m_ShowHiddenText = true;
|
||||||
GetRenderSettings()->m_ShowHiddenPins = true;
|
GetRenderSettings()->m_ShowHiddenPins = true;
|
||||||
GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS );
|
GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS );
|
||||||
|
@ -629,7 +624,8 @@ void LIB_VIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
|
m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
|
||||||
m_cmpListWidth = cfg->m_LibViewPanel.cmp_list_width;
|
m_cmpListWidth = cfg->m_LibViewPanel.cmp_list_width;
|
||||||
m_showPinElectricalTypeName = cfg->m_LibViewPanel.show_pin_electrical_type;
|
|
||||||
|
GetRenderSettings()->m_ShowPinsElectricalType = cfg->m_LibViewPanel.show_pin_electrical_type;
|
||||||
|
|
||||||
// Set parameters to a reasonable value.
|
// Set parameters to a reasonable value.
|
||||||
if( m_libListWidth > m_FrameSize.x/2 )
|
if( m_libListWidth > m_FrameSize.x/2 )
|
||||||
|
@ -642,7 +638,7 @@ void LIB_VIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg)
|
void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg)
|
||||||
{
|
{
|
||||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
EDA_DRAW_FRAME::SaveSettings( cfg );
|
EDA_DRAW_FRAME::SaveSettings( cfg );
|
||||||
|
|
||||||
|
@ -653,7 +649,7 @@ void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg)
|
||||||
|
|
||||||
cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
|
cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
|
||||||
cfg->m_LibViewPanel.cmp_list_width = m_cmpListWidth;
|
cfg->m_LibViewPanel.cmp_list_width = m_cmpListWidth;
|
||||||
cfg->m_LibViewPanel.show_pin_electrical_type = m_showPinElectricalTypeName;
|
cfg->m_LibViewPanel.show_pin_electrical_type = GetRenderSettings()->m_ShowPinsElectricalType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,6 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
m_DrawSpecificConvert = true;
|
m_DrawSpecificConvert = true;
|
||||||
m_DrawSpecificUnit = false;
|
m_DrawSpecificUnit = false;
|
||||||
m_SyncPinEdit = false;
|
m_SyncPinEdit = false;
|
||||||
SetShowElectricalType( true );
|
|
||||||
|
|
||||||
m_my_part = nullptr;
|
m_my_part = nullptr;
|
||||||
m_treePane = nullptr;
|
m_treePane = nullptr;
|
||||||
|
@ -228,9 +227,8 @@ void LIB_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
SetDefaultLineWidth( Mils2iu( m_settings->m_Defaults.line_width ) );
|
SetDefaultLineWidth( Mils2iu( m_settings->m_Defaults.line_width ) );
|
||||||
SetDefaultTextSize( Mils2iu( m_settings->m_Defaults.text_size ) );
|
SetDefaultTextSize( Mils2iu( m_settings->m_Defaults.text_size ) );
|
||||||
m_showPinElectricalTypeName = m_settings->m_ShowPinElectricalType;
|
|
||||||
|
|
||||||
GetRenderSettings()->m_ShowPinsElectricalType = GetShowElectricalType();
|
GetRenderSettings()->m_ShowPinsElectricalType = m_settings->m_ShowPinElectricalType;
|
||||||
|
|
||||||
// Hidden elements must be editable
|
// Hidden elements must be editable
|
||||||
GetRenderSettings()->m_ShowHiddenText = true;
|
GetRenderSettings()->m_ShowHiddenText = true;
|
||||||
|
@ -247,7 +245,7 @@ void LIB_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
m_settings->m_Defaults.line_width = Iu2Mils( GetDefaultLineWidth() );
|
m_settings->m_Defaults.line_width = Iu2Mils( GetDefaultLineWidth() );
|
||||||
m_settings->m_Defaults.text_size = Iu2Mils( GetDefaultTextSize() );
|
m_settings->m_Defaults.text_size = Iu2Mils( GetDefaultTextSize() );
|
||||||
m_settings->m_ShowPinElectricalType = GetShowElectricalType();
|
m_settings->m_ShowPinElectricalType = GetRenderSettings()->m_ShowPinsElectricalType;
|
||||||
m_settings->m_LibWidth = m_treePane->GetSize().x;
|
m_settings->m_LibWidth = m_treePane->GetSize().x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <eeschema_id.h>
|
#include <eeschema_id.h>
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <lib_edit_frame.h>
|
#include <lib_edit_frame.h>
|
||||||
|
#include <sch_painter.h>
|
||||||
#include <dialog_helpers.h>
|
#include <dialog_helpers.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
#include <lib_manager.h>
|
#include <lib_manager.h>
|
||||||
|
@ -151,6 +152,7 @@ void LIB_EDIT_FRAME::ReCreateOptToolbar()
|
||||||
|
|
||||||
void LIB_EDIT_FRAME::SyncToolbars()
|
void LIB_EDIT_FRAME::SyncToolbars()
|
||||||
{
|
{
|
||||||
|
KIGFX::SCH_RENDER_SETTINGS* settings = GetRenderSettings();
|
||||||
KIGFX::GAL_DISPLAY_OPTIONS& galOpts = GetGalDisplayOptions();
|
KIGFX::GAL_DISPLAY_OPTIONS& galOpts = GetGalDisplayOptions();
|
||||||
|
|
||||||
bool isEditable = m_my_part && m_my_part->IsRoot();
|
bool isEditable = m_my_part && m_my_part->IsRoot();
|
||||||
|
@ -176,7 +178,7 @@ void LIB_EDIT_FRAME::SyncToolbars()
|
||||||
m_optionsToolBar->Toggle( ACTIONS::metricUnits, GetUserUnits() != EDA_UNITS::INCHES );
|
m_optionsToolBar->Toggle( ACTIONS::metricUnits, GetUserUnits() != EDA_UNITS::INCHES );
|
||||||
m_optionsToolBar->Toggle( ACTIONS::imperialUnits, GetUserUnits() == EDA_UNITS::INCHES );
|
m_optionsToolBar->Toggle( ACTIONS::imperialUnits, GetUserUnits() == EDA_UNITS::INCHES );
|
||||||
m_optionsToolBar->Toggle( ACTIONS::toggleCursorStyle, galOpts.m_fullscreenCursor );
|
m_optionsToolBar->Toggle( ACTIONS::toggleCursorStyle, galOpts.m_fullscreenCursor );
|
||||||
m_optionsToolBar->Toggle( EE_ACTIONS::showElectricalTypes, GetShowElectricalType() );
|
m_optionsToolBar->Toggle( EE_ACTIONS::showElectricalTypes, settings->m_ShowPinsElectricalType );
|
||||||
m_optionsToolBar->Toggle( EE_ACTIONS::showComponentTree, IsSearchTreeShown() );
|
m_optionsToolBar->Toggle( EE_ACTIONS::showComponentTree, IsSearchTreeShown() );
|
||||||
m_optionsToolBar->Refresh();
|
m_optionsToolBar->Refresh();
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,6 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aWindo
|
||||||
const wxString& aTitle, const wxPoint& aPosition,
|
const wxString& aTitle, const wxPoint& aPosition,
|
||||||
const wxSize& aSize, long aStyle, const wxString& aFrameName ) :
|
const wxSize& aSize, long aStyle, const wxString& aFrameName ) :
|
||||||
EDA_DRAW_FRAME( aKiway, aParent, aWindowType, aTitle, aPosition, aSize, aStyle, aFrameName ),
|
EDA_DRAW_FRAME( aKiway, aParent, aWindowType, aTitle, aPosition, aSize, aStyle, aFrameName ),
|
||||||
m_showPinElectricalTypeName( false ),
|
|
||||||
m_defaults( &m_base_frame_defaults )
|
m_defaults( &m_base_frame_defaults )
|
||||||
{
|
{
|
||||||
createCanvas();
|
createCanvas();
|
||||||
|
|
|
@ -92,8 +92,6 @@ class SCH_BASE_FRAME : public EDA_DRAW_FRAME
|
||||||
protected:
|
protected:
|
||||||
TEMPLATES m_templateFieldNames;
|
TEMPLATES m_templateFieldNames;
|
||||||
|
|
||||||
bool m_showPinElectricalTypeName;
|
|
||||||
|
|
||||||
/// These are only used by libedit. Eeschema should be using the one inside the SCHEMATIC.
|
/// These are only used by libedit. Eeschema should be using the one inside the SCHEMATIC.
|
||||||
SCHEMATIC_SETTINGS m_base_frame_defaults;
|
SCHEMATIC_SETTINGS m_base_frame_defaults;
|
||||||
|
|
||||||
|
@ -133,12 +131,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool GetShowAllPins() const { return true; }
|
virtual bool GetShowAllPins() const { return true; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow some frames to show/hide pin electrical type names.
|
|
||||||
*/
|
|
||||||
bool GetShowElectricalType() { return m_showPinElectricalTypeName; }
|
|
||||||
void SetShowElectricalType( bool aShow ) { m_showPinElectricalTypeName = aShow; }
|
|
||||||
|
|
||||||
virtual int GetDefaultLineWidth() const { return m_defaults->m_DefaultLineWidth; }
|
virtual int GetDefaultLineWidth() const { return m_defaults->m_DefaultLineWidth; }
|
||||||
virtual void SetDefaultLineWidth( int aWidth );
|
virtual void SetDefaultLineWidth( int aWidth );
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include "class_library.h"
|
#include "class_library.h"
|
||||||
#include "eeschema_id.h"
|
#include "eeschema_id.h"
|
||||||
#include "general.h"
|
|
||||||
#include "lib_view_frame.h"
|
#include "lib_view_frame.h"
|
||||||
|
#include "sch_painter.h"
|
||||||
#include <symbol_lib_table.h>
|
#include <symbol_lib_table.h>
|
||||||
#include <tool/action_toolbar.h>
|
#include <tool/action_toolbar.h>
|
||||||
#include <tool/conditional_menu.h>
|
#include <tool/conditional_menu.h>
|
||||||
|
@ -116,7 +116,7 @@ void LIB_VIEW_FRAME::ReCreateMenuBar()
|
||||||
return IsGridVisible();
|
return IsGridVisible();
|
||||||
};
|
};
|
||||||
auto electricalTypesShownCondition = [ this ] ( const SELECTION& aSel ) {
|
auto electricalTypesShownCondition = [ this ] ( const SELECTION& aSel ) {
|
||||||
return GetShowElectricalType();
|
return GetRenderSettings()->m_ShowPinsElectricalType;
|
||||||
};
|
};
|
||||||
|
|
||||||
viewMenu->AddItem( ACTIONS::zoomInCenter, EE_CONDITIONS::ShowAlways );
|
viewMenu->AddItem( ACTIONS::zoomInCenter, EE_CONDITIONS::ShowAlways );
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <symbol_tree_model_adapter.h>
|
#include <symbol_tree_model_adapter.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
#include <gestfich.h>
|
#include <gestfich.h>
|
||||||
#include <project.h>
|
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -283,10 +282,10 @@ int LIB_CONTROL::ShowComponentTree( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int LIB_CONTROL::ShowElectricalTypes( const TOOL_EVENT& aEvent )
|
int LIB_CONTROL::ShowElectricalTypes( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetShowElectricalType( !m_frame->GetShowElectricalType() );
|
KIGFX::SCH_RENDER_SETTINGS* renderSettings = m_frame->GetRenderSettings();
|
||||||
|
renderSettings->m_ShowPinsElectricalType = !renderSettings->m_ShowPinsElectricalType;
|
||||||
|
|
||||||
// Update canvas
|
// Update canvas
|
||||||
m_frame->GetRenderSettings()->m_ShowPinsElectricalType = m_frame->GetShowElectricalType();
|
|
||||||
m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
|
m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
|
||||||
m_frame->GetCanvas()->Refresh();
|
m_frame->GetCanvas()->Refresh();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue