Commit c7d04c3d authored by jean-pierre charras's avatar jean-pierre charras

Code cleaning: Remove EDA_BASE_FRAME::m_FrameName member which is a duplicate of wxFrame name.

parent 9716165d
......@@ -226,24 +226,26 @@ void EDA_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
{
int maximized = 0;
wxString text = m_FrameName + wxT( "Pos_x" );
wxString baseCfgName = GetName();
wxString text = baseCfgName + wxT( "Pos_x" );
aCfg->Read( text, &m_FramePos.x );
text = m_FrameName + wxT( "Pos_y" );
text = baseCfgName + wxT( "Pos_y" );
aCfg->Read( text, &m_FramePos.y );
text = m_FrameName + wxT( "Size_x" );
text = baseCfgName + wxT( "Size_x" );
aCfg->Read( text, &m_FrameSize.x, 600 );
text = m_FrameName + wxT( "Size_y" );
text = baseCfgName + wxT( "Size_y" );
aCfg->Read( text, &m_FrameSize.y, 400 );
text = m_FrameName + wxT( "Maximized" );
text = baseCfgName + wxT( "Maximized" );
aCfg->Read( text, &maximized, 0 );
if( m_hasAutoSave )
{
text = m_FrameName + entryAutoSaveInterval;
text = baseCfgName + entryAutoSaveInterval;
aCfg->Read( text, &m_autoSaveInterval, DEFAULT_AUTO_SAVE_INTERVAL );
}
......@@ -261,7 +263,7 @@ void EDA_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
if( maximized )
Maximize();
aCfg->Read( m_FrameName + entryPerspective, &m_perspective );
aCfg->Read( baseCfgName + entryPerspective, &m_perspective );
}
......@@ -272,27 +274,29 @@ void EDA_BASE_FRAME::SaveSettings( wxConfigBase* aCfg )
if( IsIconized() )
return;
wxString baseCfgName = GetName();
m_FrameSize = GetSize();
m_FramePos = GetPosition();
text = m_FrameName + wxT( "Pos_x" );
text = baseCfgName + wxT( "Pos_x" );
aCfg->Write( text, (long) m_FramePos.x );
text = m_FrameName + wxT( "Pos_y" );
text = baseCfgName + wxT( "Pos_y" );
aCfg->Write( text, (long) m_FramePos.y );
text = m_FrameName + wxT( "Size_x" );
text = baseCfgName + wxT( "Size_x" );
aCfg->Write( text, (long) m_FrameSize.x );
text = m_FrameName + wxT( "Size_y" );
text = baseCfgName + wxT( "Size_y" );
aCfg->Write( text, (long) m_FrameSize.y );
text = m_FrameName + wxT( "Maximized" );
text = baseCfgName + wxT( "Maximized" );
aCfg->Write( text, IsMaximized() );
if( m_hasAutoSave )
{
text = m_FrameName + entryAutoSaveInterval;
text = baseCfgName + entryAutoSaveInterval;
aCfg->Write( text, m_autoSaveInterval );
}
......@@ -303,7 +307,7 @@ void EDA_BASE_FRAME::SaveSettings( wxConfigBase* aCfg )
// printf( "perspective(%s): %s\n",
// TO_UTF8( m_FrameName + entryPerspective ), TO_UTF8( perspective ) );
aCfg->Write( m_FrameName + entryPerspective, perspective );
aCfg->Write( baseCfgName + entryPerspective, perspective );
}
......
......@@ -642,17 +642,19 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
{
EDA_BASE_FRAME::LoadSettings( aCfg );
aCfg->Read( m_FrameName + CursorShapeEntryKeyword, &m_cursorShape, ( long )0 );
wxString baseCfgName = GetName();
aCfg->Read( baseCfgName + CursorShapeEntryKeyword, &m_cursorShape, ( long )0 );
bool btmp;
if( aCfg->Read( m_FrameName + ShowGridEntryKeyword, &btmp ) )
if( aCfg->Read( baseCfgName + ShowGridEntryKeyword, &btmp ) )
SetGridVisibility( btmp );
int itmp;
if( aCfg->Read( m_FrameName + GridColorEntryKeyword, &itmp ) )
if( aCfg->Read( baseCfgName + GridColorEntryKeyword, &itmp ) )
SetGridColor( ColorFromInt( itmp ) );
aCfg->Read( m_FrameName + LastGridSizeIdKeyword, &m_LastGridSizeId, 0L );
aCfg->Read( baseCfgName + LastGridSizeIdKeyword, &m_LastGridSizeId, 0L );
// m_LastGridSizeId is an offset, expected to be >= 0
if( m_LastGridSizeId < 0 )
......@@ -664,10 +666,12 @@ void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg )
{
EDA_BASE_FRAME::SaveSettings( aCfg );
aCfg->Write( m_FrameName + CursorShapeEntryKeyword, m_cursorShape );
aCfg->Write( m_FrameName + ShowGridEntryKeyword, IsGridVisible() );
aCfg->Write( m_FrameName + GridColorEntryKeyword, ( long ) GetGridColor() );
aCfg->Write( m_FrameName + LastGridSizeIdKeyword, ( long ) m_LastGridSizeId );
wxString baseCfgName = GetName();
aCfg->Write( baseCfgName + CursorShapeEntryKeyword, m_cursorShape );
aCfg->Write( baseCfgName + ShowGridEntryKeyword, IsGridVisible() );
aCfg->Write( baseCfgName + GridColorEntryKeyword, ( long ) GetGridColor() );
aCfg->Write( baseCfgName + LastGridSizeIdKeyword, ( long ) m_LastGridSizeId );
}
......
......@@ -534,7 +534,7 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList,
}
else
{
wxFileName fn( m_FrameName );
wxFileName fn( GetName() );
fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
wxConfigBase* config = GetNewConfig( fn.GetFullPath() );
config->Write( HOTKEYS_CONFIG_KEY, msg );
......@@ -604,7 +604,7 @@ void ReadHotkeyConfig( const wxString& Appname, struct EDA_HOTKEY_CONFIG* aDescL
*/
int EDA_BASE_FRAME::ReadHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList )
{
::ReadHotkeyConfig( m_FrameName, aDescList );
::ReadHotkeyConfig( GetName(), aDescList );
return 1;
}
......
......@@ -76,7 +76,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRA
wxDefaultPosition, wxDefaultSize,
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME )
{
m_FrameName = FOOTPRINTVIEWER_FRAME_NAME;
m_showAxis = true; // true to draw axis.
// Give an icon
......
......@@ -104,7 +104,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, wxT( "CvPCB" ), wxDefaultPosition,
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, CVPCB_MAINFRAME_NAME )
{
m_FrameName = CVPCB_MAINFRAME_NAME;
m_compListBox = NULL;
m_footprintListBox = NULL;
m_libListBox = NULL;
......
......@@ -184,7 +184,6 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
{
wxASSERT( aParent );
m_FrameName = GetLibEditFrameName();
m_showAxis = true; // true to draw axis
m_configPath = wxT( "LibraryEditor" );
SetShowDeMorgan( false );
......
......@@ -307,7 +307,6 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, SCH_EDIT_FRAME_NAME ),
m_item_to_repeat( 0 )
{
m_FrameName = SCH_EDIT_FRAME_NAME;
m_showAxis = false; // true to show axis
m_showBorderAndTitleBlock = true; // true to show sheet references
m_CurrentSheet = new SCH_SHEET_PATH;
......
......@@ -92,7 +92,6 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
if( aFrameType == FRAME_SCH_VIEWER_MODAL )
SetModal( true );
m_FrameName = GetLibViewerFrameName();
m_configPath = wxT( "LibraryViewer" );
// Give an icon
......
......@@ -76,7 +76,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
PAGE_INFO pageInfo( wxT( "GERBER" ) );
SetPageSettings( pageInfo );
m_FrameName = GERBVIEW_FRAME_NAME;
m_show_layer_manager_tools = true;
m_showAxis = true; // true to show X and Y axis on screen
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009-2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009-2015 Jean-Pierre Charras, jp.charras wanadoo.fr
* Copyright (C) 2011-2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
......@@ -118,8 +118,7 @@ protected:
wxSize m_FrameSize;
wxAuiToolBar* m_mainToolBar; ///< Standard horizontal Toolbar
wxString m_FrameName; ///< name used for writing and reading setup
///< It is "SchematicFrame", "PcbFrame" ....
wxString m_AboutTitle; ///< Name of program displayed in About.
wxAuiManager m_auimgr;
......@@ -197,8 +196,6 @@ public:
int GetAutoSaveInterval() const { return m_autoSaveInterval; }
wxString GetName() const { return m_FrameName; }
bool IsType( FRAME_T aType ) const { return m_Ident == aType; }
void GetKicadHelp( wxCommandEvent& event );
......
......@@ -52,7 +52,6 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent,
{
m_leftWinWidth = 60;
m_manager_Hokeys_Descr = NULL;
m_FrameName = KICAD_MANAGER_FRAME_NAME;
// Create the status line (bottom of the frame
static const int dims[3] = { -1, -1, 100 };
......
......@@ -54,7 +54,6 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
EDA_DRAW_FRAME( aKiway, aParent, FRAME_PL_EDITOR, wxT( "PlEditorFrame" ),
wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PL_EDITOR_FRAME_NAME )
{
m_FrameName = PL_EDITOR_FRAME_NAME;
m_zoomLevelCoeff = 290.0; // Adjusted to roughly displays zoom level = 1
// when the screen shows a 1:1 image
// obviously depends on the monitor,
......
......@@ -752,23 +752,25 @@ void PCB_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
(m_LastGridSizeId > (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000;
aCfg->Read( m_FrameName + UserGridSizeXEntry, &m_UserGridSize.x, 0.01 );
aCfg->Read( m_FrameName + UserGridSizeYEntry, &m_UserGridSize.y, 0.01 );
wxString baseCfgName = GetName();
aCfg->Read( baseCfgName + UserGridSizeXEntry, &m_UserGridSize.x, 0.01 );
aCfg->Read( baseCfgName + UserGridSizeYEntry, &m_UserGridSize.y, 0.01 );
long itmp;
aCfg->Read( m_FrameName + UserGridUnitsEntry, &itmp, ( long )INCHES );
aCfg->Read( baseCfgName + UserGridUnitsEntry, &itmp, ( long )INCHES );
m_UserGridUnit = (EDA_UNITS_T) itmp;
aCfg->Read( m_FrameName + DisplayPadFillEntry, &m_DisplayOptions.m_DisplayPadFill, true );
aCfg->Read( m_FrameName + DisplayViaFillEntry, &m_DisplayOptions.m_DisplayViaFill, true );
aCfg->Read( m_FrameName + DisplayPadNumberEntry, &m_DisplayOptions.m_DisplayPadNum, true );
aCfg->Read( m_FrameName + DisplayModuleEdgeEntry, &m_DisplayOptions.m_DisplayModEdgeFill, true );
aCfg->Read( baseCfgName + DisplayPadFillEntry, &m_DisplayOptions.m_DisplayPadFill, true );
aCfg->Read( baseCfgName + DisplayViaFillEntry, &m_DisplayOptions.m_DisplayViaFill, true );
aCfg->Read( baseCfgName + DisplayPadNumberEntry, &m_DisplayOptions.m_DisplayPadNum, true );
aCfg->Read( baseCfgName + DisplayModuleEdgeEntry, &m_DisplayOptions.m_DisplayModEdgeFill, true );
aCfg->Read( m_FrameName + FastGrid1Entry, &itmp, ( long )0);
aCfg->Read( baseCfgName + FastGrid1Entry, &itmp, ( long )0);
m_FastGrid1 = itmp;
aCfg->Read( m_FrameName + FastGrid2Entry, &itmp, ( long )0);
aCfg->Read( baseCfgName + FastGrid2Entry, &itmp, ( long )0);
m_FastGrid2 = itmp;
aCfg->Read( m_FrameName + DisplayModuleTextEntry, &m_DisplayOptions.m_DisplayModTextFill, true );
aCfg->Read( baseCfgName + DisplayModuleTextEntry, &m_DisplayOptions.m_DisplayModTextFill, true );
}
......@@ -776,16 +778,18 @@ void PCB_BASE_FRAME::SaveSettings( wxConfigBase* aCfg )
{
EDA_DRAW_FRAME::SaveSettings( aCfg );
aCfg->Write( m_FrameName + UserGridSizeXEntry, m_UserGridSize.x );
aCfg->Write( m_FrameName + UserGridSizeYEntry, m_UserGridSize.y );
aCfg->Write( m_FrameName + UserGridUnitsEntry, ( long )m_UserGridUnit );
aCfg->Write( m_FrameName + DisplayPadFillEntry, m_DisplayOptions.m_DisplayPadFill );
aCfg->Write( m_FrameName + DisplayViaFillEntry, m_DisplayOptions.m_DisplayViaFill );
aCfg->Write( m_FrameName + DisplayPadNumberEntry, m_DisplayOptions.m_DisplayPadNum );
aCfg->Write( m_FrameName + DisplayModuleEdgeEntry, m_DisplayOptions.m_DisplayModEdgeFill );
aCfg->Write( m_FrameName + DisplayModuleTextEntry, m_DisplayOptions.m_DisplayModTextFill );
aCfg->Write( m_FrameName + FastGrid1Entry, ( long )m_FastGrid1 );
aCfg->Write( m_FrameName + FastGrid2Entry, ( long )m_FastGrid2 );
wxString baseCfgName = GetName();
aCfg->Write( baseCfgName + UserGridSizeXEntry, m_UserGridSize.x );
aCfg->Write( baseCfgName + UserGridSizeYEntry, m_UserGridSize.y );
aCfg->Write( baseCfgName + UserGridUnitsEntry, ( long )m_UserGridUnit );
aCfg->Write( baseCfgName + DisplayPadFillEntry, m_DisplayOptions.m_DisplayPadFill );
aCfg->Write( baseCfgName + DisplayViaFillEntry, m_DisplayOptions.m_DisplayViaFill );
aCfg->Write( baseCfgName + DisplayPadNumberEntry, m_DisplayOptions.m_DisplayPadNum );
aCfg->Write( baseCfgName + DisplayModuleEdgeEntry, m_DisplayOptions.m_DisplayModEdgeFill );
aCfg->Write( baseCfgName + DisplayModuleTextEntry, m_DisplayOptions.m_DisplayModTextFill );
aCfg->Write( baseCfgName + FastGrid1Entry, ( long )m_FastGrid1 );
aCfg->Write( baseCfgName + FastGrid2Entry, ( long )m_FastGrid2 );
}
......
......@@ -129,7 +129,6 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway,
wxAcceleratorTable table( ACCEL_TABLE_CNT, accels );
m_FrameName = FOOTPRINT_WIZARD_FRAME_NAME;
m_configPath = wxT( "FootprintWizard" );
m_showAxis = true; // true to draw axis.
......
......@@ -199,7 +199,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
wxDefaultPosition, wxDefaultSize,
KICAD_DEFAULT_DRAWFRAME_STYLE, GetFootprintEditorFrameName() )
{
m_FrameName = GetFootprintEditorFrameName();
m_showBorderAndTitleBlock = false; // true to show the frame references
m_showAxis = true; // true to show X and Y axis on screen
m_showGridAxis = true; // show the grid origin axis
......
......@@ -113,7 +113,6 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
if( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL )
SetModal( true );
m_FrameName = GetFootprintViewerFrameName();
m_configPath = wxT( "FootprintViewer" );
m_showAxis = true; // true to draw axis.
......
......@@ -305,7 +305,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB, wxT( "Pcbnew" ), wxDefaultPosition,
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PCB_EDIT_FRAME_NAME )
{
m_FrameName = PCB_EDIT_FRAME_NAME;
m_showBorderAndTitleBlock = true; // true to display sheet references
m_showAxis = false; // true to display X and Y axis
m_showOriginAxis = true;
......
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