2007-06-05 12:10:51 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialog_edit_component_in_lib.cpp
|
2008-12-31 15:01:29 +00:00
|
|
|
// Purpose:
|
2007-06-05 12:10:51 +00:00
|
|
|
// Author: jean-pierre Charras
|
2008-12-31 15:01:29 +00:00
|
|
|
// Modified by:
|
2007-06-05 12:10:51 +00:00
|
|
|
// Created: 02/03/2006 08:51:09
|
2008-12-31 15:01:29 +00:00
|
|
|
// RCS-ID:
|
2007-06-05 12:10:51 +00:00
|
|
|
// Copyright: License GNU
|
2008-12-31 15:01:29 +00:00
|
|
|
// Licence:
|
2007-06-05 12:10:51 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Generated by DialogBlocks (unregistered), 02/03/2006 08:51:09
|
|
|
|
|
|
|
|
|
|
|
|
////@begin includes
|
|
|
|
////@end includes
|
|
|
|
|
|
|
|
#include "dialog_edit_component_in_lib.h"
|
|
|
|
|
|
|
|
////@begin XPM images
|
|
|
|
////@end XPM images
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* WinEDA_PartPropertiesFrame type definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PartPropertiesFrame, wxDialog )
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* WinEDA_PartPropertiesFrame event table definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE( WinEDA_PartPropertiesFrame, wxDialog )
|
|
|
|
|
|
|
|
////@begin WinEDA_PartPropertiesFrame event table entries
|
|
|
|
EVT_BUTTON( ID_COPY_DOC_TO_ALIAS, WinEDA_PartPropertiesFrame::OnCopyDocToAliasClick )
|
|
|
|
|
|
|
|
EVT_BUTTON( ID_BROWSE_DOC_FILES, WinEDA_PartPropertiesFrame::OnBrowseDocFilesClick )
|
|
|
|
|
|
|
|
EVT_BUTTON( wxID_CANCEL, WinEDA_PartPropertiesFrame::OnCancelClick )
|
|
|
|
|
|
|
|
EVT_BUTTON( wxID_OK, WinEDA_PartPropertiesFrame::OnOkClick )
|
|
|
|
|
|
|
|
////@end WinEDA_PartPropertiesFrame event table entries
|
|
|
|
EVT_BUTTON(ID_ADD_ALIAS, WinEDA_PartPropertiesFrame::AddAliasOfPart)
|
|
|
|
EVT_BUTTON(ID_DELETE_ONE_ALIAS, WinEDA_PartPropertiesFrame::DeleteAliasOfPart)
|
|
|
|
EVT_BUTTON(ID_DELETE_ALL_ALIAS, WinEDA_PartPropertiesFrame::DeleteAllAliasOfPart)
|
|
|
|
EVT_BUTTON(ID_ADD_FOOTPRINT_FILTER, WinEDA_PartPropertiesFrame::AddFootprintFilter)
|
|
|
|
EVT_BUTTON(ID_DELETE_ONE_FOOTPRINT_FILTER, WinEDA_PartPropertiesFrame::DeleteOneFootprintFilter)
|
|
|
|
EVT_BUTTON(ID_DELETE_ALL_FOOTPRINT_FILTER, WinEDA_PartPropertiesFrame::DeleteAllFootprintFilter)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* WinEDA_PartPropertiesFrame constructors
|
|
|
|
*/
|
|
|
|
|
|
|
|
WinEDA_PartPropertiesFrame::WinEDA_PartPropertiesFrame( )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
WinEDA_PartPropertiesFrame::WinEDA_PartPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
|
|
{
|
|
|
|
m_Parent = parent;
|
|
|
|
m_RecreateToolbar = FALSE;
|
|
|
|
m_AliasLocation = -1;
|
2008-12-31 15:01:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
InitBuffers();
|
2008-12-31 15:01:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
Create(parent, id, caption, pos, size, style);
|
2008-12-31 15:01:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
SetTitle(m_Title);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* WinEDA_PartPropertiesFrame creator
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool WinEDA_PartPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
|
|
{
|
|
|
|
////@begin WinEDA_PartPropertiesFrame member initialisation
|
|
|
|
m_GeneralBoxSizer = NULL;
|
|
|
|
m_NoteBook = NULL;
|
|
|
|
m_PanelBasic = NULL;
|
|
|
|
m_PanelBasicBoxSizer = NULL;
|
|
|
|
m_OptionsBoxSizer = NULL;
|
|
|
|
SelNumberOfUnits = NULL;
|
|
|
|
m_SetSkew = NULL;
|
|
|
|
m_OptionPower = NULL;
|
|
|
|
m_OptionPartsLocked = NULL;
|
|
|
|
m_PanelDoc = NULL;
|
|
|
|
m_PanelDocBoxSizer = NULL;
|
|
|
|
m_Doc = NULL;
|
|
|
|
m_Keywords = NULL;
|
|
|
|
m_Docfile = NULL;
|
|
|
|
m_ButtonCopyDoc = NULL;
|
|
|
|
m_PanelAlias = NULL;
|
2008-04-30 11:52:34 +00:00
|
|
|
m_btClose = NULL;
|
2007-06-05 12:10:51 +00:00
|
|
|
////@end WinEDA_PartPropertiesFrame member initialisation
|
|
|
|
|
|
|
|
////@begin WinEDA_PartPropertiesFrame creation
|
2008-04-30 11:52:34 +00:00
|
|
|
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
|
2007-06-05 12:10:51 +00:00
|
|
|
wxDialog::Create( parent, id, caption, pos, size, style );
|
|
|
|
|
|
|
|
CreateControls();
|
2008-04-30 11:52:34 +00:00
|
|
|
if (GetSizer())
|
|
|
|
{
|
|
|
|
GetSizer()->SetSizeHints(this);
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
Centre();
|
|
|
|
////@end WinEDA_PartPropertiesFrame creation
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Control creation for WinEDA_PartPropertiesFrame
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PartPropertiesFrame::CreateControls()
|
2008-12-31 15:01:29 +00:00
|
|
|
{
|
2007-06-05 12:10:51 +00:00
|
|
|
////@begin WinEDA_PartPropertiesFrame content construction
|
2009-04-29 17:09:00 +00:00
|
|
|
// Generated by DialogBlocks, 24/04/2009 14:21:42 (unregistered)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
WinEDA_PartPropertiesFrame* itemDialog1 = this;
|
|
|
|
|
|
|
|
m_GeneralBoxSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemDialog1->SetSizer(m_GeneralBoxSizer);
|
|
|
|
|
2008-04-30 11:52:34 +00:00
|
|
|
m_NoteBook = new wxNotebook( itemDialog1, ID_LIBEDIT_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxNB_TOP );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
m_PanelBasic = new wxPanel( m_NoteBook, ID_PANEL_BASIC, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
|
|
|
m_PanelBasicBoxSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_PanelBasic->SetSizer(m_PanelBasicBoxSizer);
|
|
|
|
|
|
|
|
wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox(m_PanelBasic, wxID_ANY, _("General :"));
|
|
|
|
m_OptionsBoxSizer = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);
|
|
|
|
m_PanelBasicBoxSizer->Add(m_OptionsBoxSizer, 0, wxALIGN_LEFT|wxALL, 5);
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_PanelBasicBoxSizer->Add(itemBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);
|
|
|
|
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemBoxSizer7->Add(itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
2009-04-29 17:09:00 +00:00
|
|
|
wxStaticText* itemStaticText9 = new wxStaticText( m_PanelBasic, wxID_STATIC, _("Number of Units:"), wxDefaultPosition, wxDefaultSize, 0 );
|
2007-06-05 12:10:51 +00:00
|
|
|
itemBoxSizer8->Add(itemStaticText9, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
|
|
|
2008-04-30 11:52:34 +00:00
|
|
|
SelNumberOfUnits = new wxSpinCtrl( m_PanelBasic, ID_SPINCTRL1, _T("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 16, 1 );
|
2007-06-05 12:10:51 +00:00
|
|
|
itemBoxSizer8->Add(SelNumberOfUnits, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
|
|
|
|
itemBoxSizer7->Add(itemBoxSizer11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
wxStaticText* itemStaticText12 = new wxStaticText( m_PanelBasic, wxID_STATIC, _("Skew:"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer11->Add(itemStaticText12, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
|
|
|
|
|
|
m_SetSkew = new wxSpinCtrl( m_PanelBasic, ID_SPINCTRL, _T("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
|
|
|
|
itemBoxSizer11->Add(m_SetSkew, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
m_OptionPower = new wxCheckBox( m_PanelBasic, ID_CHECKBOX, _("Power Symbol"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
2007-06-05 12:10:51 +00:00
|
|
|
m_OptionPower->SetValue(false);
|
|
|
|
m_PanelBasicBoxSizer->Add(m_OptionPower, 0, wxGROW|wxALL, 5);
|
|
|
|
|
|
|
|
m_OptionPartsLocked = new wxCheckBox( m_PanelBasic, ID_CHECKBOX1, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
|
|
|
m_OptionPartsLocked->SetValue(false);
|
|
|
|
m_PanelBasicBoxSizer->Add(m_OptionPartsLocked, 0, wxGROW|wxALL, 5);
|
|
|
|
|
|
|
|
m_NoteBook->AddPage(m_PanelBasic, _("Options"));
|
|
|
|
|
|
|
|
m_PanelDoc = new wxPanel( m_NoteBook, ID_PANEL_DOC, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
|
|
|
m_PanelDocBoxSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_PanelDoc->SetSizer(m_PanelDocBoxSizer);
|
|
|
|
|
2009-06-08 12:29:52 +00:00
|
|
|
wxStaticText* itemStaticText18 = new wxStaticText( m_PanelDoc, wxID_STATIC, _("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
|
2007-06-05 12:10:51 +00:00
|
|
|
m_PanelDocBoxSizer->Add(itemStaticText18, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
|
|
|
|
|
|
m_Doc = new wxTextCtrl( m_PanelDoc, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_PanelDocBoxSizer->Add(m_Doc, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText20 = new wxStaticText( m_PanelDoc, wxID_STATIC, _("Keywords:"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_PanelDocBoxSizer->Add(itemStaticText20, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
|
|
|
|
|
|
m_Keywords = new wxTextCtrl( m_PanelDoc, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_PanelDocBoxSizer->Add(m_Keywords, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText22 = new wxStaticText( m_PanelDoc, wxID_STATIC, _("DocFileName:"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_PanelDocBoxSizer->Add(itemStaticText22, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
|
|
|
|
|
|
m_Docfile = new wxTextCtrl( m_PanelDoc, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
m_PanelDocBoxSizer->Add(m_Docfile, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_PanelDocBoxSizer->Add(itemBoxSizer24, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
m_ButtonCopyDoc = new wxButton( m_PanelDoc, ID_COPY_DOC_TO_ALIAS, _("Copy Doc"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer24->Add(m_ButtonCopyDoc, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxButton* itemButton26 = new wxButton( m_PanelDoc, ID_BROWSE_DOC_FILES, _("Browse DocFiles"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer24->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
|
2009-06-08 12:29:52 +00:00
|
|
|
m_NoteBook->AddPage(m_PanelDoc, _("Description"));
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
m_PanelAlias = new wxPanel( m_NoteBook, ID_PANEL_ALIAS, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
|
|
|
|
|
|
|
m_NoteBook->AddPage(m_PanelAlias, _("Alias"));
|
|
|
|
|
|
|
|
m_GeneralBoxSizer->Add(m_NoteBook, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_GeneralBoxSizer->Add(itemBoxSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
|
|
|
2008-04-30 11:52:34 +00:00
|
|
|
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemBoxSizer28->Add(m_btClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
wxButton* itemButton30 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemButton30->SetDefault();
|
|
|
|
itemBoxSizer28->Add(itemButton30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
|
|
|
|
|
|
////@end WinEDA_PartPropertiesFrame content construction
|
2008-04-30 11:52:34 +00:00
|
|
|
m_btClose->SetFocus();
|
2007-06-05 12:10:51 +00:00
|
|
|
BuildPanelBasic();
|
|
|
|
BuildPanelDoc();
|
|
|
|
BuildPanelAlias();
|
|
|
|
BuildPanelFootprintFilter();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Should we show tooltips?
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool WinEDA_PartPropertiesFrame::ShowToolTips()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Get bitmap resources
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxBitmap WinEDA_PartPropertiesFrame::GetBitmapResource( const wxString& name )
|
|
|
|
{
|
|
|
|
// Bitmap retrieval
|
|
|
|
////@begin WinEDA_PartPropertiesFrame bitmap retrieval
|
|
|
|
wxUnusedVar(name);
|
|
|
|
return wxNullBitmap;
|
|
|
|
////@end WinEDA_PartPropertiesFrame bitmap retrieval
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Get icon resources
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxIcon WinEDA_PartPropertiesFrame::GetIconResource( const wxString& name )
|
|
|
|
{
|
|
|
|
// Icon retrieval
|
|
|
|
////@begin WinEDA_PartPropertiesFrame icon retrieval
|
|
|
|
wxUnusedVar(name);
|
|
|
|
return wxNullIcon;
|
|
|
|
////@end WinEDA_PartPropertiesFrame icon retrieval
|
|
|
|
}
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPY_DOC_TO_ALIAS
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PartPropertiesFrame::OnCopyDocToAliasClick( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
CopyDocToAlias(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BROWSE_DOC_FILES
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PartPropertiesFrame::OnBrowseDocFilesClick( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
BrowseAndSelectDocFile(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PartPropertiesFrame::OnCancelClick( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
EndModal(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PartPropertiesFrame::OnOkClick( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
PartPropertiesAccept(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
|