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;
...@@ -52,17 +42,18 @@ void IncrementLabelMember( wxString& name ); ...@@ -52,17 +42,18 @@ void IncrementLabelMember( wxString& name );
/****************/ /****************/
void InstallCmpeditFrame( SCH_EDIT_FRAME* parent, wxPoint& pos, SCH_COMPONENT* m_Cmp ); void InstallCmpeditFrame( SCH_EDIT_FRAME* parent, wxPoint& pos, SCH_COMPONENT* m_Cmp );
void SnapLibItemPoint( int OrigX, void SnapLibItemPoint( int OrigX,
int OrigY, int OrigY,
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 );
/************/ /************/
/* BLOCK.CPP */ /* BLOCK.CPP */
/************/ /************/
void DeleteStruct( EDA_DRAW_PANEL* panel, wxDC* DC, SCH_ITEM* DrawStruct ); void DeleteStruct( EDA_DRAW_PANEL* panel, wxDC* DC, SCH_ITEM* DrawStruct );
// operations_on_item_lists.cpp // operations_on_item_lists.cpp
...@@ -82,7 +73,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* DrawStruct, bool aClone = false ); ...@@ -82,7 +73,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* DrawStruct, bool aClone = false );
/* LOCATE.CPP */ /* LOCATE.CPP */
/*************/ /*************/
SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ); SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen );
/* function PickStruct: /* function PickStruct:
* Search at location pos * Search at location pos
...@@ -127,14 +118,14 @@ void RedrawActiveWindow( EDA_DRAW_PANEL* panel, wxDC* DC ); ...@@ -127,14 +118,14 @@ void RedrawActiveWindow( EDA_DRAW_PANEL* panel, wxDC* DC );
/**************/ /**************/
/* EELAYER.CPP */ /* EELAYER.CPP */
/**************/ /**************/
void SeedLayers(); void SeedLayers();
EDA_Colors ReturnLayerColor( int Layer ); EDA_Colors ReturnLayerColor( int Layer );
/**************/ /**************/
/* NETLIST.CPP */ /* NETLIST.CPP */
/**************/ /**************/
int IsBusLabel( const wxString& LabelDrawList ); int IsBusLabel( const wxString& LabelDrawList );
/************/ /************/
/* PLOT.CPP */ /* PLOT.CPP */
...@@ -181,10 +172,10 @@ void InstallPineditFrame( LIB_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos ) ...@@ -181,10 +172,10 @@ void InstallPineditFrame( LIB_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos )
* 1 if selected component * 1 if selected component
* 0 if canceled order * 0 if canceled order
*/ */
int DisplayComponentsNamesInLib( EDA_DRAW_FRAME* frame, int DisplayComponentsNamesInLib( EDA_DRAW_FRAME* frame,
CMP_LIBRARY* Library, CMP_LIBRARY* Library,
wxString& Buffer, wxString& Buffer,
wxString& OldName ); wxString& OldName );
/** /**
* Function SelectLibraryFromList * Function SelectLibraryFromList
...@@ -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 */
...@@ -227,7 +216,7 @@ void RemoteCommand( const char* cmdline ); ...@@ -227,7 +216,7 @@ void RemoteCommand( const char* cmdline );
/* Prototypes in netlist_control.cpp */ /* Prototypes in netlist_control.cpp */
void FreeNetObjectsList( std::vector <NETLIST_OBJECT*>& aNetObjectslist ); void FreeNetObjectsList( std::vector <NETLIST_OBJECT*>& aNetObjectslist );
/** /**
* Function ReturnUserNetlistTypeName * Function ReturnUserNetlistTypeName
......
...@@ -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?
return;
if( m_LibeditFrame ) // Can close component editor ?
{
if( !m_LibeditFrame->Close() )
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