Commit 020e8759 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio Committed by Wayne Stambaugh

Patch to fix setting grid color in EESchema with some minor changes.

parent efceacbd
...@@ -45,6 +45,7 @@ static ColorButton SheetColorButtons[] = { ...@@ -45,6 +45,7 @@ static ColorButton SheetColorButtons[] = {
{ _( "Sheet" ), LAYER_SHEET }, { _( "Sheet" ), LAYER_SHEET },
{ _( "Sheet file name" ), LAYER_SHEETFILENAME }, { _( "Sheet file name" ), LAYER_SHEETFILENAME },
{ _( "Sheet name" ), LAYER_SHEETNAME }, { _( "Sheet name" ), LAYER_SHEETNAME },
{ _( "Sheet label" ), LAYER_SHEETLABEL },
{ _( "Hierarchical label" ), LAYER_HIERLABEL }, { _( "Hierarchical label" ), LAYER_HIERLABEL },
{ wxT( "" ), -1 } // Sentinel marking end of list. { wxT( "" ), -1 } // Sentinel marking end of list.
}; };
...@@ -291,6 +292,7 @@ void DIALOG_COLOR_CONFIG::UpdateLayerSettings() ...@@ -291,6 +292,7 @@ void DIALOG_COLOR_CONFIG::UpdateLayerSettings()
else else
g_DrawBgColor = BLACK; g_DrawBgColor = BLACK;
m_Parent->SetGridColor( g_LayerDescr.LayerColor[LAYER_GRID] );
m_Parent->Refresh(); m_Parent->Refresh();
} }
......
...@@ -409,8 +409,7 @@ void SCH_EDIT_FRAME::SaveProjectFile( wxWindow* displayframe, bool askoverwrite ...@@ -409,8 +409,7 @@ void SCH_EDIT_FRAME::SaveProjectFile( wxWindow* displayframe, bool askoverwrite
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP, wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP, GetProjectFileParameters() );
GetProjectFileParameters() );
} }
...@@ -460,7 +459,7 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void ) ...@@ -460,7 +459,7 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
return m_configSettings; return m_configSettings;
m_configSettings.push_back( new PARAM_CFG_INT( wxT( "Unite" ), m_configSettings.push_back( new PARAM_CFG_INT( wxT( "Unite" ),
(int*)&g_UserUnit, 0 ) ); (int*)&g_UserUnit, 0 ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ),
&g_LayerDescr.LayerColor[LAYER_WIRE], &g_LayerDescr.LayerColor[LAYER_WIRE],
GREEN ) ); GREEN ) );
...@@ -534,10 +533,13 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void ) ...@@ -534,10 +533,13 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ),
&g_LayerDescr.LayerColor[LAYER_ERC_ERR], &g_LayerDescr.LayerColor[LAYER_ERC_ERR],
RED ) ); RED ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGrid" ),
&g_LayerDescr.LayerColor[LAYER_GRID],
DARKGRAY ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PrintMonochrome" ), m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PrintMonochrome" ),
&m_printMonochrome, true ) ); &m_printMonochrome, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PrintSheetReferenceAndTitleBlock" ), m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PrintSheetReferenceAndTitleBlock" ),
&m_printSheetReference, true ) ); &m_printSheetReference, true ) );
return m_configSettings; return m_configSettings;
} }
...@@ -558,8 +560,10 @@ void SCH_EDIT_FRAME::LoadSettings() ...@@ -558,8 +560,10 @@ void SCH_EDIT_FRAME::LoadSettings()
wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() ); wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() );
g_DrawDefaultLineThickness = cfg->Read( DefaultDrawLineWidthEntry, // This is eqired until someone gets rid of the global variable g_LayerDescription().
(long) 6 ); m_GridColor = g_LayerDescr.LayerColor[LAYER_GRID];
g_DrawDefaultLineThickness = cfg->Read( DefaultDrawLineWidthEntry,(long) 6 );
cfg->Read( ShowHiddenPinsEntry, &m_ShowAllPins, false ); cfg->Read( ShowHiddenPinsEntry, &m_ShowAllPins, false );
cfg->Read( HorzVertLinesOnlyEntry, &g_HVLines, true ); cfg->Read( HorzVertLinesOnlyEntry, &g_HVLines, true );
...@@ -633,8 +637,8 @@ void SCH_EDIT_FRAME::LoadSettings() ...@@ -633,8 +637,8 @@ void SCH_EDIT_FRAME::LoadSettings()
catch( IO_ERROR e ) catch( IO_ERROR e )
{ {
// @todo show error msg // @todo show error msg
D(printf("templatefieldnames parsing error: '%s'\n", D( printf( "templatefieldnames parsing error: '%s'\n",
CONV_TO_UTF8(e.errorText) );) CONV_TO_UTF8( e.errorText ) ); )
} }
} }
...@@ -711,7 +715,6 @@ void SCH_EDIT_FRAME::SaveSettings() ...@@ -711,7 +715,6 @@ void SCH_EDIT_FRAME::SaveSettings()
record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
record.Replace( wxT(" "), wxT(" "), true ); // double space to single record.Replace( wxT(" "), wxT(" "), true ); // double space to single
cfg->Write( FieldNamesEntry, record ); cfg->Write( FieldNamesEntry, record );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment