LibEdit: automatic selection of option "edit Pin per Pin" when load/editing a component:

default is Edit pin per pin for components with parts locked and coupling pin for others.
This commit is contained in:
charras 2010-03-05 19:49:08 +00:00
parent 83e8b961c7
commit 288684101a
8 changed files with 1334 additions and 1297 deletions

View File

@ -14,6 +14,7 @@
#include "protos.h"
#include "libeditframe.h"
#include "class_library.h"
#include "eeschema_id.h"
/* Dialog box to edit a libentry (a component in library) properties */
@ -31,7 +32,16 @@
void WinEDA_LibeditFrame::OnEditComponentProperties( wxCommandEvent& event )
{
bool partLocked = GetComponent()->m_UnitSelectionLocked;
EditComponentProperties();
if( partLocked != GetComponent()->m_UnitSelectionLocked )
{ // g_EditPinByPinIsOn is set to the better value,
// if m_UnitSelectionLocked has changed
g_EditPinByPinIsOn = GetComponent()->m_UnitSelectionLocked ? true : false;
m_HToolBar->ToggleTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, g_EditPinByPinIsOn );
}
m_HToolBar->Refresh();
DrawPanel->Refresh();
}

View File

@ -106,11 +106,14 @@ library \"%s\"." ),
if( !LoadOneLibraryPartAux( LibEntry, m_library ) )
return;
g_EditPinByPinIsOn = false;
g_EditPinByPinIsOn = m_component->m_UnitSelectionLocked ? true : false;
m_HToolBar->ToggleTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, g_EditPinByPinIsOn );
GetScreen()->ClearUndoRedoList();
Zoom_Automatique( false );
DrawPanel->Refresh();
SetShowDeMorgan(m_component->HasConversion() );
m_HToolBar->Refresh();
}
@ -558,11 +561,13 @@ created. Aborted" ) );
DisplayCmpDoc();
UpdateAliasSelectList();
UpdatePartSelectList();
g_EditPinByPinIsOn = false;
g_EditPinByPinIsOn = m_component->m_UnitSelectionLocked ? true : false;
m_HToolBar->ToggleTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, g_EditPinByPinIsOn );
m_lastDrawItem = NULL;
GetScreen()->ClearUndoRedoList();
OnModify( );
DrawPanel->Refresh();
m_HToolBar->Refresh();
}

View File

@ -667,7 +667,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_LIBEDIT_EDIT_PIN_BY_PIN:
g_EditPinByPinIsOn = g_EditPinByPinIsOn ? false : true;
g_EditPinByPinIsOn = m_HToolBar->GetToolState(ID_LIBEDIT_EDIT_PIN_BY_PIN);
break;
case ID_LIBEDIT_PIN_BUTT:

View File

@ -200,9 +200,14 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar->AddControl( m_SelAliasBox );
m_HToolBar->AddSeparator();
msg = _( "Edit pins part per part ( Use carefully!)" );
msg << wxT("\n");
msg += _("Usual option = OFF when parts are not locked");
msg << wxT("\n");
msg += _("Usual option = ON when parts are locked");
m_HToolBar->AddTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, wxEmptyString,
wxBitmap( pin2pin_xpm ),
_( "Edit pins part per part ( Use carefully!)" ),
msg,
wxITEM_CHECK );
// after adding the buttons to the toolbar, must call Realize() to reflect

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff