110 lines
2.7 KiB
C++
110 lines
2.7 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: dialog_edit_component_in_lib.cpp
|
|
// Author: jean-pierre Charras
|
|
// Licence: GPL
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "fctsys.h"
|
|
#include "appl_wxstruct.h"
|
|
#include "common.h"
|
|
#include "confirm.h"
|
|
#include "gestfich.h"
|
|
|
|
#include "program.h"
|
|
#include "libcmp.h"
|
|
#include "general.h"
|
|
|
|
#include "dialog_edit_component_in_lib.h"
|
|
|
|
#include "protos.h"
|
|
|
|
DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( WinEDA_LibeditFrame* aParent):
|
|
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE(aParent)
|
|
{
|
|
m_Parent = aParent;
|
|
m_RecreateToolbar = false;
|
|
m_AliasLocation = -1;
|
|
|
|
Init();
|
|
|
|
if (GetSizer())
|
|
{
|
|
GetSizer()->SetSizeHints(this);
|
|
}
|
|
}
|
|
|
|
|
|
DIALOG_EDIT_COMPONENT_IN_LIBRARY::~DIALOG_EDIT_COMPONENT_IN_LIBRARY()
|
|
{
|
|
}
|
|
|
|
/* Initialize state of check boxes and texts
|
|
*/
|
|
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::Init( )
|
|
{
|
|
SetFocus();
|
|
m_AliasLocation = -1;
|
|
if( CurrentLibEntry == NULL )
|
|
{
|
|
SetTitle( _( "Lib Component Properties" ) );
|
|
return;
|
|
}
|
|
|
|
wxString title = _( "Properties for " );
|
|
if( !CurrentAliasName.IsEmpty() )
|
|
{
|
|
m_AliasLocation = LocateAlias( CurrentLibEntry->m_AliasList, CurrentAliasName );
|
|
title += CurrentAliasName +
|
|
_( "(alias of " ) +
|
|
wxString( CurrentLibEntry->m_Name.m_Text )
|
|
+ wxT( ")" );
|
|
}
|
|
else
|
|
{
|
|
title += CurrentLibEntry->m_Name.m_Text;
|
|
CurrentAliasName.Empty();
|
|
}
|
|
|
|
SetTitle( title );
|
|
|
|
InitPanelDoc();
|
|
InitBasicPanel();
|
|
|
|
if( !CurrentAliasName.IsEmpty() )
|
|
m_ButtonDeleteAllAlias->Enable( false );
|
|
|
|
/* Place list of alias names in listbox */
|
|
if( CurrentLibEntry )
|
|
{
|
|
for( unsigned ii = 0; ii < CurrentLibEntry->m_AliasList.GetCount(); ii += ALIAS_NEXT )
|
|
m_PartAliasList->Append( CurrentLibEntry->m_AliasList[ii + ALIAS_NAME] );
|
|
}
|
|
|
|
if( (CurrentLibEntry == NULL) || (CurrentLibEntry->m_AliasList.GetCount() == 0) )
|
|
{
|
|
m_ButtonDeleteAllAlias->Enable( false );
|
|
m_ButtonDeleteOneAlias->Enable( false );
|
|
}
|
|
|
|
/* Read the Footprint Filter list */
|
|
if( CurrentLibEntry )
|
|
{
|
|
for( unsigned ii = 0; ii < CurrentLibEntry->m_FootprintList.GetCount(); ii++ )
|
|
m_FootprintFilterListBox->Append( CurrentLibEntry->m_FootprintList[ii] );
|
|
}
|
|
|
|
if( (CurrentLibEntry == NULL) || (CurrentLibEntry->m_FootprintList.GetCount() == 0) )
|
|
{
|
|
m_ButtonDeleteAllFootprintFilter->Enable( false );
|
|
m_ButtonDeleteOneFootprintFilter->Enable( false );
|
|
}
|
|
|
|
}
|
|
|
|
|
|
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnCancelClick( wxCommandEvent& event )
|
|
{
|
|
EndModal(0);
|
|
}
|
|
|