Commit 28868410 authored by charras's avatar charras

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.
parent 83e8b961
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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:
......
......@@ -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
......
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
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