Commit c63a2b38 authored by charras's avatar charras

Eeschema: fixing problems in Libedit for multi parts per package components when editing pins

(non consistent edit pin per pin option and erroneous pin number edition)
Pcbnew: fixing a problem in dialog design rules for small screens (768 pixels height); Better look on bigger screens
parent 706ba777
......@@ -219,21 +219,9 @@ void LIB_PIN::SetNumber( const wxString& number )
m_Flags |= IS_CHANGED;
}
if( GetParent() == NULL )
return;
LIB_PIN_LIST pinList;
GetParent()->GetPins( pinList );
for( size_t i = 0; i < pinList.size(); i++ )
{
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|| pinList[i]->m_PinNum == m_PinNum )
continue;
pinList[i]->m_PinNum = m_PinNum;
pinList[i]->m_Flags |= IS_CHANGED;
}
/* Others pin numbers marked by EnableEditMode() are not modified
* because each pin has its own number
*/
}
......@@ -480,7 +468,7 @@ void LIB_PIN::EnableEditMode( bool enable, bool editPinByPin )
if( ( pinList[i]->m_Pos == m_Pos )
&& ( pinList[i]->m_Orient == m_Orient )
&& ( !( m_Flags & IS_NEW ) )
&& !editPinByPin == false
&& editPinByPin == false
&& enable )
pinList[i]->m_Flags |= IS_LINKED | IN_EDIT;
else
......
......@@ -482,8 +482,8 @@ public:
/**
* Set the pin number.
*
* This will also all of the pin numbers marked by EnableEditMode().
*
* Others pin numbers marked by EnableEditMode() are not modified
* because each pin has its own number
* @param aNumber - New pin number.
*/
void SetNumber( const wxString& aNumber );
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -252,6 +252,7 @@ another pin. Continue?" ) );
LastPinOrient = CurrentPin->m_Orient;
LastPinType = CurrentPin->m_PinType;
LastPinShape = CurrentPin->m_PinShape;
if( !g_EditPinByPinIsOn )
CreateImagePins( CurrentPin, m_unit, m_convert, m_showDeMorgan );
m_lastDrawItem = CurrentPin;
m_component->AddDrawItem( m_drawItem );
......
......@@ -80,7 +80,8 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
dialog.EnableApplyToAllUnits( component && component->GetPartCount() > 1 );
dialog.SetApplyToAllConversions( !m_drawSpecificConvert );
dialog.EnableApplyToAllConversions( component && component->HasConversion() );
dialog.SetFillStyle( m_drawFillStyle );
// dialog.SetFillStyle( m_drawFillStyle ); // could better to show the current setting
dialog.SetFillStyle( DrawItem->m_Fill);
dialog.EnableFillStyle( DrawItem->IsFillable() );
if( dialog.ShowModal() == wxID_CANCEL )
......@@ -92,8 +93,15 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
m_drawSpecificConvert = !dialog.GetApplyToAllConversions();
m_drawSpecificUnit = !dialog.GetApplyToAllUnits();
#if 0
/* TODO: see if m_drawFillStyle must retain the last fill option or not.
* if the last is Filled, having next new graphic items created
* with filled body is often bad.
* currently m_drawFillStyle is left with the defualt value (not filled)
*/
if( DrawItem->IsFillable() )
m_drawFillStyle = (FILL_T) dialog.GetFillStyle();
#endif
// Save copy for undo is done before place.
if( !( DrawItem->m_Flags & IS_NEW ) )
......@@ -110,7 +118,7 @@ void WinEDA_LibeditFrame::EditGraphicSymbol( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
DrawItem->m_Convert = 0;
if( DrawItem->IsFillable() )
DrawItem->m_Fill = m_drawFillStyle;
DrawItem->m_Fill = (FILL_T) dialog.GetFillStyle();
DrawItem->SetWidth( m_drawLineWidth );
......
......@@ -63,7 +63,6 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
// Cell Defaults
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_grid->SetToolTip( _("Net Class parameters") );
m_grid->SetMinSize( wxSize( -1,150 ) );
sbSizer1->Add( m_grid, 1, wxEXPAND, 5 );
......@@ -73,21 +72,21 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_addButton = new wxButton( m_panelNetClassesEditor, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_addButton->SetToolTip( _("Add another Net Class") );
buttonBoxSizer->Add( m_addButton, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
buttonBoxSizer->Add( m_addButton, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_removeButton = new wxButton( m_panelNetClassesEditor, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeButton->SetToolTip( _("Remove the currently select Net Class\nThe default Net Class cannot be removed") );
buttonBoxSizer->Add( m_removeButton, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
buttonBoxSizer->Add( m_removeButton, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_moveUpButton = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") );
buttonBoxSizer->Add( m_moveUpButton, 0, wxRIGHT|wxLEFT, 5 );
buttonBoxSizer->Add( m_moveUpButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
bpanelNetClassesSizer->Add( sbSizer1, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bpanelNetClassesSizer->Add( sbSizer1, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Membership:") ), wxHORIZONTAL );
......@@ -368,15 +367,19 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
sbSizer2->Add( m_MessagesList, 1, wxEXPAND, 5 );
bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxVERTICAL );
m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOk->SetDefault();
bSizerButtons->Add( m_buttonOk, 0, wxALL|wxEXPAND, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
m_sdbButtonsSizer = new wxStdDialogButtonSizer();
m_sdbButtonsSizerOK = new wxButton( this, wxID_OK );
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerOK );
m_sdbButtonsSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerCancel );
m_sdbButtonsSizer->Realize();
bMainSizer->Add( m_sdbButtonsSizer, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
sbSizer2->Add( bSizerButtons, 0, 0, 5 );
bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
......@@ -393,8 +396,8 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_buttonLeftSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this );
m_buttonRightSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this );
m_rightClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_sdbButtonsSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
m_sdbButtonsSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
}
DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
......@@ -411,6 +414,6 @@ DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
m_buttonLeftSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this );
m_buttonRightSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this );
m_rightClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_sdbButtonsSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
m_sdbButtonsSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
}
This diff is collapsed.
......@@ -87,9 +87,8 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
wxStaticText* m_staticText8;
wxGrid* m_gridTrackWidthList;
wxHtmlWindow* m_MessagesList;
wxStdDialogButtonSizer* m_sdbButtonsSizer;
wxButton* m_sdbButtonsSizerOK;
wxButton* m_sdbButtonsSizerCancel;
wxButton* m_buttonOk;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnNetClassesNameLeftClick( wxGridEvent& event ){ event.Skip(); }
......@@ -103,12 +102,12 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
virtual void OnLeftSelectAllButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightSelectAllButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightCBSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 900,640 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 777,640 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DESIGN_RULES_BASE();
};
......
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