Commit df344195 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Schematic hierarchy path object improvements.

* Use Boost pointer container for sheet hierarchy object.
* Add test for modification in sheet hierarchy list object.
* Add method to clear modification flag in sheet hierarchy list object.
* Improve Doxygen comments for sheet hierarchy list object.
* Remove redundant definitions in prototypes header file.
parent 495f2a04
...@@ -2,29 +2,19 @@ ...@@ -2,29 +2,19 @@
#ifndef __PROTOS_H__ #ifndef __PROTOS_H__
#define __PROTOS_H__ #define __PROTOS_H__
#include "block_commande.h"
#include "colors.h" #include "colors.h"
#include "sch_sheet_path.h"
#include <wx/wx.h>
class EDA_ITEM;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
class EDA_DRAW_FRAME; class EDA_DRAW_FRAME;
class SCH_EDIT_FRAME; class SCH_EDIT_FRAME;
class LIB_EDIT_FRAME; class LIB_EDIT_FRAME;
class CMP_LIBRARY; class CMP_LIBRARY;
class LIB_COMPONENT;
class LIB_DRAW_ITEM;
class SCH_COMPONENT; class SCH_COMPONENT;
class SCH_SCREEN; class SCH_SCREEN;
class SCH_ITEM; class SCH_ITEM;
class SCH_SHEET_PIN;
class PLOTTER; class PLOTTER;
class SCH_SHEET; class SCH_SHEET;
class LIB_PIN;
class LABEL_OBJECT;
class NETLIST_OBJECT; class NETLIST_OBJECT;
...@@ -57,6 +47,7 @@ void SnapLibItemPoint( int OrigX, ...@@ -57,6 +47,7 @@ void SnapLibItemPoint( int OrigX,
int* ClosestX, int* ClosestX,
int* ClosestY, int* ClosestY,
SCH_COMPONENT* DrawLibItem ); SCH_COMPONENT* DrawLibItem );
bool LibItemInBox( int x1, int y1, int x2, int y2, SCH_COMPONENT* DrawLibItem ); bool LibItemInBox( int x1, int y1, int x2, int y2, SCH_COMPONENT* DrawLibItem );
/************/ /************/
...@@ -203,9 +194,7 @@ CMP_LIBRARY* SelectLibraryFromList( EDA_DRAW_FRAME* frame ); ...@@ -203,9 +194,7 @@ CMP_LIBRARY* SelectLibraryFromList( EDA_DRAW_FRAME* frame );
* 0 if canceled order * 0 if canceled order
* Place the name of the selected component list in BufName * Place the name of the selected component list in BufName
*/ */
int GetNameOfPartToLoad( EDA_DRAW_FRAME* frame, int GetNameOfPartToLoad( EDA_DRAW_FRAME* frame, CMP_LIBRARY* Lib, wxString& BufName );
CMP_LIBRARY* Lib,
wxString& BufName );
/**************/ /**************/
/* LIBARCH.CPP */ /* LIBARCH.CPP */
......
...@@ -530,4 +530,7 @@ private: ...@@ -530,4 +530,7 @@ private:
virtual EDA_ITEM* doClone() const; virtual EDA_ITEM* doClone() const;
}; };
typedef boost::ptr_vector< SCH_SHEET > SCH_SHEETS;
#endif /* CLASS_DRAWSHEET_H */ #endif /* CLASS_DRAWSHEET_H */
This diff is collapsed.
This diff is collapsed.
...@@ -346,23 +346,12 @@ void SCH_EDIT_FRAME::CreateScreens() ...@@ -346,23 +346,12 @@ void SCH_EDIT_FRAME::CreateScreens()
void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{ {
SCH_SHEET_PATH* sheet; if( m_LibeditFrame && !m_LibeditFrame->Close() ) // Can close component editor?
if( m_LibeditFrame ) // Can close component editor ?
{
if( !m_LibeditFrame->Close() )
return; return;
}
SCH_SHEET_LIST SheetList; SCH_SHEET_LIST SheetList;
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() ) if( SheetList.IsModified() )
{
if( sheet->LastScreen() && sheet->LastScreen()->IsModify() )
break;
}
if( sheet )
{ {
wxMessageDialog dialog( this, wxMessageDialog dialog( this,
_( "Schematic modified, Save before exit ?" ), _( "Schematic modified, Save before exit ?" ),
...@@ -385,15 +374,7 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) ...@@ -385,15 +374,7 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
} }
} }
for( sheet = SheetList.GetFirst(); SheetList.ClearModifyStatus();
sheet != NULL;
sheet = SheetList.GetNext() )
{
if( sheet->LastScreen() )
{
sheet->LastScreen()->ClrModify();
}
}
if( !g_RootSheet->GetScreen()->GetFileName().IsEmpty() if( !g_RootSheet->GetScreen()->GetFileName().IsEmpty()
&& (g_RootSheet->GetScreen()->GetDrawItems() != NULL) ) && (g_RootSheet->GetScreen()->GetDrawItems() != NULL) )
......
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