Libedit: fix minor bug: Copy doc not working in Properties dialog.

This commit is contained in:
jean-pierre charras 2012-05-23 12:06:33 +02:00
parent aac1010636
commit cdd60c956e
5 changed files with 3673 additions and 3671 deletions

View File

@ -236,25 +236,27 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event )
}
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::CopyDocToAlias( wxCommandEvent& event )
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::CopyDocFromRootToAlias( wxCommandEvent& event )
{
if( m_Parent == NULL )
return;
LIB_ALIAS* alias;
LIB_ALIAS* parent_alias;
LIB_COMPONENT* component = m_Parent->GetComponent();
if( component == NULL )
return;
alias = component->GetAlias( m_Parent->GetAliasName() );
// search for the main alias: this is the first alias in alias list
// something like the main component
parent_alias = component->GetAlias( 0 );
if( alias == NULL )
if( parent_alias == NULL ) // Should never occur (bug)
return;
m_DocCtrl->SetValue( alias->GetDescription() );
m_DocfileCtrl->SetValue( alias->GetDocFileName() );
m_KeywordsCtrl->SetValue( alias->GetKeyWords() );
m_DocCtrl->SetValue( parent_alias->GetDescription() );
m_DocfileCtrl->SetValue( parent_alias->GetDocFileName() );
m_KeywordsCtrl->SetValue( parent_alias->GetKeyWords() );
}

View File

@ -34,7 +34,7 @@ private:
void AddAliasOfPart(wxCommandEvent& event);
bool ChangeNbUnitsPerPackage(int newUnit);
bool SetUnsetConvert();
void CopyDocToAlias(wxCommandEvent& event);
void CopyDocFromRootToAlias(wxCommandEvent& event);
void BrowseAndSelectDocFile(wxCommandEvent& event);
void DeleteAllFootprintFilter(wxCommandEvent& event);

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012)
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -109,7 +109,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_PanelBasic->SetSizer( bSizerBasicPanel );
m_PanelBasic->Layout();
bSizerBasicPanel->Fit( m_PanelBasic );
m_NoteBook->AddPage( m_PanelBasic, _("Options"), true );
m_NoteBook->AddPage( m_PanelBasic, _("Options"), false );
m_PanelDoc = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* m_PanelDocBoxSizer;
m_PanelDocBoxSizer = new wxBoxSizer( wxVERTICAL );
@ -144,7 +144,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
wxBoxSizer* bSizerPaneldocbutts;
bSizerPaneldocbutts = new wxBoxSizer( wxHORIZONTAL );
m_ButtonCopyDoc = new wxButton( m_PanelDoc, ID_COPY_DOC_TO_ALIAS, _("Copy Doc"), wxDefaultPosition, wxDefaultSize, 0 );
m_ButtonCopyDoc = new wxButton( m_PanelDoc, ID_COPY_DOC_TO_ALIAS, _("Copy Doc from Parent"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerPaneldocbutts->Add( m_ButtonCopyDoc, 0, wxALL, 5 );
m_buttonBrowseDocFiles = new wxButton( m_PanelDoc, ID_BROWSE_DOC_FILES, _("Browse DocFiles"), wxDefaultPosition, wxDefaultSize, 0 );
@ -157,7 +157,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_PanelDoc->SetSizer( m_PanelDocBoxSizer );
m_PanelDoc->Layout();
m_PanelDocBoxSizer->Fit( m_PanelDoc );
m_NoteBook->AddPage( m_PanelDoc, _("Description"), false );
m_NoteBook->AddPage( m_PanelDoc, _("Description"), true );
m_PanelAlias = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bSizerMainPanelAlias;
bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL );
@ -257,7 +257,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
bMainSizer->Fit( this );
// Connect Events
m_ButtonCopyDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocToAlias ), NULL, this );
m_ButtonCopyDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this );
m_buttonBrowseDocFiles->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
m_ButtonAddeAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
m_ButtonDeleteOneAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );
@ -272,7 +272,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
{
// Disconnect Events
m_ButtonCopyDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocToAlias ), NULL, this );
m_ButtonCopyDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this );
m_buttonBrowseDocFiles->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
m_ButtonAddeAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
m_ButtonDeleteOneAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );

View File

@ -185,7 +185,7 @@
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Options</property>
<property name="select">1</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -1348,7 +1348,7 @@
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Description</property>
<property name="select">0</property>
<property name="select">1</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -1992,7 +1992,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_COPY_DOC_TO_ALIAS</property>
<property name="label">Copy Doc</property>
<property name="label">Copy Doc from Parent</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2021,7 +2021,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">CopyDocToAlias</event>
<event name="OnButtonClick">CopyDocFromRootToAlias</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012)
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -93,7 +93,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
wxButton* m_stdSizerButtonCancel;
// Virtual event handlers, overide them in your derived class
virtual void CopyDocToAlias( wxCommandEvent& event ) { event.Skip(); }
virtual void CopyDocFromRootToAlias( wxCommandEvent& event ) { event.Skip(); }
virtual void BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); }
virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteAliasOfPart( wxCommandEvent& event ) { event.Skip(); }