Commit cdd60c95 authored by jean-pierre charras's avatar jean-pierre charras

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

parent aac10106
...@@ -236,25 +236,27 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnOkClick( wxCommandEvent& event ) ...@@ -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 ) if( m_Parent == NULL )
return; return;
LIB_ALIAS* alias; LIB_ALIAS* parent_alias;
LIB_COMPONENT* component = m_Parent->GetComponent(); LIB_COMPONENT* component = m_Parent->GetComponent();
if( component == NULL ) if( component == NULL )
return; 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; return;
m_DocCtrl->SetValue( alias->GetDescription() ); m_DocCtrl->SetValue( parent_alias->GetDescription() );
m_DocfileCtrl->SetValue( alias->GetDocFileName() ); m_DocfileCtrl->SetValue( parent_alias->GetDocFileName() );
m_KeywordsCtrl->SetValue( alias->GetKeyWords() ); m_KeywordsCtrl->SetValue( parent_alias->GetKeyWords() );
} }
......
...@@ -34,7 +34,7 @@ private: ...@@ -34,7 +34,7 @@ private:
void AddAliasOfPart(wxCommandEvent& event); void AddAliasOfPart(wxCommandEvent& event);
bool ChangeNbUnitsPerPackage(int newUnit); bool ChangeNbUnitsPerPackage(int newUnit);
bool SetUnsetConvert(); bool SetUnsetConvert();
void CopyDocToAlias(wxCommandEvent& event); void CopyDocFromRootToAlias(wxCommandEvent& event);
void BrowseAndSelectDocFile(wxCommandEvent& event); void BrowseAndSelectDocFile(wxCommandEvent& event);
void DeleteAllFootprintFilter(wxCommandEvent& event); void DeleteAllFootprintFilter(wxCommandEvent& event);
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -109,7 +109,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx ...@@ -109,7 +109,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_PanelBasic->SetSizer( bSizerBasicPanel ); m_PanelBasic->SetSizer( bSizerBasicPanel );
m_PanelBasic->Layout(); m_PanelBasic->Layout();
bSizerBasicPanel->Fit( m_PanelBasic ); 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 ); m_PanelDoc = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* m_PanelDocBoxSizer; wxBoxSizer* m_PanelDocBoxSizer;
m_PanelDocBoxSizer = new wxBoxSizer( wxVERTICAL ); m_PanelDocBoxSizer = new wxBoxSizer( wxVERTICAL );
...@@ -144,7 +144,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx ...@@ -144,7 +144,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
wxBoxSizer* bSizerPaneldocbutts; wxBoxSizer* bSizerPaneldocbutts;
bSizerPaneldocbutts = new wxBoxSizer( wxHORIZONTAL ); 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 ); bSizerPaneldocbutts->Add( m_ButtonCopyDoc, 0, wxALL, 5 );
m_buttonBrowseDocFiles = new wxButton( m_PanelDoc, ID_BROWSE_DOC_FILES, _("Browse DocFiles"), wxDefaultPosition, wxDefaultSize, 0 ); 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 ...@@ -157,7 +157,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
m_PanelDoc->SetSizer( m_PanelDocBoxSizer ); m_PanelDoc->SetSizer( m_PanelDocBoxSizer );
m_PanelDoc->Layout(); m_PanelDoc->Layout();
m_PanelDocBoxSizer->Fit( m_PanelDoc ); 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 ); m_PanelAlias = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bSizerMainPanelAlias; wxBoxSizer* bSizerMainPanelAlias;
bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL ); bSizerMainPanelAlias = new wxBoxSizer( wxHORIZONTAL );
...@@ -257,7 +257,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx ...@@ -257,7 +257,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
bMainSizer->Fit( this ); bMainSizer->Fit( this );
// Connect Events // 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_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_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 ); 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 ...@@ -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() DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
{ {
// Disconnect Events // 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_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_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 ); m_ButtonDeleteOneAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DeleteAliasOfPart ), NULL, this );
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Options</property> <property name="label">Options</property>
<property name="select">1</property> <property name="select">0</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
...@@ -1348,7 +1348,7 @@ ...@@ -1348,7 +1348,7 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Description</property> <property name="label">Description</property>
<property name="select">0</property> <property name="select">1</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
...@@ -1992,7 +1992,7 @@ ...@@ -1992,7 +1992,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_COPY_DOC_TO_ALIAS</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="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
...@@ -2021,7 +2021,7 @@ ...@@ -2021,7 +2021,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">CopyDocToAlias</event> <event name="OnButtonClick">CopyDocFromRootToAlias</event>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -93,7 +93,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM ...@@ -93,7 +93,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
wxButton* m_stdSizerButtonCancel; wxButton* m_stdSizerButtonCancel;
// Virtual event handlers, overide them in your derived class // 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 BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); }
virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); } virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteAliasOfPart( wxCommandEvent& event ) { event.Skip(); } virtual void DeleteAliasOfPart( wxCommandEvent& event ) { event.Skip(); }
......
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