Commit 9461f162 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Encapsulate SCH_EDIT_FRAME and LIB_EDIT_FRAME classes.

parent 4cb29f61
///////////////////////////////////////////////////////////////////////////// /*
// Name: dialog_eeschema_config.cpp * This program source code file is part of KiCad, a free EDA CAD application.
// Purpose: *
// Author: jean-pierre Charras * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
// Created: 17/02/2006 21:14:46 * Copyright (C) 2006-2011 KiCad Developers, see change_log.txt for contributors.
// Copyright: KiCad Team *
// Licence: GPL * 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
*/
/**
* @file dialog_eeschema_config.cpp
*/
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
...@@ -50,9 +69,9 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -50,9 +69,9 @@ void DIALOG_EESCHEMA_CONFIG::Init()
m_LibListChanged = false; m_LibListChanged = false;
m_LibPathChanged = false; m_LibPathChanged = false;
m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath; m_UserLibDirBufferImg = m_Parent->GetUserLibraryPath();
m_ListLibr->InsertItems( m_Parent->m_ComponentLibFiles, 0 ); m_ListLibr->InsertItems( m_Parent->GetComponentLibraries(), 0 );
// Load user libs paths: // Load user libs paths:
wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) ); wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) );
...@@ -154,7 +173,8 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) ...@@ -154,7 +173,8 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
{ {
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii++ )
wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii) ); wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii) );
wxGetApp().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1);
wxGetApp().InsertLibraryPath( m_Parent->GetUserLibraryPath(), 1);
} }
EndModal( wxID_CANCEL ); EndModal( wxID_CANCEL );
...@@ -166,15 +186,17 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) ...@@ -166,15 +186,17 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
// Recreate the user lib path // Recreate the user lib path
if ( m_LibPathChanged ) if ( m_LibPathChanged )
{ {
m_Parent->m_UserLibraryPath.Empty(); wxString path;
for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ ) for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ )
{ {
if ( ii > 0 ) if ( ii > 0 )
m_Parent->m_UserLibraryPath << wxT( ";" ); path << wxT( ";" );
m_Parent->m_UserLibraryPath << m_listUserPaths->GetString( ii ); path << m_listUserPaths->GetString( ii );
} }
m_Parent->SetUserLibraryPath( path );
} }
/* Set new active library list if the lib list of if default path list /* Set new active library list if the lib list of if default path list
...@@ -182,11 +204,13 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) ...@@ -182,11 +204,13 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
*/ */
if( m_LibListChanged || m_LibPathChanged ) if( m_LibListChanged || m_LibPathChanged )
{ {
// Recreate lib list wxArrayString list;
m_Parent->m_ComponentLibFiles.Clear();
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ )
m_Parent->m_ComponentLibFiles.Add(m_ListLibr->GetString( ii ) ); list.Add( m_ListLibr->GetString( ii ) );
// Recreate lib list
m_Parent->SetComponentLibraries( list );
// take new list in account // take new list in account
m_Parent->LoadLibraries(); m_Parent->LoadLibraries();
...@@ -298,6 +322,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -298,6 +322,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND ) if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
{ {
m_LibListChanged = TRUE; m_LibListChanged = TRUE;
if( event.GetId() == ID_ADD_LIB ) if( event.GetId() == ID_ADD_LIB )
m_ListLibr->Append( libfilename ); m_ListLibr->Append( libfilename );
else else
...@@ -306,7 +331,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -306,7 +331,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
else else
{ {
wxString msg = wxT( "<" ) + libfilename + wxT( "> : " ) + wxString msg = wxT( "<" ) + libfilename + wxT( "> : " ) +
_( "Library already in use" ); _( "Library already in use" );
DisplayError( this, msg ); DisplayError( this, msg );
} }
} }
......
...@@ -34,17 +34,17 @@ void SCH_EDIT_FRAME::LoadLibraries( void ) ...@@ -34,17 +34,17 @@ void SCH_EDIT_FRAME::LoadLibraries( void )
continue; continue;
} }
if( m_ComponentLibFiles.Index( i->GetName(), false ) == wxNOT_FOUND ) if( m_componentLibFiles.Index( i->GetName(), false ) == wxNOT_FOUND )
i = CMP_LIBRARY::GetLibraryList().erase( i ); i = CMP_LIBRARY::GetLibraryList().erase( i );
else else
i++; i++;
} }
/* Load missing libraries. */ /* Load missing libraries. */
for( ii = 0; ii < m_ComponentLibFiles.GetCount(); ii++ ) for( ii = 0; ii < m_componentLibFiles.GetCount(); ii++ )
{ {
fn.Clear(); fn.Clear();
fn.SetName( m_ComponentLibFiles[ii] ); fn.SetName( m_componentLibFiles[ii] );
fn.SetExt( CompLibFileExtension ); fn.SetExt( CompLibFileExtension );
/* Skip if the file name is not valid.. */ /* Skip if the file name is not valid.. */
......
...@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetRepeatLabel( g_RepeatDeltaLabel ); dlg.SetRepeatLabel( g_RepeatDeltaLabel );
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowGrid( IsGridVisible() );
dlg.SetShowHiddenPins( m_ShowAllPins ); dlg.SetShowHiddenPins( m_showAllPins );
dlg.SetEnableAutoPan( DrawPanel->m_AutoPAN_Enable ); dlg.SetEnableAutoPan( DrawPanel->m_AutoPAN_Enable );
dlg.SetEnableHVBusOrientation( g_HVLines ); dlg.SetEnableHVBusOrientation( g_HVLines );
dlg.SetShowPageLimits( g_ShowPageLimits ); dlg.SetShowPageLimits( g_ShowPageLimits );
...@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
g_RepeatDeltaLabel = dlg.GetRepeatLabel(); g_RepeatDeltaLabel = dlg.GetRepeatLabel();
SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 ); SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 );
SetGridVisibility( dlg.GetShowGrid() ); SetGridVisibility( dlg.GetShowGrid() );
m_ShowAllPins = dlg.GetShowHiddenPins(); m_showAllPins = dlg.GetShowHiddenPins();
DrawPanel->m_AutoPAN_Enable = dlg.GetEnableAutoPan(); DrawPanel->m_AutoPAN_Enable = dlg.GetEnableAutoPan();
g_HVLines = dlg.GetEnableHVBusOrientation(); g_HVLines = dlg.GetEnableHVBusOrientation();
g_ShowPageLimits = dlg.GetShowPageLimits(); g_ShowPageLimits = dlg.GetShowPageLimits();
...@@ -258,12 +258,12 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters() ...@@ -258,12 +258,12 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
return m_projectFileParams; return m_projectFileParams;
m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LibDir" ), m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LibDir" ),
&m_UserLibraryPath ) ); &m_userLibraryPath ) );
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ComponentLibFiles, &m_componentLibFiles,
GROUPLIB ) ); GROUPLIB ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "NetFmt" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "NetFmt" ),
&m_NetlistFormat, &m_netListFormat,
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
NET_TYPE_CUSTOM_MAX ) ); NET_TYPE_CUSTOM_MAX ) );
...@@ -340,37 +340,37 @@ bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& aFileName, bool aForceRere ...@@ -340,37 +340,37 @@ bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& aFileName, bool aForceRere
{ {
wxFileName fn; wxFileName fn;
bool IsRead = true; bool IsRead = true;
wxArrayString liblist_tmp = m_ComponentLibFiles; wxArrayString liblist_tmp = m_componentLibFiles;
if( aFileName.IsEmpty() ) if( aFileName.IsEmpty() )
fn = g_RootSheet->GetScreen()->GetFileName(); fn = g_RootSheet->GetScreen()->GetFileName();
else else
fn = aFileName; fn = aFileName;
m_ComponentLibFiles.Clear(); m_componentLibFiles.Clear();
/* Change the schematic file extension (.sch) to the project file /* Change the schematic file extension (.sch) to the project file
* extension (.pro). */ * extension (.pro). */
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
wxGetApp().RemoveLibraryPath( m_UserLibraryPath ); wxGetApp().RemoveLibraryPath( m_userLibraryPath );
if( !wxGetApp().ReadProjectConfig( fn.GetFullPath(), GROUP, if( !wxGetApp().ReadProjectConfig( fn.GetFullPath(), GROUP,
GetProjectFileParameters(), GetProjectFileParameters(),
!aForceReread ) ) !aForceReread ) )
{ {
m_ComponentLibFiles = liblist_tmp; m_componentLibFiles = liblist_tmp;
IsRead = false; IsRead = false;
} }
/* User library path takes precedent over default library search paths. */ /* User library path takes precedent over default library search paths. */
wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 ); wxGetApp().InsertLibraryPath( m_userLibraryPath, 1 );
/* If the list is void, force loading the library "power.lib" that is /* If the list is void, force loading the library "power.lib" that is
* the "standard" library for power symbols. * the "standard" library for power symbols.
*/ */
if( m_ComponentLibFiles.GetCount() == 0 ) if( m_componentLibFiles.GetCount() == 0 )
m_ComponentLibFiles.Add( wxT( "power" ) ); m_componentLibFiles.Add( wxT( "power" ) );
LoadLibraries(); LoadLibraries();
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
...@@ -526,7 +526,7 @@ void SCH_EDIT_FRAME::LoadSettings() ...@@ -526,7 +526,7 @@ void SCH_EDIT_FRAME::LoadSettings()
m_GridColor = g_LayerDescr.LayerColor[LAYER_GRID]; m_GridColor = g_LayerDescr.LayerColor[LAYER_GRID];
g_DrawDefaultLineThickness = cfg->Read( DefaultDrawLineWidthEntry,(long) 6 ); 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 );
/* Load print preview window session settings. */ /* Load print preview window session settings. */
...@@ -617,7 +617,7 @@ void SCH_EDIT_FRAME::SaveSettings() ...@@ -617,7 +617,7 @@ void SCH_EDIT_FRAME::SaveSettings()
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() ); wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
cfg->Write( DefaultDrawLineWidthEntry, (long) g_DrawDefaultLineThickness ); cfg->Write( DefaultDrawLineWidthEntry, (long) g_DrawDefaultLineThickness );
cfg->Write( ShowHiddenPinsEntry, m_ShowAllPins ); cfg->Write( ShowHiddenPinsEntry, m_showAllPins );
cfg->Write( HorzVertLinesOnlyEntry, g_HVLines ); cfg->Write( HorzVertLinesOnlyEntry, g_HVLines );
/* Save print preview window session settings. */ /* Save print preview window session settings. */
......
...@@ -58,7 +58,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event ) ...@@ -58,7 +58,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
wxFileDialog dlg( this, _( "Import Component" ), m_LastLibImportPath, wxFileDialog dlg( this, _( "Import Component" ), m_lastLibImportPath,
wxEmptyString, CompLibFileWildcard, wxEmptyString, CompLibFileWildcard,
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); wxFD_OPEN | wxFD_FILE_MUST_EXIST );
...@@ -86,7 +86,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event ) ...@@ -86,7 +86,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
if( LoadOneLibraryPartAux( LibEntry, LibTmp ) ) if( LoadOneLibraryPartAux( LibEntry, LibTmp ) )
{ {
fn = dlg.GetPath(); fn = dlg.GetPath();
m_LastLibImportPath = fn.GetPath(); m_lastLibImportPath = fn.GetPath();
DisplayLibInfos(); DisplayLibInfos();
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
DrawPanel->Refresh(); DrawPanel->Refresh();
...@@ -143,7 +143,7 @@ void LIB_EDIT_FRAME::OnExportPart( wxCommandEvent& event ) ...@@ -143,7 +143,7 @@ void LIB_EDIT_FRAME::OnExportPart( wxCommandEvent& event )
bool success = m_library->Save( formatter ); bool success = m_library->Save( formatter );
if( success ) if( success )
m_LastLibExportPath = fn.GetPath(); m_lastLibExportPath = fn.GetPath();
delete m_library; delete m_library;
m_library = CurLibTmp; m_library = CurLibTmp;
......
...@@ -812,16 +812,17 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel, ...@@ -812,16 +812,17 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel,
{ {
// Invisible pins are only drawn on request. // Invisible pins are only drawn on request.
// They are drawn in g_InvisibleItemColor. // They are drawn in g_InvisibleItemColor.
// in schematic, they are drawn only if m_ShowAllPins is true. // in schematic, they are drawn only if m_showAllPins is true.
// In other windows, they are always drawn because we must see them. // In other windows, they are always drawn because we must see them.
if( ! IsVisible() ) if( ! IsVisible() )
{ {
EDA_DRAW_FRAME* frame = NULL; EDA_DRAW_FRAME* frame = NULL;
if( aPanel && aPanel->GetParent() ) if( aPanel && aPanel->GetParent() )
frame = (EDA_DRAW_FRAME*)aPanel->GetParent(); frame = (EDA_DRAW_FRAME*)aPanel->GetParent();
if( frame && frame->IsType( SCHEMATIC_FRAME ) && if( frame && frame->IsType( SCHEMATIC_FRAME ) &&
! ((SCH_EDIT_FRAME*)frame)->m_ShowAllPins ) ! ((SCH_EDIT_FRAME*)frame)->GetShowAllPins() )
return; return;
aColor = g_InvisibleItemColor; aColor = g_InvisibleItemColor;
......
...@@ -195,7 +195,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, ...@@ -195,7 +195,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
m_FrameName = wxT( "LibeditFrame" ); m_FrameName = wxT( "LibeditFrame" );
m_Draw_Axis = true; // true to draw axis m_Draw_Axis = true; // true to draw axis
m_ConfigPath = wxT( "LibraryEditor" ); m_configPath = wxT( "LibraryEditor" );
SetShowDeMorgan( false ); SetShowDeMorgan( false );
m_drawSpecificConvert = true; m_drawSpecificConvert = true;
m_drawSpecificUnit = false; m_drawSpecificUnit = false;
...@@ -291,11 +291,11 @@ void LIB_EDIT_FRAME::LoadSettings() ...@@ -291,11 +291,11 @@ void LIB_EDIT_FRAME::LoadSettings()
EDA_DRAW_FRAME::LoadSettings(); EDA_DRAW_FRAME::LoadSettings();
wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_ConfigPath ); wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_configPath );
cfg = wxGetApp().m_EDA_Config; cfg = wxGetApp().m_EDA_Config;
m_LastLibExportPath = cfg->Read( lastLibExportPathEntry, ::wxGetCwd() ); m_lastLibExportPath = cfg->Read( lastLibExportPathEntry, ::wxGetCwd() );
m_LastLibImportPath = cfg->Read( lastLibImportPathEntry, ::wxGetCwd() ); m_lastLibImportPath = cfg->Read( lastLibImportPathEntry, ::wxGetCwd() );
} }
...@@ -312,11 +312,11 @@ void LIB_EDIT_FRAME::SaveSettings() ...@@ -312,11 +312,11 @@ void LIB_EDIT_FRAME::SaveSettings()
EDA_DRAW_FRAME::SaveSettings(); EDA_DRAW_FRAME::SaveSettings();
wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_ConfigPath ); wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_configPath );
cfg = wxGetApp().m_EDA_Config; cfg = wxGetApp().m_EDA_Config;
cfg->Write( lastLibExportPathEntry, m_LastLibExportPath ); cfg->Write( lastLibExportPathEntry, m_lastLibExportPath );
cfg->Write( lastLibImportPathEntry, m_LastLibImportPath ); cfg->Write( lastLibImportPathEntry, m_lastLibImportPath );
} }
...@@ -402,35 +402,35 @@ double LIB_EDIT_FRAME::BestZoom() ...@@ -402,35 +402,35 @@ double LIB_EDIT_FRAME::BestZoom()
void LIB_EDIT_FRAME::UpdateAliasSelectList() void LIB_EDIT_FRAME::UpdateAliasSelectList()
{ {
if( m_SelAliasBox == NULL ) if( m_aliasSelectBox == NULL )
return; return;
m_SelAliasBox->Clear(); m_aliasSelectBox->Clear();
if( m_component == NULL ) if( m_component == NULL )
return; return;
m_SelAliasBox->Append( m_component->GetAliasNames() ); m_aliasSelectBox->Append( m_component->GetAliasNames() );
m_SelAliasBox->SetSelection( 0 ); m_aliasSelectBox->SetSelection( 0 );
int index = m_SelAliasBox->FindString( m_aliasName ); int index = m_aliasSelectBox->FindString( m_aliasName );
if( index != wxNOT_FOUND ) if( index != wxNOT_FOUND )
m_SelAliasBox->SetSelection( index ); m_aliasSelectBox->SetSelection( index );
} }
void LIB_EDIT_FRAME::UpdatePartSelectList() void LIB_EDIT_FRAME::UpdatePartSelectList()
{ {
if( m_SelpartBox == NULL ) if( m_partSelectBox == NULL )
return; return;
if( m_SelpartBox->GetCount() != 0 ) if( m_partSelectBox->GetCount() != 0 )
m_SelpartBox->Clear(); m_partSelectBox->Clear();
if( m_component == NULL || m_component->GetPartCount() <= 1 ) if( m_component == NULL || m_component->GetPartCount() <= 1 )
{ {
m_SelpartBox->Append( wxEmptyString ); m_partSelectBox->Append( wxEmptyString );
} }
else else
{ {
...@@ -438,11 +438,11 @@ void LIB_EDIT_FRAME::UpdatePartSelectList() ...@@ -438,11 +438,11 @@ void LIB_EDIT_FRAME::UpdatePartSelectList()
{ {
wxString msg; wxString msg;
msg.Printf( _( "Part %c" ), 'A' + i ); msg.Printf( _( "Part %c" ), 'A' + i );
m_SelpartBox->Append( msg ); m_partSelectBox->Append( msg );
} }
} }
m_SelpartBox->SetSelection( ( m_unit > 0 ) ? m_unit - 1 : 0 ); m_partSelectBox->SetSelection( ( m_unit > 0 ) ? m_unit - 1 : 0 );
} }
...@@ -510,13 +510,13 @@ void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event ) ...@@ -510,13 +510,13 @@ void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event )
void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event )
{ {
if( m_SelpartBox == NULL ) if( m_partSelectBox == NULL )
return; return;
/* Using the typical event.Enable() call doesn't seem to work with wxGTK /* Using the typical event.Enable() call doesn't seem to work with wxGTK
* so use the pointer to alias combobox to directly enable or disable. * so use the pointer to alias combobox to directly enable or disable.
*/ */
m_SelpartBox->Enable( m_component && m_component->GetPartCount() > 1 ); m_partSelectBox->Enable( m_component && m_component->GetPartCount() > 1 );
} }
...@@ -542,24 +542,24 @@ void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event ) ...@@ -542,24 +542,24 @@ void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
void LIB_EDIT_FRAME::OnUpdateSelectAlias( wxUpdateUIEvent& event ) void LIB_EDIT_FRAME::OnUpdateSelectAlias( wxUpdateUIEvent& event )
{ {
if( m_SelAliasBox == NULL ) if( m_aliasSelectBox == NULL )
return; return;
/* Using the typical event.Enable() call doesn't seem to work with wxGTK /* Using the typical event.Enable() call doesn't seem to work with wxGTK
* so use the pointer to alias combobox to directly enable or disable. * so use the pointer to alias combobox to directly enable or disable.
*/ */
m_SelAliasBox->Enable( m_component != NULL && m_component->GetAliasCount() > 1 ); m_aliasSelectBox->Enable( m_component != NULL && m_component->GetAliasCount() > 1 );
} }
void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event ) void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event )
{ {
if( m_SelAliasBox == NULL if( m_aliasSelectBox == NULL
|| ( m_SelAliasBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0) ) || ( m_aliasSelectBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0) )
return; return;
m_lastDrawItem = NULL; m_lastDrawItem = NULL;
m_aliasName = m_SelAliasBox->GetStringSelection(); m_aliasName = m_aliasSelectBox->GetStringSelection();
DisplayCmpDoc(); DisplayCmpDoc();
DrawPanel->Refresh(); DrawPanel->Refresh();
......
...@@ -53,12 +53,73 @@ class LIB_EDIT_FRAME : public EDA_DRAW_FRAME ...@@ -53,12 +53,73 @@ class LIB_EDIT_FRAME : public EDA_DRAW_FRAME
{ {
LIB_COMPONENT* m_tempCopyComponent; ///< Temporary copy of current component during edit. LIB_COMPONENT* m_tempCopyComponent; ///< Temporary copy of current component during edit.
LIB_COLLECTOR m_collectedItems; // Used for hit testing. LIB_COLLECTOR m_collectedItems; // Used for hit testing.
wxComboBox* m_partSelectBox; // a Box to select a part to edit (if any)
wxComboBox* m_aliasSelectBox; // a box to select the alias to edit (if any)
LIB_ITEM* locateItem( const wxPoint& aPosition, const KICAD_T aFilterList[] ); wxString m_configPath;
wxString m_lastLibImportPath;
wxString m_lastLibExportPath;
public: /** Convert of the item currently being drawn. */
wxComboBox* m_SelpartBox; // a Box to select a part to edit (if any) bool m_drawSpecificConvert;
wxComboBox* m_SelAliasBox; // a box to select the alias to edit (if any)
/**
* Specify which component parts the current draw item applies to.
*
* If true, the item being drawn or edited applies only to the selected
* part. Otherwise it applies to all parts in the component.
*/
bool m_drawSpecificUnit;
/**
* Set to true to not synchronize pins at the same position when editing
* components with multiple parts or multiple body styles. Setting this
* to false allows editing each pin per part or body style individually.
* This requires the user to open each part or body style to make changes
* to the pin at the same location.
*/
bool m_editPinsPerPartOrConvert;
/** The current draw or edit graphic item fill style. */
static FILL_T m_drawFillStyle;
/** Default line width for drawing or editing graphic items. */
static int m_drawLineWidth;
/** The current active library. NULL if no active library is selected. */
static CMP_LIBRARY* m_library;
/** The current component being edited. NULL if no component is selected. */
static LIB_COMPONENT* m_component;
static LIB_ITEM* m_lastDrawItem;
static LIB_ITEM* m_drawItem;
static wxString m_aliasName;
// The unit number to edit and show
static int m_unit;
// Show the normal shape ( m_convert <= 1 ) or the converted shape
// ( m_convert > 1 )
static int m_convert;
// true to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded component has
// Graphic items for converted shape
// But under some circumstances (New component created)
// these tools must left enable
static bool m_showDeMorgan;
/// The current text size setting.
static int m_textSize;
/// Current text orientation setting.
static int m_textOrientation;
static wxSize m_clientSize;
friend class DIALOG_LIB_EDIT_TEXT;
LIB_ITEM* locateItem( const wxPoint& aPosition, const KICAD_T aFilterList[] );
public: public:
LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, const wxString& title, LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, const wxString& title,
...@@ -498,70 +559,6 @@ public: ...@@ -498,70 +559,6 @@ public:
// Automatic placement of pins // Automatic placement of pins
void RepeatPinItem( wxDC* DC, LIB_PIN* Pin ); void RepeatPinItem( wxDC* DC, LIB_PIN* Pin );
protected:
wxString m_ConfigPath;
wxString m_LastLibImportPath;
wxString m_LastLibExportPath;
/** Convert of the item currently being drawn. */
bool m_drawSpecificConvert;
/**
* Specify which component parts the current draw item applies to.
*
* If true, the item being drawn or edited applies only to the selected
* part. Otherwise it applies to all parts in the component.
*/
bool m_drawSpecificUnit;
/**
* Set to true to not synchronize pins at the same position when editing
* components with multiple parts or multiple body styles. Setting this
* to false allows editing each pin per part or body style individually.
* This requires the user to open each part or body style to make changes
* to the pin at the same location.
*/
bool m_editPinsPerPartOrConvert;
/** The current draw or edit graphic item fill style. */
static FILL_T m_drawFillStyle;
/** Default line width for drawing or editing graphic items. */
static int m_drawLineWidth;
/** The current active library. NULL if no active library is selected. */
static CMP_LIBRARY* m_library;
/** The current component being edited. NULL if no component is selected. */
static LIB_COMPONENT* m_component;
static LIB_ITEM* m_lastDrawItem;
static LIB_ITEM* m_drawItem;
static wxString m_aliasName;
// The unit number to edit and show
static int m_unit;
// Show the normal shape ( m_convert <= 1 ) or the converted shape
// ( m_convert > 1 )
static int m_convert;
// true to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded component has
// Graphic items for converted shape
// But under some circumstances (New component created)
// these tools must left enable
static bool m_showDeMorgan;
/// The current text size setting.
static int m_textSize;
/// Current text orientation setting.
static int m_textOrientation;
static wxSize m_clientSize;
friend class DIALOG_LIB_EDIT_TEXT;
/** /**
* Function CreatePNGorJPEGFile * Function CreatePNGorJPEGFile
* creates an image (screenshot) of the current component in PNG or JPEG format. * creates an image (screenshot) of the current component in PNG or JPEG format.
......
...@@ -193,7 +193,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -193,7 +193,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
m_Parent->m_NetlistFormat == NET_TYPE_PCBNEW ); m_Parent->GetNetListFormat() == NET_TYPE_PCBNEW );
// Add Panel FORMAT ORCADPCB2 // Add Panel FORMAT ORCADPCB2
m_PanelNetType[PANELORCADPCB2] = m_PanelNetType[PANELORCADPCB2] =
...@@ -202,7 +202,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -202,7 +202,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
NET_TYPE_ORCADPCB2, NET_TYPE_ORCADPCB2,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
m_Parent->m_NetlistFormat == NET_TYPE_ORCADPCB2 ); m_Parent->GetNetListFormat() == NET_TYPE_ORCADPCB2 );
// Add Panel FORMAT CADSTAR // Add Panel FORMAT CADSTAR
m_PanelNetType[PANELCADSTAR] = m_PanelNetType[PANELCADSTAR] =
...@@ -211,7 +211,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -211,7 +211,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
NET_TYPE_CADSTAR, NET_TYPE_CADSTAR,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
m_Parent->m_NetlistFormat == NET_TYPE_CADSTAR ); m_Parent->GetNetListFormat() == NET_TYPE_CADSTAR );
// Add Panel spice // Add Panel spice
InstallPageSpice(); InstallPageSpice();
...@@ -236,16 +236,16 @@ void NETLIST_DIALOG::InstallPageSpice() ...@@ -236,16 +236,16 @@ void NETLIST_DIALOG::InstallPageSpice()
wxT( "Spice" ), wxT( "Spice" ),
NET_TYPE_SPICE, NET_TYPE_SPICE,
0, 0, 0, 0,
m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); m_Parent->GetNetListFormat() == NET_TYPE_SPICE );
page->m_IsCurrentFormat = new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT, page->m_IsCurrentFormat = new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT,
_( "Default format" ) ); _( "Default format" ) );
page->m_IsCurrentFormat->SetValue( m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); page->m_IsCurrentFormat->SetValue( m_Parent->GetNetListFormat() == NET_TYPE_SPICE );
page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 1, wxGROW | wxALL, 5 ); page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 1, wxGROW | wxALL, 5 );
page->m_AddSubPrefix = new wxCheckBox( page, ID_ADD_SUBCIRCUIT_PREFIX, page->m_AddSubPrefix = new wxCheckBox( page, ID_ADD_SUBCIRCUIT_PREFIX,
_( "Prefix references 'U' and 'IC' with 'X'" ) ); _( "Prefix references 'U' and 'IC' with 'X'" ) );
page->m_AddSubPrefix->SetValue( m_Parent->m_AddSubPrefix ); page->m_AddSubPrefix->SetValue( m_Parent->GetAddReferencePrefix() );
page->m_LeftBoxSizer->Add( page->m_AddSubPrefix, 0, wxGROW | wxALL, 5 ); page->m_LeftBoxSizer->Add( page->m_AddSubPrefix, 0, wxGROW | wxALL, 5 );
...@@ -304,12 +304,13 @@ void NETLIST_DIALOG::InstallCustomPages() ...@@ -304,12 +304,13 @@ void NETLIST_DIALOG::InstallCustomPages()
if( title.IsEmpty() && previoustitle.IsEmpty() ) if( title.IsEmpty() && previoustitle.IsEmpty() )
break; // No more panel to install break; // No more panel to install
selected = m_Parent->m_NetlistFormat == ( NET_TYPE_CUSTOM1 + ii ); selected = m_Parent->GetNetListFormat() == ( NET_TYPE_CUSTOM1 + ii );
/* Install the panel "Add Plugin" after /* Install the panel "Add Plugin" after
* the last initialized panel */ * the last initialized panel */
previoustitle = title; previoustitle = title;
if( title.IsEmpty() ) if( title.IsEmpty() )
CurrPage = CurrPage =
m_PanelNetType[PANELCUSTOMBASE + ii] = m_PanelNetType[PANELCUSTOMBASE + ii] =
...@@ -430,7 +431,7 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event ) ...@@ -430,7 +431,7 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event )
if( CurrPage == NULL ) if( CurrPage == NULL )
return; return;
m_Parent->m_NetlistFormat = CurrPage->m_IdNetType; m_Parent->SetNetListFormat( CurrPage->m_IdNetType );
CurrPage->m_IsCurrentFormat->SetValue( true ); CurrPage->m_IsCurrentFormat->SetValue( true );
} }
...@@ -449,10 +450,7 @@ void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event ) ...@@ -449,10 +450,7 @@ void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event )
if( CurrPage == NULL || CurrPage->m_AddSubPrefix == NULL ) if( CurrPage == NULL || CurrPage->m_AddSubPrefix == NULL )
return; return;
if( CurrPage->m_AddSubPrefix->IsChecked() ) m_Parent->SetAddReferencePrefix( CurrPage->m_AddSubPrefix->IsChecked() );
m_Parent->m_AddSubPrefix = true;
else
m_Parent->m_AddSubPrefix = false;
} }
void NETLIST_DIALOG::NetlistUpdateOpt() void NETLIST_DIALOG::NetlistUpdateOpt()
...@@ -460,7 +458,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt() ...@@ -460,7 +458,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
int ii; int ii;
m_Parent->SetSimulatorCommand( m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue() ); m_Parent->SetSimulatorCommand( m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue() );
m_Parent->m_NetlistFormat = NET_TYPE_PCBNEW; m_Parent->SetNetListFormat( NET_TYPE_PCBNEW );
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
{ {
...@@ -468,7 +466,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt() ...@@ -468,7 +466,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
break; break;
if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == true ) if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == true )
m_Parent->m_NetlistFormat = m_PanelNetType[ii]->m_IdNetType; m_Parent->SetNetListFormat( m_PanelNetType[ii]->m_IdNetType );
} }
g_OptNetListUseNames = true; // Used for pspice, gnucap g_OptNetListUseNames = true; // Used for pspice, gnucap
......
...@@ -194,7 +194,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father, ...@@ -194,7 +194,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
m_ViewlibFrame = NULL; // Frame for browsing component libraries m_ViewlibFrame = NULL; // Frame for browsing component libraries
m_DefaultSchematicFileName = NAMELESS_PROJECT; m_DefaultSchematicFileName = NAMELESS_PROJECT;
m_DefaultSchematicFileName += wxT( ".sch" ); m_DefaultSchematicFileName += wxT( ".sch" );
m_ShowAllPins = false; m_showAllPins = false;
m_previewPosition = wxDefaultPosition; m_previewPosition = wxDefaultPosition;
m_previewSize = wxDefaultSize; m_previewSize = wxDefaultSize;
m_printMonochrome = true; m_printMonochrome = true;
...@@ -592,10 +592,10 @@ void SCH_EDIT_FRAME::OnUpdateBusOrientation( wxUpdateUIEvent& aEvent ) ...@@ -592,10 +592,10 @@ void SCH_EDIT_FRAME::OnUpdateBusOrientation( wxUpdateUIEvent& aEvent )
void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent ) void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
{ {
wxString tool_tip = m_ShowAllPins ? _( "Do not show hidden pins" ) : wxString tool_tip = m_showAllPins ? _( "Do not show hidden pins" ) :
_( "Show hidden pins" ); _( "Show hidden pins" );
aEvent.Check( m_ShowAllPins ); aEvent.Check( m_showAllPins );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_HIDDEN_PINS, tool_tip ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_HIDDEN_PINS, tool_tip );
} }
...@@ -622,8 +622,8 @@ void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event ) ...@@ -622,8 +622,8 @@ void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event )
{ {
int i; int i;
if( m_NetlistFormat < NET_TYPE_PCBNEW ) if( m_netListFormat < NET_TYPE_PCBNEW )
m_NetlistFormat = NET_TYPE_PCBNEW; m_netListFormat = NET_TYPE_PCBNEW;
do do
{ {
......
...@@ -121,7 +121,7 @@ void LIB_EDIT_FRAME::ReCreateHToolbar() ...@@ -121,7 +121,7 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_SELECT_PART, wxEmptyString,
KiBitmap( import_cmp_from_lib_xpm ), KiBitmap( import_cmp_from_lib_xpm ),
_( "Load component to edit from the current lib" ) ); _( "Load component to edit from the current library" ) );
m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART_FROM_EXISTING, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_NEW_PART_FROM_EXISTING, wxEmptyString,
KiBitmap( copycomponent_xpm ), KiBitmap( copycomponent_xpm ),
...@@ -181,21 +181,21 @@ void LIB_EDIT_FRAME::ReCreateHToolbar() ...@@ -181,21 +181,21 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
_( "Edit document file" ) ); _( "Edit document file" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_SelpartBox = new wxComboBox( m_HToolBar, m_partSelectBox = new wxComboBox( m_HToolBar,
ID_LIBEDIT_SELECT_PART_NUMBER, ID_LIBEDIT_SELECT_PART_NUMBER,
wxEmptyString, wxEmptyString,
wxDefaultPosition, wxDefaultPosition,
wxSize( LISTBOX_WIDTH, -1 ), wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY ); 0, NULL, wxCB_READONLY );
m_HToolBar->AddControl( m_SelpartBox ); m_HToolBar->AddControl( m_partSelectBox );
m_SelAliasBox = new wxComboBox( m_HToolBar, m_aliasSelectBox = new wxComboBox( m_HToolBar,
ID_LIBEDIT_SELECT_ALIAS, ID_LIBEDIT_SELECT_ALIAS,
wxEmptyString, wxEmptyString,
wxDefaultPosition, wxDefaultPosition,
wxSize( LISTBOX_WIDTH, -1 ), wxSize( LISTBOX_WIDTH, -1 ),
0, NULL, wxCB_READONLY ); 0, NULL, wxCB_READONLY );
m_HToolBar->AddControl( m_SelAliasBox ); m_HToolBar->AddControl( m_aliasSelectBox );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = _( "Edit pins per part or body style (Use carefully!)" ); msg = _( "Edit pins per part or body style (Use carefully!)" );
......
...@@ -290,7 +290,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -290,7 +290,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id ) switch( id )
{ {
case ID_TB_OPTIONS_HIDDEN_PINS: case ID_TB_OPTIONS_HIDDEN_PINS:
m_ShowAllPins = m_OptionsToolBar->GetToolState( id ); m_showAllPins = m_OptionsToolBar->GetToolState( id );
DrawPanel->Refresh( ); DrawPanel->Refresh( );
break; break;
......
...@@ -106,7 +106,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph ...@@ -106,7 +106,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
wxAcceleratorTable table( ACCEL_TABLE_CNT, accels ); wxAcceleratorTable table( ACCEL_TABLE_CNT, accels );
m_FrameName = wxT( "ViewlibFrame" ); m_FrameName = wxT( "ViewlibFrame" );
m_ConfigPath = wxT( "LibraryViewer" ); m_configPath = wxT( "LibraryViewer" );
// Give an icon // Give an icon
wxIcon icon; wxIcon icon;
...@@ -513,7 +513,7 @@ void LIB_VIEW_FRAME::LoadSettings( ) ...@@ -513,7 +513,7 @@ void LIB_VIEW_FRAME::LoadSettings( )
EDA_DRAW_FRAME::LoadSettings(); EDA_DRAW_FRAME::LoadSettings();
wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_ConfigPath ); wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_configPath );
cfg = wxGetApp().m_EDA_Config; cfg = wxGetApp().m_EDA_Config;
m_LibListSize.x = 150; // default width of libs list m_LibListSize.x = 150; // default width of libs list
...@@ -537,7 +537,7 @@ void LIB_VIEW_FRAME::SaveSettings() ...@@ -537,7 +537,7 @@ void LIB_VIEW_FRAME::SaveSettings()
EDA_DRAW_FRAME::SaveSettings(); EDA_DRAW_FRAME::SaveSettings();
wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_ConfigPath ); wxConfigPathChanger cpc( wxGetApp().m_EDA_Config, m_configPath );
cfg = wxGetApp().m_EDA_Config; cfg = wxGetApp().m_EDA_Config;
if ( m_LibListSize.x ) if ( m_LibListSize.x )
......
...@@ -63,7 +63,7 @@ private: ...@@ -63,7 +63,7 @@ private:
// Flags // Flags
wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog wxSemaphore* m_Semaphore; // != NULL if the frame must emulate a modal dialog
wxString m_ConfigPath; // subpath for configuration wxString m_configPath; // subpath for configuration
protected: protected:
static wxString m_libraryName; static wxString m_libraryName;
......
...@@ -112,13 +112,6 @@ enum SCH_SEARCH_T { ...@@ -112,13 +112,6 @@ enum SCH_SEARCH_T {
*/ */
class SCH_EDIT_FRAME : public EDA_DRAW_FRAME class SCH_EDIT_FRAME : public EDA_DRAW_FRAME
{ {
public:
int m_NetlistFormat;
int m_AddSubPrefix;
bool m_ShowAllPins;
wxString m_UserLibraryPath;
wxArrayString m_ComponentLibFiles;
private: private:
SCH_SHEET_PATH* m_CurrentSheet; ///< which sheet we are presently working on. SCH_SHEET_PATH* m_CurrentSheet; ///< which sheet we are presently working on.
LIB_VIEW_FRAME* m_ViewlibFrame; LIB_VIEW_FRAME* m_ViewlibFrame;
...@@ -154,6 +147,19 @@ private: ...@@ -154,6 +147,19 @@ private:
/// An index to the last find item in the found items list #m_foundItems. /// An index to the last find item in the found items list #m_foundItems.
int m_foundItemIndex; int m_foundItemIndex;
/// Flag to indicate show hidden pins.
bool m_showAllPins;
/// The format to use when generating a net list.
int m_netListFormat;
/// Add X prefix to componen referencess when generating spice net lists.
bool m_addReferencPrefix;
wxString m_userLibraryPath;
wxArrayString m_componentLibFiles;
static int m_lastSheetPinType; ///< Last sheet pin type. static int m_lastSheetPinType; ///< Last sheet pin type.
static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size. static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size.
static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position. static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position.
...@@ -190,6 +196,26 @@ public: ...@@ -190,6 +196,26 @@ public:
void SetLibraryViewerWindow( LIB_VIEW_FRAME* aFrame ) { m_ViewlibFrame = aFrame; } void SetLibraryViewerWindow( LIB_VIEW_FRAME* aFrame ) { m_ViewlibFrame = aFrame; }
bool GetShowAllPins() const { return m_showAllPins; }
void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; }
int GetNetListFormat() const { return m_netListFormat; }
void SetNetListFormat( int aFormat ) { m_netListFormat = aFormat; }
bool GetAddReferencePrefix() const { return m_addReferencPrefix; }
void SetAddReferencePrefix( bool aEnable ) { m_addReferencPrefix = aEnable; }
wxString GetUserLibraryPath() const { return m_userLibraryPath; }
void SetUserLibraryPath( const wxString& aPath ) { m_userLibraryPath = aPath; }
const wxArrayString& GetComponentLibraries() const { return m_componentLibFiles; }
void SetComponentLibraries( const wxArrayString& aList ) { m_componentLibFiles = aList; }
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void OnColorConfig( wxCommandEvent& aEvent ); void OnColorConfig( wxCommandEvent& aEvent );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
......
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