Grid settings for Eeschema GAL.

Split antialiasing options out from display options.  Move
antialiasing to common.  Duplicate the rest of display options
for Eeschema.

Implement OnSelectGrid and hookup GAL canvas refresh to
SetPresetGrid.

Add Grid Settings... to View menu and move Show Grid from
preferences to View Menu to match Pcbnew.
This commit is contained in:
Jeff Young 2018-09-04 01:00:17 +01:00
parent 8390b7a7ac
commit afeebc8944
32 changed files with 1984 additions and 1425 deletions

View File

@ -126,7 +126,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_sliderBrightness = new wxSlider( sbSizerViewHSV->GetStaticBox(), wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
bSizerBright->Add( m_sliderBrightness, 1, wxTOP|wxRIGHT, 5 );
bSizerBright->Add( m_sliderBrightness, 1, wxTOP|wxRIGHT|wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizerViewHSV->Add( bSizerBright, 0, wxEXPAND, 5 );
@ -172,10 +172,10 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
m_opacityLabel = new wxStaticText( this, wxID_ANY, _("Opacity:"), wxDefaultPosition, wxDefaultSize, 0 );
m_opacityLabel->Wrap( -1 );
m_SizerTransparency->Add( m_opacityLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
m_SizerTransparency->Add( m_opacityLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxLEFT, 5 );
m_sliderTransparency = new wxSlider( this, wxID_ANY, 80, 20, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
m_SizerTransparency->Add( m_sliderTransparency, 1, wxALL, 5 );
m_SizerTransparency->Add( m_sliderTransparency, 1, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL, 10 );
bSizerUpperMain->Add( m_SizerTransparency, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );

View File

@ -1462,7 +1462,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT</property>
<property name="flag">wxTOP|wxRIGHT|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">1</property>
<object class="wxSlider" expanded="1">
<property name="BottomDockable">1</property>
@ -1704,7 +1704,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1786,8 +1786,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="border">10</property>
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">1</property>
<object class="wxSlider" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -26,6 +26,7 @@
#include <kiface_i.h>
#include <bitmap_types.h>
#include <bitmaps.h>
#include <wx/graphics.h>
#include "panel_common_settings.h"
PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aParent ) :
@ -55,6 +56,10 @@ bool PANEL_COMMON_SETTINGS::TransferDataToWindow()
commonSettings->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize, DEFAULT_FILE_HISTORY_SIZE );
m_fileHistorySize->SetValue( fileHistorySize );
int antialiasingMode;
commonSettings->Read( GAL_ANTIALIASING_MODE_KEY, &antialiasingMode, 0 );
m_antialiasing->SetSelection( antialiasingMode );
int scale_fourths;
commonSettings->Read( ICON_SCALE_KEY, &scale_fourths );
@ -99,6 +104,8 @@ bool PANEL_COMMON_SETTINGS::TransferDataFromWindow()
commonSettings->Write( FILE_HISTORY_SIZE_KEY, m_fileHistorySize->GetValue() );
commonSettings->Write( GAL_ANTIALIASING_MODE_KEY, m_antialiasing->GetSelection() );
const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25;
commonSettings->Write( ICON_SCALE_KEY, scale_fourths );

View File

@ -18,10 +18,10 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxGridBagSizer* gbSizer1;
gbSizer1 = new wxGridBagSizer( 0, 0 );
gbSizer1 = new wxGridBagSizer( 3, 0 );
gbSizer1->SetFlexibleDirection( wxBOTH );
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gbSizer1->SetEmptyCellSize( wxSize( -1,10 ) );
gbSizer1->SetEmptyCellSize( wxSize( -1,2 ) );
m_staticTextautosave = new wxStaticText( this, wxID_ANY, _("&Auto save:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextautosave->Wrap( -1 );
@ -31,60 +31,91 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
m_SaveTime = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
bSizer6->Add( m_SaveTime, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
bSizer6->Add( m_SaveTime, 0, wxLEFT, 5 );
wxStaticText* minutesLabel;
minutesLabel = new wxStaticText( this, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 );
minutesLabel->Wrap( -1 );
bSizer6->Add( minutesLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
bSizer6->Add( minutesLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
gbSizer1->Add( bSizer6, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
m_staticTextFileHistorySize = new wxStaticText( this, wxID_ANY, _("File history size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextFileHistorySize->Wrap( -1 );
gbSizer1->Add( m_staticTextFileHistorySize, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
gbSizer1->Add( m_staticTextFileHistorySize, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_fileHistorySize = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 0 );
gbSizer1->Add( m_fileHistorySize, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 );
gbSizer1->Add( m_fileHistorySize, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT, 5 );
wxStaticText* textEditorLabel;
textEditorLabel = new wxStaticText( this, wxID_ANY, _("Text editor:"), wxDefaultPosition, wxDefaultSize, 0 );
textEditorLabel->Wrap( -1 );
gbSizer1->Add( textEditorLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
wxStaticText* antialiasingLabel;
antialiasingLabel = new wxStaticText( this, wxID_ANY, _("Graphics acceleration:"), wxDefaultPosition, wxDefaultSize, 0 );
antialiasingLabel->Wrap( -1 );
gbSizer1->Add( antialiasingLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_textEditorPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textEditorPath->Enable( false );
m_textEditorPath->SetMinSize( wxSize( 300,-1 ) );
gbSizer1->Add( m_textEditorPath, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_textEditorBtn = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_textEditorBtn->SetMinSize( wxSize( 29,29 ) );
gbSizer1->Add( m_textEditorBtn, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_defaultPDFViewer = new wxRadioButton( this, wxID_ANY, _("System default PDF viewer"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_defaultPDFViewer, wxGBPosition( 4, 0 ), wxGBSpan( 1, 3 ), wxTOP|wxRIGHT|wxLEFT, 5 );
m_otherPDFViewer = new wxRadioButton( this, wxID_ANY, _("Other:"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer1->Add( m_otherPDFViewer, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_PDFViewerPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_PDFViewerPath->Enable( false );
m_PDFViewerPath->SetMinSize( wxSize( 300,-1 ) );
gbSizer1->Add( m_PDFViewerPath, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_pdfViewerBtn = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_pdfViewerBtn->SetMinSize( wxSize( 29,29 ) );
gbSizer1->Add( m_pdfViewerBtn, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
wxString m_antialiasingChoices[] = { _("No Antialiasing"), _("Subpixel Antialiasing (High Quality)"), _("Subpixel Antialiasing (Ultra Quality)"), _("Supersampling (2x)"), _("Supersampling (4x)") };
int m_antialiasingNChoices = sizeof( m_antialiasingChoices ) / sizeof( wxString );
m_antialiasing = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_antialiasingNChoices, m_antialiasingChoices, 0 );
m_antialiasing->SetSelection( 0 );
gbSizer1->Add( m_antialiasing, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
gbSizer1->AddGrowableCol( 1 );
bLeftSizer->Add( gbSizer1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bLeftSizer->Add( gbSizer1, 1, wxEXPAND|wxALL, 5 );
bLeftSizer->Add( 0, 0, 0, wxEXPAND|wxTOP, 3 );
wxStaticBoxSizer* sizerHelperApps;
sizerHelperApps = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Helper Applications") ), wxVERTICAL );
wxGridBagSizer* gridHelperApps;
gridHelperApps = new wxGridBagSizer( 0, 0 );
gridHelperApps->SetFlexibleDirection( wxBOTH );
gridHelperApps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gridHelperApps->SetEmptyCellSize( wxSize( -1,5 ) );
wxStaticText* textEditorLabel;
textEditorLabel = new wxStaticText( sizerHelperApps->GetStaticBox(), wxID_ANY, _("Text editor:"), wxDefaultPosition, wxDefaultSize, 0 );
textEditorLabel->Wrap( -1 );
gridHelperApps->Add( textEditorLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 4 );
m_textEditorPath = new wxTextCtrl( sizerHelperApps->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textEditorPath->Enable( false );
m_textEditorPath->SetMinSize( wxSize( 360,-1 ) );
gridHelperApps->Add( m_textEditorPath, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_textEditorBtn = new wxBitmapButton( sizerHelperApps->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_textEditorBtn->SetMinSize( wxSize( 29,29 ) );
gridHelperApps->Add( m_textEditorBtn, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_defaultPDFViewer = new wxRadioButton( sizerHelperApps->GetStaticBox(), wxID_ANY, _("System default PDF viewer"), wxDefaultPosition, wxDefaultSize, 0 );
gridHelperApps->Add( m_defaultPDFViewer, wxGBPosition( 2, 0 ), wxGBSpan( 1, 3 ), wxTOP|wxRIGHT|wxLEFT, 4 );
m_otherPDFViewer = new wxRadioButton( sizerHelperApps->GetStaticBox(), wxID_ANY, _("Other:"), wxDefaultPosition, wxDefaultSize, 0 );
gridHelperApps->Add( m_otherPDFViewer, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 4 );
m_PDFViewerPath = new wxTextCtrl( sizerHelperApps->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_PDFViewerPath->Enable( false );
m_PDFViewerPath->SetMinSize( wxSize( 360,-1 ) );
gridHelperApps->Add( m_PDFViewerPath, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_pdfViewerBtn = new wxBitmapButton( sizerHelperApps->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_pdfViewerBtn->SetMinSize( wxSize( 29,29 ) );
gridHelperApps->Add( m_pdfViewerBtn, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
gridHelperApps->AddGrowableCol( 1 );
sizerHelperApps->Add( gridHelperApps, 0, wxEXPAND, 5 );
bLeftSizer->Add( sizerHelperApps, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizer5;
sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Interface") ), wxVERTICAL );
@ -97,32 +128,34 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
m_staticText1 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
fgSizer11->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 );
fgSizer11->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 4 );
m_scaleSlider = new STEPPED_SLIDER( sbSizer5->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS );
fgSizer11->Add( m_scaleSlider, 0, wxBOTTOM|wxEXPAND, 4 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_scaleSlider = new STEPPED_SLIDER( sbSizer5->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
m_scaleSlider->SetMinSize( wxSize( 240,-1 ) );
bSizer4->Add( m_scaleSlider, 1, wxBOTTOM|wxEXPAND|wxALIGN_RIGHT, 4 );
m_staticText2 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
fgSizer11->Add( m_staticText2, 0, wxALIGN_BOTTOM|wxBOTTOM, 2 );
bSizer4->Add( m_staticText2, 0, wxALIGN_BOTTOM|wxBOTTOM|wxRIGHT, 2 );
fgSizer11->Add( 0, 0, 0, wxEXPAND, 5 );
fgSizer11->Add( bSizer4, 1, wxEXPAND, 5 );
m_scaleAuto = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer11->Add( m_scaleAuto, 0, wxTOP|wxLEFT, 9 );
m_scaleAuto = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer11->Add( m_scaleAuto, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 25 );
fgSizer11->Add( 0, 0, 0, wxEXPAND, 5 );
sbSizer5->Add( fgSizer11, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer5->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
sbSizer5->Add( fgSizer11, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
m_checkBoxIconsInMenus = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Show icons in menus"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer5->Add( m_checkBoxIconsInMenus, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer5->Add( m_checkBoxIconsInMenus, 0, wxALL, 4 );
bLeftSizer->Add( sbSizer5, 0, wxEXPAND|wxALL, 5 );
@ -133,17 +166,17 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
m_ZoomCenterOpt = new wxCheckBox( sbSizer51->GetStaticBox(), wxID_ANY, _("Ce&nter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
m_ZoomCenterOpt->SetToolTip( _("Center the cursor on screen when zooming.") );
sbSizer51->Add( m_ZoomCenterOpt, 0, wxRIGHT|wxLEFT, 5 );
sbSizer51->Add( m_ZoomCenterOpt, 0, wxRIGHT|wxLEFT, 4 );
m_MousewheelPANOpt = new wxCheckBox( sbSizer51->GetStaticBox(), wxID_ANY, _("Use touchpad to pan"), wxDefaultPosition, wxDefaultSize, 0 );
m_MousewheelPANOpt->SetToolTip( _("Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll).") );
sbSizer51->Add( m_MousewheelPANOpt, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
sbSizer51->Add( m_MousewheelPANOpt, 0, wxALL, 4 );
m_AutoPANOpt = new wxCheckBox( sbSizer51->GetStaticBox(), wxID_AUTOPAN, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 );
m_AutoPANOpt->SetToolTip( _("When drawing a track or moving an item, pan when approaching the edge of the display.") );
sbSizer51->Add( m_AutoPANOpt, 0, wxALL, 5 );
sbSizer51->Add( m_AutoPANOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
bLeftSizer->Add( sbSizer51, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,8 @@
#include <wx/settings.h>
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/gbsizer.h>
#include <wx/textctrl.h>
#include <wx/bitmap.h>
#include <wx/image.h>
@ -27,10 +29,9 @@
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/radiobut.h>
#include <wx/gbsizer.h>
#include <wx/statbox.h>
#include <wx/slider.h>
#include <wx/checkbox.h>
#include <wx/statbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
@ -52,6 +53,7 @@ class PANEL_COMMON_SETTINGS_BASE : public wxPanel
wxSpinCtrl* m_SaveTime;
wxStaticText* m_staticTextFileHistorySize;
wxSpinCtrl* m_fileHistorySize;
wxChoice* m_antialiasing;
wxTextCtrl* m_textEditorPath;
wxBitmapButton* m_textEditorBtn;
wxRadioButton* m_defaultPDFViewer;

View File

@ -31,7 +31,6 @@ using namespace KIGFX;
/*
* Config option strings
*/
static const wxString GalGLAntialiasingKeyword( "OpenGLAntialiasingMode" );
static const wxString GalGridStyleConfig( "GridStyle" );
static const wxString GalGridLineWidthConfig( "GridLineWidth" );
static const wxString GalGridMaxDensityConfig( "GridMaxDensity" );
@ -40,16 +39,6 @@ static const wxString GalFullscreenCursorConfig( "CursorFullscreen" );
static const wxString GalForceDisplayCursorConfig( "ForceDisplayCursor" );
static const UTIL::CFG_MAP<KIGFX::OPENGL_ANTIALIASING_MODE> aaModeConfigVals =
{
{ KIGFX::OPENGL_ANTIALIASING_MODE::NONE, 0 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_HIGH, 1 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_ULTRA, 2 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X2, 3 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X4, 4 },
};
static const UTIL::CFG_MAP<KIGFX::GRID_STYLE> gridStyleConfigVals =
{
{ KIGFX::GRID_STYLE::DOTS, 0 },
@ -73,28 +62,15 @@ void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, const wxString& aBaseN
{
long readLong; // Temp value buffer
aCfg->Read( aBaseName + GalGLAntialiasingKeyword, &readLong,
static_cast<long>( KIGFX::OPENGL_ANTIALIASING_MODE::NONE ) );
gl_antialiasing_mode = UTIL::GetValFromConfig( aaModeConfigVals, readLong );
aCfg->Read( aBaseName + GalGridStyleConfig, &readLong,
static_cast<long>( KIGFX::GRID_STYLE::DOTS ) );
m_gridStyle = UTIL::GetValFromConfig( gridStyleConfigVals, readLong );
aCfg->Read( aBaseName + GalGridLineWidthConfig,
&m_gridLineWidth, 0.5 );
aCfg->Read( aBaseName + GalGridMaxDensityConfig,
&m_gridMinSpacing, 10 );
aCfg->Read( aBaseName + GalGridAxesEnabledConfig,
&m_axesEnabled, false );
aCfg->Read( aBaseName + GalFullscreenCursorConfig,
&m_fullscreenCursor, false );
aCfg->Read( aBaseName + GalForceDisplayCursorConfig,
&m_forceDisplayCursor, false );
aCfg->Read( aBaseName + GalGridLineWidthConfig, &m_gridLineWidth, 0.5 );
aCfg->Read( aBaseName + GalGridMaxDensityConfig, &m_gridMinSpacing, 10 );
aCfg->Read( aBaseName + GalGridAxesEnabledConfig, &m_axesEnabled, false );
aCfg->Read( aBaseName + GalFullscreenCursorConfig, &m_fullscreenCursor, false );
aCfg->Read( aBaseName + GalForceDisplayCursorConfig, &m_forceDisplayCursor, false );
NotifyChanged();
}
@ -102,26 +78,14 @@ void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, const wxString& aBaseN
void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase* aCfg, const wxString& aBaseName )
{
aCfg->Write( aBaseName + GalGLAntialiasingKeyword,
UTIL::GetConfigForVal( aaModeConfigVals, gl_antialiasing_mode ) );
aCfg->Write( aBaseName + GalGridStyleConfig,
UTIL::GetConfigForVal( gridStyleConfigVals, m_gridStyle ) );
aCfg->Write( aBaseName + GalGridLineWidthConfig,
m_gridLineWidth );
aCfg->Write( aBaseName + GalGridMaxDensityConfig,
m_gridMinSpacing );
aCfg->Write( aBaseName + GalGridAxesEnabledConfig,
m_axesEnabled );
aCfg->Write( aBaseName + GalFullscreenCursorConfig,
m_fullscreenCursor );
aCfg->Write( aBaseName + GalForceDisplayCursorConfig,
m_forceDisplayCursor );
aCfg->Write( aBaseName + GalGridLineWidthConfig, m_gridLineWidth );
aCfg->Write( aBaseName + GalGridMaxDensityConfig, m_gridMinSpacing );
aCfg->Write( aBaseName + GalGridAxesEnabledConfig, m_axesEnabled );
aCfg->Write( aBaseName + GalFullscreenCursorConfig, m_fullscreenCursor );
aCfg->Write( aBaseName + GalForceDisplayCursorConfig, m_forceDisplayCursor );
}

View File

@ -290,25 +290,30 @@ void EDA_DRAW_FRAME::CommonSettingsChanged()
{
EDA_BASE_FRAME::CommonSettingsChanged();
wxConfigBase* settings = Pgm().CommonSettings();
int autosaveInterval;
Pgm().CommonSettings()->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
settings->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
SetAutoSaveInterval( autosaveInterval );
int historySize;
Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE );
settings->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE );
Kiface().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) );
bool option;
Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option );
settings->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option );
m_canvas->SetEnableMousewheelPan( option );
Pgm().CommonSettings()->Read( ENBL_ZOOM_NO_CENTER_KEY, &option );
settings->Read( ENBL_ZOOM_NO_CENTER_KEY, &option );
m_canvas->SetEnableZoomNoCenter( option );
Pgm().CommonSettings()->Read( ENBL_AUTO_PAN_KEY, &option );
settings->Read( ENBL_AUTO_PAN_KEY, &option );
m_canvas->SetEnableAutoPan( option );
m_galDisplayOptions.ReadConfig( Pgm().CommonSettings(), GAL_DISPLAY_OPTIONS_KEY );
int tmp;
settings->Read( GAL_ANTIALIASING_MODE_KEY, &tmp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) tmp;
m_galDisplayOptions.NotifyChanged();
}
@ -522,17 +527,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
int idx = eventId - ID_POPUP_GRID_LEVEL_1000;
// Notify GAL
TOOL_MANAGER* mgr = GetToolManager();
if( mgr && IsGalCanvasActive() )
{
mgr->RunAction( "common.Control.gridPreset", true, idx );
}
else
SetPresetGrid( idx );
m_canvas->Refresh();
SetPresetGrid( idx );
}
@ -702,7 +697,8 @@ void EDA_DRAW_FRAME::SetPrevGrid()
void EDA_DRAW_FRAME::SetPresetGrid( int aIndex )
{
BASE_SCREEN * screen = GetScreen();
BASE_SCREEN* screen = GetScreen();
KIGFX::VIEW* view = GetGalCanvas()->GetView();
if( ! screen->GridExists( aIndex + ID_POPUP_GRID_LEVEL_1000 ) )
aIndex = screen->GetGrids()[0].m_CmdId;
@ -724,7 +720,10 @@ void EDA_DRAW_FRAME::SetPresetGrid( int aIndex )
// Be sure m_LastGridSizeId is up to date.
m_LastGridSizeId = aIndex;
GetScreen()->SetGrid( aIndex + ID_POPUP_GRID_LEVEL_1000 );
screen->SetGrid( aIndex + ID_POPUP_GRID_LEVEL_1000 );
view->GetGAL()->SetGridSize( VECTOR2D( screen->GetGridSize() ) );
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
// Put cursor on new grid
SetCrossHairPosition( RefPos( true ) );
@ -796,6 +795,7 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
EDA_BASE_FRAME::LoadSettings( aCfg );
wxString baseCfgName = ConfigBaseName();
wxConfigBase* cmnCfg = Pgm().CommonSettings();
// Read units used in dialogs and toolbars
EDA_UNITS_T unitsTmp;
@ -827,7 +827,12 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( baseCfgName + FirstRunShownKeyword, &m_firstRunDialogSetting, 0L );
m_galDisplayOptions.ReadConfig( Pgm().CommonSettings(), GAL_DISPLAY_OPTIONS_KEY );
m_galDisplayOptions.ReadConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
int temp;
cmnCfg->Read( GAL_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) temp;
m_galDisplayOptions.NotifyChanged();
}
@ -846,6 +851,8 @@ void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg )
if( GetScreen() )
aCfg->Write( baseCfgName + MaxUndoItemsEntry, long( GetScreen()->GetMaxUndoItems() ) );
m_galDisplayOptions.WriteConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
}

View File

@ -290,25 +290,30 @@ void EDA_DRAW_FRAME::CommonSettingsChanged()
{
EDA_BASE_FRAME::CommonSettingsChanged();
wxConfigBase* settings = Pgm().CommonSettings();
int autosaveInterval;
Pgm().CommonSettings()->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
settings->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
SetAutoSaveInterval( autosaveInterval );
int historySize;
Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE );
settings->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE );
Kiface().GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) );
bool option;
Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option );
settings->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option );
m_canvas->SetEnableMousewheelPan( option );
Pgm().CommonSettings()->Read( ENBL_ZOOM_NO_CENTER_KEY, &option );
settings->Read( ENBL_ZOOM_NO_CENTER_KEY, &option );
m_canvas->SetEnableZoomNoCenter( option );
Pgm().CommonSettings()->Read( ENBL_AUTO_PAN_KEY, &option );
settings->Read( ENBL_AUTO_PAN_KEY, &option );
m_canvas->SetEnableAutoPan( option );
m_galDisplayOptions.ReadConfig( Pgm().CommonSettings(), GAL_DISPLAY_OPTIONS_KEY );
int tmp;
settings->Read( GAL_ANTIALIASING_MODE_KEY, &tmp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) tmp;
m_galDisplayOptions.NotifyChanged();
}
@ -797,6 +802,7 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
EDA_BASE_FRAME::LoadSettings( aCfg );
wxString baseCfgName = ConfigBaseName();
wxConfigBase* cmnCfg = Pgm().CommonSettings();
// Read units used in dialogs and toolbars
EDA_UNITS_T unitsTmp;
@ -828,7 +834,12 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( baseCfgName + FirstRunShownKeyword, &m_firstRunDialogSetting, 0L );
m_galDisplayOptions.ReadConfig( Pgm().CommonSettings(), GAL_DISPLAY_OPTIONS_KEY );
m_galDisplayOptions.ReadConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
int temp;
cmnCfg->Read( GAL_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) temp;
m_galDisplayOptions.NotifyChanged();
}
@ -847,6 +858,8 @@ void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg )
if( GetScreen() )
aCfg->Write( baseCfgName + MaxUndoItemsEntry, long( GetScreen()->GetMaxUndoItems() ) );
m_galDisplayOptions.WriteConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
}

View File

@ -41,6 +41,7 @@
#include <wx/richmsgdlg.h>
#include <pgm_base.h>
#include <draw_frame.h>
#include <eda_base_frame.h>
#include <macros.h>
#include <config_params.h>
@ -553,13 +554,14 @@ void PGM_BASE::loadCommonSettings()
m_common_settings->Write( USE_ICONS_IN_MENUS_KEY, defaultUseIconsInMenus );
if( !m_common_settings->HasEntry( ICON_SCALE_KEY )
|| !m_common_settings->HasEntry( GAL_DISPLAY_OPTIONS_KEY ) )
|| !m_common_settings->HasEntry( GAL_ANTIALIASING_MODE_KEY ) )
{
// 5.0 and earlier saved common settings in each app, and saved GAL display options
// only in pcbnew (which was the only canvas to support them). Since there's no
// single right answer to where to pull the common settings from, we might as well
// get them along with the GAL display options from pcbnew.
// 5.0 and earlier saved common settings in each app, and saved hardware antialiasing
// options only in pcbnew (which was the only canvas to support them). Since there's
// no single right answer to where to pull the common settings from, we might as well
// get them along with the hardware antialiasing option from pcbnew.
wxConfigBase* pcbnewConfig = GetNewConfig( wxString::FromUTF8( "pcbnew" ) );
wxString pcbFrameKey( PCB_EDIT_FRAME_NAME );
if( !m_common_settings->HasEntry( ICON_SCALE_KEY ) )
{
@ -579,13 +581,12 @@ void PGM_BASE::loadCommonSettings()
m_common_settings->Write( ENBL_AUTO_PAN_KEY, option );
}
if( !m_common_settings->HasEntry( GAL_DISPLAY_OPTIONS_KEY ) )
if( !m_common_settings->HasEntry( GAL_ANTIALIASING_MODE_KEY ) )
{
KIGFX::GAL_DISPLAY_OPTIONS temp;
temp.ReadConfig( pcbnewConfig, wxString( "PcbFrame" ) + GAL_DISPLAY_OPTIONS_KEY );
temp.WriteConfig( m_common_settings, GAL_DISPLAY_OPTIONS_KEY );
m_common_settings->Write( GAL_DISPLAY_OPTIONS_KEY, 1 );
int temp;
pcbnewConfig->Read( pcbFrameKey + GAL_DISPLAY_OPTIONS_KEY + GAL_ANTIALIASING_MODE_KEY,
&temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_common_settings->Write( GAL_ANTIALIASING_MODE_KEY, temp );
}
}

View File

@ -49,16 +49,6 @@ static const UTIL::CFG_MAP<KIGFX::GRID_STYLE> gridStyleSelectMap =
};
static const UTIL::CFG_MAP<KIGFX::OPENGL_ANTIALIASING_MODE> aaModeSelectMap =
{
{ KIGFX::OPENGL_ANTIALIASING_MODE::NONE, 0 }, // Default
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_HIGH, 1 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_ULTRA, 2 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X2, 3 },
{ KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X4, 4 },
};
GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTIONS& aGalOpts ):
wxPanel( aParent, wxID_ANY ),
m_galOptions( aGalOpts )
@ -75,31 +65,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
const wxString galOnlySuffix = _( " (not supported in Legacy Toolset)" );
/*
* Anti-aliasing subpanel
*/
{
wxStaticBoxSizer* sOpenGLRenderingSizer;
sOpenGLRenderingSizer = new wxStaticBoxSizer( new wxStaticBox( this,
wxID_ANY, _( "Accelerated Graphics" ) ), wxVERTICAL );
wxString m_choiceAntialiasingChoices[] = {
_( "No Antialiasing" ),
_( "Subpixel Antialiasing (High Quality)" ),
_( "Subpixel Antialiasing (Ultra Quality)" ),
_( "Supersampling (2x)" ),
_( "Supersampling (4x)" )
};
int m_choiceAntialiasingNChoices = sizeof( m_choiceAntialiasingChoices ) / sizeof( wxString );
m_choiceAntialiasing = new wxChoice( sOpenGLRenderingSizer->GetStaticBox(),
wxID_ANY, wxDefaultPosition, wxDefaultSize,
m_choiceAntialiasingNChoices, m_choiceAntialiasingChoices, 0 );
sOpenGLRenderingSizer->Add( m_choiceAntialiasing, 0, wxALL|wxEXPAND, 5 );
sLeftSizer->Add( sOpenGLRenderingSizer, 0, wxTOP|wxRIGHT|wxEXPAND, 5 );
}
/*
* Grid setting subpanel
* Grid settings subpanel
*/
{
wxStaticBoxSizer* sGridSettings;
@ -178,6 +144,9 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
m_gridMinSpacingIncrementer->SetPrecision( 0 ); // restrict to ints
}
/*
* Cursor settings subpanel
*/
{
wxString cursorDisplayTitle = _( "Cursor Options" );
@ -225,9 +194,6 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
bool GAL_OPTIONS_PANEL::TransferDataToWindow()
{
m_choiceAntialiasing->SetSelection( UTIL::GetConfigForVal(
aaModeSelectMap, m_galOptions.gl_antialiasing_mode ) );
m_gridStyle->SetSelection( UTIL::GetConfigForVal(
gridStyleSelectMap, m_galOptions.m_gridStyle ) );
@ -245,9 +211,6 @@ bool GAL_OPTIONS_PANEL::TransferDataToWindow()
bool GAL_OPTIONS_PANEL::TransferDataFromWindow()
{
m_galOptions.gl_antialiasing_mode = UTIL::GetValFromConfig(
aaModeSelectMap, m_choiceAntialiasing->GetSelection() );
m_galOptions.m_gridStyle = UTIL::GetValFromConfig(
gridStyleSelectMap, m_gridStyle->GetSelection() );

View File

@ -71,6 +71,8 @@ set( EESCHEMA_DLGS
dialogs/dialog_sch_sheet_props_base.cpp
dialogs/dialog_schematic_find.cpp
dialogs/dialog_schematic_find_base.cpp
dialogs/dialog_set_grid.cpp
dialogs/dialog_set_grid_base.cpp
dialogs/dialog_symbol_remap.cpp
dialogs/dialog_symbol_remap_base.cpp
dialogs/dialog_update_fields.cpp

View File

@ -0,0 +1,91 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 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 <dialog_set_grid_base.h>
#include <common.h>
#include <sch_base_frame.h>
#include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
#include <sch_view.h>
#include <gal/graphics_abstraction_layer.h>
class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE
{
SCH_BASE_FRAME* m_frame;
public:
DIALOG_SET_GRID( SCH_BASE_FRAME* aParent );
bool TransferDataFromWindow() override;
bool TransferDataToWindow() override;
};
DIALOG_SET_GRID::DIALOG_SET_GRID( SCH_BASE_FRAME* aParent ):
DIALOG_SET_GRID_BASE( aParent ),
m_frame( aParent )
{
m_sdbSizerOK->SetDefault();
FinishDialogSettings();
}
bool DIALOG_SET_GRID::TransferDataToWindow()
{
const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids();
for( size_t i = 0; i < gridSizes.size(); i++ )
{
m_choiceGridSize->Append( wxString::Format( wxT( "%0.1f" ), gridSizes[i].m_Size.x ) );
if( gridSizes[i].m_CmdId == m_frame->GetScreen()->GetGridCmdId() )
m_choiceGridSize->SetSelection( (int) i );
}
return true;
}
bool DIALOG_SET_GRID::TransferDataFromWindow()
{
const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids();
wxRealPoint gridSize = gridSizes[ (size_t) m_choiceGridSize->GetSelection() ].m_Size;
m_frame->SetLastGridSizeId( m_frame->GetScreen()->SetGrid( gridSize ) );
m_frame->GetCanvas()->GetView()->GetGAL()->SetGridSize( VECTOR2D( gridSize ) );
m_frame->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
return true;
}
void SCH_BASE_FRAME::OnGridSettings( wxCommandEvent& aEvent )
{
DIALOG_SET_GRID dlg( this );
dlg.ShowModal();
}

View File

@ -0,0 +1,71 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_set_grid_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer32;
fgSizer32 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer32->AddGrowableCol( 1 );
fgSizer32->SetFlexibleDirection( wxBOTH );
fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizer32->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
wxArrayString m_choiceGridSizeChoices;
m_choiceGridSize = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 );
m_choiceGridSize->SetSelection( 0 );
fgSizer32->Add( m_choiceGridSize, 0, wxEXPAND|wxLEFT, 5 );
m_units = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_units->Wrap( -1 );
fgSizer32->Add( m_units, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
bSizerMain->Add( fgSizer32, 1, wxEXPAND|wxALL, 15 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SET_GRID_BASE::OnInitDlg ) );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnOkClick ), NULL, this );
}
DIALOG_SET_GRID_BASE::~DIALOG_SET_GRID_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SET_GRID_BASE::OnInitDlg ) );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnOkClick ), NULL, this );
}

View File

@ -0,0 +1,478 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_set_grid_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_set_grid</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_SET_GRID_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Grid Settings</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog">OnInitDlg</event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">15</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size">-1,-1</property>
<property name="name">fgSizer32</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Grid size:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText3</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choiceGridSize</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">mils</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_units</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick">OnCancelClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick">OnOkClick</event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,59 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_SET_GRID_BASE_H__
#define __DIALOG_SET_GRID_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_SET_GRID_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_SET_GRID_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_staticText3;
wxChoice* m_choiceGridSize;
wxStaticText* m_units;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Grid Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~DIALOG_SET_GRID_BASE();
};
#endif //__DIALOG_SET_GRID_BASE_H__

View File

@ -29,27 +29,23 @@
#include <sch_painter.h>
#include <class_libentry.h>
#include <panel_eeschema_display_options.h>
#include <widgets/gal_options_panel.h>
PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame,
wxWindow* aWindow ) :
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( aWindow ),
m_frame( aFrame )
{}
{
KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions();
m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
}
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
{
const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids();
for( size_t i = 0; i < gridSizes.size(); i++ )
{
m_choiceGridSize->Append( wxString::Format( wxT( "%0.1f" ), gridSizes[i].m_Size.x ) );
if( gridSizes[i].m_CmdId == m_frame->GetScreen()->GetGridCmdId() )
m_choiceGridSize->SetSelection( (int) i );
}
// Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
int refStyleSelection;
@ -66,10 +62,10 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
m_busWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultBusThickness(), false, true ) );
m_lineWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) );
m_checkShowGrid->SetValue( m_frame->IsGridVisible() );
m_checkShowHiddenPins->SetValue( m_frame->GetShowAllPins() );
m_checkPageLimits->SetValue( m_frame->ShowPageLimits() );
m_footprintPreview->SetValue( m_frame->GetFootprintPreview() );
m_galOptsPanel->TransferDataToWindow();
return true;
}
@ -77,11 +73,6 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
{
const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids();
wxRealPoint gridsize = gridSizes[ (size_t) m_choiceGridSize->GetSelection() ].m_Size;
m_frame->SetLastGridSizeId( m_frame->GetScreen()->SetGrid( gridsize ) );
m_frame->SetGridVisibility( m_checkShowGrid->GetValue() );
// Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
int firstRefId, refSeparator;
@ -108,13 +99,14 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
SetDefaultLineThickness( ValueFromString( INCHES, m_lineWidthCtrl->GetValue(), true ) );
m_frame->SetShowAllPins( m_checkShowHiddenPins->GetValue() );
m_frame->SetShowPageLimits( m_checkPageLimits->GetValue() );
m_frame->SetFootprintPreview( m_footprintPreview->GetValue() );
// Update canvas
m_frame->GetRenderSettings()->m_ShowHiddenPins = m_checkShowHiddenPins->GetValue();
m_frame->GetCanvas()->GetView()->MarkDirty();
m_frame->GetCanvas()->Refresh();
m_galOptsPanel->TransferDataFromWindow();
return true;
}

View File

@ -23,11 +23,14 @@
#include "panel_eeschema_display_options_base.h"
class SCH_EDIT_FRAME;
class GAL_OPTIONS_PANEL;
class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE
{
SCH_EDIT_FRAME* m_frame;
SCH_EDIT_FRAME* m_frame;
GAL_OPTIONS_PANEL* m_galOptsPanel;
public:
PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow );

View File

@ -12,10 +12,15 @@
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
wxBoxSizer* bPanelSizer;
bPanelSizer = new wxBoxSizer( wxVERTICAL );
bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftColumn;
bLeftColumn = new wxBoxSizer( wxVERTICAL );
m_galOptionsSizer = new wxBoxSizer( wxVERTICAL );
bPanelSizer->Add( m_galOptionsSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bRightColumn;
bRightColumn = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer32;
fgSizer32 = new wxFlexGridSizer( 0, 3, 0, 0 );
@ -23,19 +28,6 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
fgSizer32->SetFlexibleDirection( wxBOTH );
fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizer32->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choiceGridSizeChoices;
m_choiceGridSize = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 );
m_choiceGridSize->SetSelection( 0 );
fgSizer32->Add( m_choiceGridSize, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_staticGridUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticGridUnits->Wrap( -1 );
fgSizer32->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer32->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
@ -76,7 +68,7 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText26 = new wxStaticText( this, wxID_ANY, _("&Part ID notation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26 = new wxStaticText( this, wxID_ANY, _("Symbol unit notation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26->Wrap( -1 );
fgSizer32->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
@ -90,32 +82,23 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 );
bLeftColumn->Add( fgSizer32, 0, wxBOTTOM|wxRIGHT, 5 );
bRightColumn->Add( fgSizer32, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 5 );
wxBoxSizer* bSizer92;
bSizer92 = new wxBoxSizer( wxVERTICAL );
m_checkShowGrid = new wxCheckBox( this, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_checkShowHiddenPins = new wxCheckBox( this, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer92->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxALL, 5 );
m_checkPageLimits = new wxCheckBox( this, wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkPageLimits->SetValue(true);
bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxALL, 5 );
bSizer92->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_footprintPreview = new wxCheckBox( this, wxID_ANY, _("Show footprint previews in symbol chooser (experimental)"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_footprintPreview, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
bRightColumn->Add( bSizer92, 0, wxTOP|wxRIGHT, 5 );
bLeftColumn->Add( bSizer92, 0, wxTOP|wxRIGHT, 5 );
bPanelSizer->Add( bLeftColumn, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bPanelSizer->Add( bRightColumn, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bPanelSizer );

View File

@ -81,20 +81,31 @@
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bPanelSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bLeftColumn</property>
<property name="name">m_galOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bRightColumn</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property>
@ -108,260 +119,6 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Grid size:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText3</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choiceGridSize</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">mils</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticGridUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
@ -968,7 +725,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Part ID notation:</property>
<property name="label">Symbol unit notation:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1130,95 +887,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">&amp;Show grid</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkShowGrid</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
@ -1392,104 +1061,6 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show footprint previews in symbol chooser (experimental)</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_footprintPreview</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>

View File

@ -11,15 +11,15 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/sizer.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/panel.h>
@ -33,9 +33,7 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel
private:
protected:
wxStaticText* m_staticText3;
wxChoice* m_choiceGridSize;
wxStaticText* m_staticGridUnits;
wxBoxSizer* m_galOptionsSizer;
wxStaticText* m_busWidthLabel;
wxTextCtrl* m_busWidthCtrl;
wxStaticText* m_busWidthUnits;
@ -44,10 +42,8 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel
wxStaticText* m_lineWidthUnits;
wxStaticText* m_staticText26;
wxChoice* m_choiceSeparatorRefId;
wxCheckBox* m_checkShowGrid;
wxCheckBox* m_checkShowHiddenPins;
wxCheckBox* m_checkPageLimits;
wxCheckBox* m_footprintPreview;
public:

View File

@ -45,6 +45,8 @@ bool PANEL_EESCHEMA_SETTINGS::TransferDataToWindow()
m_spinRepeatLabel->SetValue( m_frame->GetRepeatDeltaLabel() );
m_checkHVOrientation->SetValue( m_frame->GetForceHVLines() );
m_footprintPreview->SetValue( m_frame->GetFootprintPreview() );
m_checkAutoplaceFields->SetValue( m_frame->GetAutoplaceFields() );
m_checkAutoplaceJustify->SetValue( m_frame->GetAutoplaceJustify() );
m_checkAutoplaceAlign->SetValue( m_frame->GetAutoplaceAlign() );
@ -70,6 +72,8 @@ bool PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow()
m_frame->SetRepeatDeltaLabel( m_spinRepeatLabel->GetValue() );
m_frame->SetForceHVLines( m_checkHVOrientation->GetValue() );
m_frame->SetFootprintPreview( m_footprintPreview->GetValue() );
m_frame->SetAutoplaceFields( m_checkAutoplaceFields->GetValue() );
m_frame->SetAutoplaceJustify( m_checkAutoplaceJustify->GetValue() );
m_frame->SetAutoplaceAlign( m_checkAutoplaceAlign->GetValue() );

View File

@ -94,23 +94,29 @@ PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wx
m_checkHVOrientation = new wxCheckBox( this, wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkHVOrientation, 0, wxEXPAND|wxALL, 5 );
bSizer9->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_checkAutoplaceFields = new wxCheckBox( this, wxID_ANY, _("A&utomatically place symbol fields"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_checkAutoplaceJustify = new wxCheckBox( this, wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_checkAutoplaceAlign = new wxCheckBox( this, wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 5 );
m_footprintPreview = new wxCheckBox( this, wxID_ANY, _("Show footprint previews in symbol chooser"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_footprintPreview, 0, wxALL, 5 );
bLeftColumn->Add( bSizer9, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbol Field Automatic Placement") ), wxVERTICAL );
bPanelSizer->Add( bLeftColumn, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_checkAutoplaceFields = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("A&utomatically place symbol fields"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_checkAutoplaceJustify = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_checkAutoplaceAlign = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxALL, 5 );
bLeftColumn->Add( sbSizer1, 0, wxTOP|wxEXPAND, 5 );
bPanelSizer->Add( bLeftColumn, 0, wxRIGHT|wxLEFT, 5 );
this->SetSizer( bPanelSizer );

View File

@ -85,7 +85,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@ -1342,17 +1342,110 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show footprint previews in symbol chooser</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_footprintPreview</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="width">0</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Symbol Field Automatic Placement</property>
<property name="minimum_size"></property>
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@ -1528,7 +1621,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxTOP|wxRIGHT</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -22,6 +22,7 @@
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/statbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
@ -53,6 +54,7 @@ class PANEL_EESCHEMA_SETTINGS_BASE : public wxPanel
wxStaticText* m_staticText16;
wxSpinCtrl* m_spinRepeatLabel;
wxCheckBox* m_checkHVOrientation;
wxCheckBox* m_footprintPreview;
wxCheckBox* m_checkAutoplaceFields;
wxCheckBox* m_checkAutoplaceJustify;
wxCheckBox* m_checkAutoplaceAlign;

View File

@ -68,6 +68,7 @@ enum id_eeschema_frm
ID_EDIT_SYM_LIB_TABLE,
ID_REMAP_SYMBOLS,
ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID,
ID_GRID_SETTINGS,
/* Schematic editor horizontal toolbar IDs */
ID_HIERARCHY,

View File

@ -191,6 +191,10 @@ void prepareViewMenu( wxMenu* aParentMenu )
_( "Show &Grid" ), wxEmptyString,
KiBitmap( grid_xpm ), wxITEM_CHECK );
AddMenuItem( aParentMenu, ID_GRID_SETTINGS,
_( "Grid Settings..." ), wxEmptyString,
KiBitmap( grid_xpm ) );
// Units submenu
wxMenu* unitsSubMenu = new wxMenu;
AddMenuItem( unitsSubMenu, ID_TB_OPTIONS_SELECT_UNIT_INCH,

View File

@ -156,6 +156,8 @@ public:
}
void SetGridOrigin( const wxPoint& aPoint ) override {}
void OnGridSettings( wxCommandEvent& aEvent );
// Virtual from EDA_DRAW_FRAME
// the background color of the draw canvas:
COLOR4D GetDrawBgColor() const override;

View File

@ -294,6 +294,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_MENU( ID_GRID_SETTINGS, SCH_BASE_FRAME::OnGridSettings )
// Tools and buttons for vertical toolbar.
EVT_TOOL( ID_NO_TOOL_SELECTED, SCH_EDIT_FRAME::OnSelectTool )

View File

@ -37,7 +37,8 @@ SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway )
m_statusSizer( nullptr ),
m_previewItem( nullptr )
{
m_galDisplayOptions.ReadConfig( Pgm().CommonSettings(), GAL_DISPLAY_OPTIONS_KEY );
wxConfigBase* eeschemaConfig = GetNewConfig( wxString::FromUTF8( "eeschema" ) );
m_galDisplayOptions.ReadConfig( eeschemaConfig, GAL_DISPLAY_OPTIONS_KEY );
m_preview = new SCH_PREVIEW_PANEL( aParent, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ),
m_galDisplayOptions, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );

View File

@ -50,6 +50,7 @@
#define ENBL_AUTO_PAN_KEY wxT( "AutoPAN" )
#define FILE_HISTORY_SIZE_KEY wxT( "FileHistorySize" )
#define GAL_DISPLAY_OPTIONS_KEY wxT( "GalDisplayOptions" )
#define GAL_ANTIALIASING_MODE_KEY wxT( "OpenGLAntialiasingMode" )
///@}

View File

@ -51,8 +51,6 @@ private:
wxBoxSizer* m_mainSizer;
wxChoice* m_choiceAntialiasing;
wxRadioBox* m_gridStyle;
wxStaticText* l_gridLineWidth;