diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index f1c4cc9da7..ac6ef147c7 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -156,6 +156,7 @@ set( EESCHEMA_DLGS ) set( EESCHEMA_WIDGETS + widgets/hierarchy_pane.cpp widgets/pin_shape_combobox.cpp widgets/pin_type_combobox.cpp widgets/symbol_preview_widget.cpp @@ -202,7 +203,6 @@ set( EESCHEMA_SRCS files-io.cpp generate_alias_info.cpp picksymbol.cpp - hierarch.cpp lib_field.cpp lib_item.cpp lib_pin.cpp diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index eeb8f4c347..2e09931c88 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 5b6f8fdfb8..dcd8f9960a 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -79,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -154,7 +154,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateVToolbar(); ReCreateOptToolbar(); - m_hierarchy = new HIERARCHY_NAVIG_PANEL( this ); + m_hierarchy = new HIERARCHY_PANE( this ); // Initialize common print setup dialog settings. m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER ); diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index e85e42df51..c27eca07ae 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -57,7 +57,7 @@ class SCHEMATIC; class DIALOG_SCH_FIND; class wxFindReplaceData; class RESCUER; -class HIERARCHY_NAVIG_PANEL; +class HIERARCHY_PANE; // @todo Move this to transform alone with all of the transform manipulation code. /// enum used in RotationMiroir() @@ -933,7 +933,7 @@ private: DIALOG_SCH_FIND* m_findReplaceDialog; - HIERARCHY_NAVIG_PANEL* m_hierarchy; + HIERARCHY_PANE* m_hierarchy; bool m_syncingPcbToSchSelection; // Recursion guard when synchronizing selection from PCB }; diff --git a/eeschema/toolbars_sch_editor.cpp b/eeschema/toolbars_sch_editor.cpp index 8384b17839..4b6b6a2b13 100644 --- a/eeschema/toolbars_sch_editor.cpp +++ b/eeschema/toolbars_sch_editor.cpp @@ -30,12 +30,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include /* Create the main Horizontal Toolbar for the schematic editor diff --git a/eeschema/hierarch.cpp b/eeschema/widgets/hierarchy_pane.cpp similarity index 79% rename from eeschema/hierarch.cpp rename to eeschema/widgets/hierarchy_pane.cpp index f345cabb36..c664d614d5 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/widgets/hierarchy_pane.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ int HIERARCHY_TREE::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemI } -HIERARCHY_NAVIG_PANEL::HIERARCHY_NAVIG_PANEL( SCH_EDIT_FRAME* aParent ) : +HIERARCHY_PANE::HIERARCHY_PANE( SCH_EDIT_FRAME* aParent ) : WX_PANEL( aParent ) { wxASSERT( dynamic_cast( aParent ) ); @@ -98,23 +98,23 @@ HIERARCHY_NAVIG_PANEL::HIERARCHY_NAVIG_PANEL( SCH_EDIT_FRAME* aParent ) : UpdateHierarchyTree(); // Enable selection events - Bind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Bind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_NAVIG_PANEL::onRightClick, this ); + Bind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Bind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onRightClick, this ); m_events_bound = true; } -HIERARCHY_NAVIG_PANEL::~HIERARCHY_NAVIG_PANEL() +HIERARCHY_PANE::~HIERARCHY_PANE() { - Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_NAVIG_PANEL::onRightClick, this ); + Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onRightClick, this ); } -void HIERARCHY_NAVIG_PANEL::buildHierarchyTree( SCH_SHEET_PATH* aList, const wxTreeItemId& aParent ) +void HIERARCHY_PANE::buildHierarchyTree( SCH_SHEET_PATH* aList, const wxTreeItemId& aParent ) { std::vector sheetChildren; aList->LastScreen()->GetSheets( &sheetChildren ); @@ -137,16 +137,16 @@ void HIERARCHY_NAVIG_PANEL::buildHierarchyTree( SCH_SHEET_PATH* aList, const wxT } -void HIERARCHY_NAVIG_PANEL::UpdateHierarchySelection() +void HIERARCHY_PANE::UpdateHierarchySelection() { bool eventsWereBound = m_events_bound; if( eventsWereBound ) { // Disable selection events - Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_NAVIG_PANEL::onRightClick, this ); + Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onRightClick, this ); m_events_bound = false; } @@ -195,16 +195,16 @@ void HIERARCHY_NAVIG_PANEL::UpdateHierarchySelection() if( eventsWereBound ) { // Enable selection events - Bind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Bind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_NAVIG_PANEL::onRightClick, this ); + Bind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Bind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onRightClick, this ); m_events_bound = true; } } -void HIERARCHY_NAVIG_PANEL::UpdateHierarchyTree() +void HIERARCHY_PANE::UpdateHierarchyTree() { Freeze(); @@ -213,9 +213,9 @@ void HIERARCHY_NAVIG_PANEL::UpdateHierarchyTree() if( eventsWereBound ) { // Disable selection events - Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_NAVIG_PANEL::onRightClick, this ); + Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Unbind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onRightClick, this ); m_events_bound = false; } @@ -236,9 +236,9 @@ void HIERARCHY_NAVIG_PANEL::UpdateHierarchyTree() if( eventsWereBound ) { // Enable selection events - Bind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Bind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_PANEL::onSelectSheetPath, this ); - Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_NAVIG_PANEL::onRightClick, this ); + Bind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Bind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_PANE::onSelectSheetPath, this ); + Bind( wxEVT_TREE_ITEM_RIGHT_CLICK, &HIERARCHY_PANE::onRightClick, this ); m_events_bound = true; } @@ -247,7 +247,7 @@ void HIERARCHY_NAVIG_PANEL::UpdateHierarchyTree() } -void HIERARCHY_NAVIG_PANEL::onSelectSheetPath( wxTreeEvent& aEvent ) +void HIERARCHY_PANE::onSelectSheetPath( wxTreeEvent& aEvent ) { wxTreeItemId itemSel = m_tree->GetSelection(); TREE_ITEM_DATA* itemData = static_cast( m_tree->GetItemData( itemSel ) ); @@ -258,7 +258,7 @@ void HIERARCHY_NAVIG_PANEL::onSelectSheetPath( wxTreeEvent& aEvent ) } -void HIERARCHY_NAVIG_PANEL::onRightClick( wxTreeEvent& aEvent ) +void HIERARCHY_PANE::onRightClick( wxTreeEvent& aEvent ) { wxTreeItemId itemSel = m_tree->GetFocusedItem(); @@ -307,7 +307,7 @@ void HIERARCHY_NAVIG_PANEL::onRightClick( wxTreeEvent& aEvent ) } -wxString HIERARCHY_NAVIG_PANEL::getRootString() +wxString HIERARCHY_PANE::getRootString() { SCH_SHEET* rootSheet = &m_frame->Schematic().Root(); SCH_SHEET_PATH rootPath; @@ -317,7 +317,7 @@ wxString HIERARCHY_NAVIG_PANEL::getRootString() } -wxString HIERARCHY_NAVIG_PANEL::formatPageString( const wxString& aName, const wxString& aPage ) +wxString HIERARCHY_PANE::formatPageString( const wxString& aName, const wxString& aPage ) { return aName + wxT( " " ) + wxString::Format( _( "(page %s)" ), aPage ); } diff --git a/eeschema/hierarch.h b/eeschema/widgets/hierarchy_pane.h similarity index 91% rename from eeschema/hierarch.h rename to eeschema/widgets/hierarchy_pane.h index b7e23432ee..a1b5774d61 100644 --- a/eeschema/hierarch.h +++ b/eeschema/widgets/hierarchy_pane.h @@ -25,19 +25,19 @@ */ -#ifndef HIERARCH_H -#define HIERARCH_H +#ifndef HIERARCHY_PANE_H +#define HIERARCHY_PANE_H #include #include // wxRTTI macros #include -#include +#include "widgets/wx_panel.h" class SCH_EDIT_FRAME; class SCH_SHEET_PATH; -class HIERARCHY_NAVIG_PANEL; +class HIERARCHY_PANE; /** @@ -49,7 +49,7 @@ class HIERARCHY_NAVIG_PANEL; class HIERARCHY_TREE : public wxTreeCtrl { public: - HIERARCHY_TREE( HIERARCHY_NAVIG_PANEL* parent ) : + HIERARCHY_TREE( HIERARCHY_PANE* parent ) : wxTreeCtrl( (wxWindow*) parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS, wxDefaultValidator, wxT( "HierachyTreeCtrl" ) ) { @@ -64,12 +64,12 @@ private: }; -class HIERARCHY_NAVIG_PANEL : public WX_PANEL +class HIERARCHY_PANE : public WX_PANEL { public: - HIERARCHY_NAVIG_PANEL( SCH_EDIT_FRAME* aParent ); + HIERARCHY_PANE( SCH_EDIT_FRAME* aParent ); - ~HIERARCHY_NAVIG_PANEL(); + ~HIERARCHY_PANE(); /** * Update the hierarchical tree of the schematic. @@ -121,4 +121,4 @@ private: bool m_events_bound; }; -#endif // HIERARCH_H +#endif // HIERARCHY_PANE_H