Commit c79077c9 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Minor fixes and lots of coding policy changes.

parent e6b2f392
...@@ -20,7 +20,7 @@ S3D_Vertex::S3D_Vertex() ...@@ -20,7 +20,7 @@ S3D_Vertex::S3D_Vertex()
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) : S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
EDA_BaseStruct( father, NOT_USED ) EDA_ITEM( father, NOT_USED )
{ {
m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0; m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
m_SpecularColor.x = m_SpecularColor.y = m_SpecularColor.z = 1.0; m_SpecularColor.x = m_SpecularColor.y = m_SpecularColor.z = 1.0;
...@@ -57,8 +57,8 @@ void S3D_MASTER::Copy( S3D_MASTER* pattern ) ...@@ -57,8 +57,8 @@ void S3D_MASTER::Copy( S3D_MASTER* pattern )
} }
S3D_MASTER::S3D_MASTER( EDA_BaseStruct* aParent ) : S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
EDA_BaseStruct( aParent, NOT_USED ) EDA_ITEM( aParent, NOT_USED )
{ {
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_3D_Drawings = NULL; m_3D_Drawings = NULL;
...@@ -85,8 +85,8 @@ S3D_MASTER:: ~S3D_MASTER() ...@@ -85,8 +85,8 @@ S3D_MASTER:: ~S3D_MASTER()
} }
Struct3D_Shape::Struct3D_Shape( EDA_BaseStruct* aParent ) : Struct3D_Shape::Struct3D_Shape( EDA_ITEM* aParent ) :
EDA_BaseStruct( aParent, NOT_USED ) EDA_ITEM( aParent, NOT_USED )
{ {
m_3D_Coord = NULL; m_3D_Coord = NULL;
m_3D_CoordIndex = NULL; m_3D_CoordIndex = NULL;
......
...@@ -320,10 +320,9 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -320,10 +320,9 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
} }
/* draw graphic items */ /* draw graphic items */
EDA_BaseStruct* PtStruct; EDA_ITEM* PtStruct;
for( PtStruct = pcb->m_Drawings;
PtStruct != NULL; for( PtStruct = pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Next() )
PtStruct = PtStruct->Next() )
{ {
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
...@@ -691,8 +690,9 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -691,8 +690,9 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
if( !As3dShape ) if( !As3dShape )
{ {
// The footprint does not have a 3D shape, draw its 2D shape instead // The footprint does not have a 3D shape, draw its 2D shape instead
EDA_BaseStruct* Struct = m_Drawings; EDA_ITEM* Struct = m_Drawings;
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
for( ; Struct != NULL; Struct = Struct->Next() ) for( ; Struct != NULL; Struct = Struct->Next() )
{ {
switch( Struct->Type() ) switch( Struct->Type() )
......
...@@ -34,7 +34,7 @@ public: ...@@ -34,7 +34,7 @@ public:
public: S3D_Vertex(); public: S3D_Vertex();
}; };
class S3D_MATERIAL : public EDA_BaseStruct /* openGL "material" data*/ class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/
{ {
public: public:
wxString m_Name; wxString m_Name;
...@@ -55,7 +55,7 @@ public: S3D_MATERIAL( S3D_MASTER* father, const wxString& name ); ...@@ -55,7 +55,7 @@ public: S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
/* Master structure for a 3D item description */ /* Master structure for a 3D item description */
class S3D_MASTER : public EDA_BaseStruct class S3D_MASTER : public EDA_ITEM
{ {
public: public:
wxString m_Shape3DName; /* 3D shape name in 3D library */ wxString m_Shape3DName; /* 3D shape name in 3D library */
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
Struct3D_Shape* m_3D_Drawings; Struct3D_Shape* m_3D_Drawings;
S3D_MATERIAL* m_Materials; S3D_MATERIAL* m_Materials;
public: S3D_MASTER( EDA_BaseStruct* aParent ); public: S3D_MASTER( EDA_ITEM* aParent );
~S3D_MASTER(); ~S3D_MASTER();
S3D_MASTER* Next() const { return (S3D_MASTER*) Pnext; } S3D_MASTER* Next() const { return (S3D_MASTER*) Pnext; }
...@@ -90,14 +90,14 @@ public: S3D_MASTER( EDA_BaseStruct* aParent ); ...@@ -90,14 +90,14 @@ public: S3D_MASTER( EDA_BaseStruct* aParent );
/* Describes a complex 3D */ /* Describes a complex 3D */
class Struct3D_Shape : public EDA_BaseStruct class Struct3D_Shape : public EDA_ITEM
{ {
public: public:
S3D_Vertex* m_3D_Coord; S3D_Vertex* m_3D_Coord;
int* m_3D_CoordIndex; int* m_3D_CoordIndex;
int m_3D_Points; int m_3D_Points;
public: Struct3D_Shape( EDA_BaseStruct* aParent ); public: Struct3D_Shape( EDA_ITEM* aParent );
~Struct3D_Shape(); ~Struct3D_Shape();
Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; } Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; }
......
...@@ -4,6 +4,19 @@ KiCad ChangeLog 2010 ...@@ -4,6 +4,19 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-dec-08 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++All
* Coding policy object naming and formating fixes.
++GerbView
* Fix compiler warnings.
++Common
* Change item list type from SCH_ITEM to EDA_BaseStruct in BASE_SCREEN
object.
* Encapsulate BASE_SCREEN drawing item list member.
* Change grid container from wxWidgets to standard C++ container.
2010-dec-07 UPDATE Wayne Stambaugh <stambaughw@verizon.net> 2010-dec-07 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================ ================================================================================
++EESchema ++EESchema
......
...@@ -13,18 +13,15 @@ ...@@ -13,18 +13,15 @@
#include "class_base_screen.h" #include "class_base_screen.h"
#include "id.h" #include "id.h"
/* Implement wxSize array for grid list implementation. */
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY( GridArray )
BASE_SCREEN* ActiveScreen = NULL; BASE_SCREEN* ActiveScreen = NULL;
#define CURSOR_SIZE 12 /* size of the cross cursor. */ #define CURSOR_SIZE 12 /* size of the cross cursor. */
BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType ) BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_ITEM( aType )
{ {
EEDrawList = NULL; /* Schematic items list */ m_drawList = NULL; /* Draw items list */
m_UndoRedoCountMax = 10; /* undo/Redo command Max depth, 10 is a m_UndoRedoCountMax = 10; /* undo/Redo command Max depth, 10 is a
* reasonable value */ * reasonable value */
m_FirstRedraw = TRUE; m_FirstRedraw = TRUE;
...@@ -341,34 +338,41 @@ bool BASE_SCREEN::SetLastZoom() ...@@ -341,34 +338,41 @@ bool BASE_SCREEN::SetLastZoom()
} }
void BASE_SCREEN::SetGridList( GridArray& gridlist ) void BASE_SCREEN::SetGridList( GRIDS& gridlist )
{ {
if( !m_GridList.IsEmpty() ) if( !m_grids.empty() )
m_GridList.Clear(); m_grids.clear();
m_GridList = gridlist; m_grids = gridlist;
}
void BASE_SCREEN::GetGrids( GRIDS& aList )
{
for( size_t i = 0; i < m_grids.size(); i++ )
aList.push_back( m_grids[ i ] );
} }
void BASE_SCREEN::SetGrid( const wxRealPoint& size ) void BASE_SCREEN::SetGrid( const wxRealPoint& size )
{ {
wxASSERT( !m_GridList.IsEmpty() ); wxASSERT( !m_grids.empty() );
size_t i; size_t i;
GRID_TYPE nearest_grid = m_GridList[0]; GRID_TYPE nearest_grid = m_grids[0];
for( i = 0; i < m_GridList.GetCount(); i++ ) for( i = 0; i < m_grids.size(); i++ )
{ {
if( m_GridList[i].m_Size == size ) if( m_grids[i].m_Size == size )
{ {
m_Grid = m_GridList[i]; m_Grid = m_grids[i];
return; return;
} }
// keep trace of the nearest grill size, if the exact size is not found // keep trace of the nearest grill size, if the exact size is not found
if ( size.x < m_GridList[i].m_Size.x ) if ( size.x < m_grids[i].m_Size.x )
nearest_grid = m_GridList[i]; nearest_grid = m_grids[i];
} }
m_Grid = nearest_grid; m_Grid = nearest_grid;
...@@ -382,20 +386,20 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size ) ...@@ -382,20 +386,20 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size )
/* Set grid size from command ID. */ /* Set grid size from command ID. */
void BASE_SCREEN::SetGrid( int id ) void BASE_SCREEN::SetGrid( int id )
{ {
wxASSERT( !m_GridList.IsEmpty() ); wxASSERT( !m_grids.empty() );
size_t i; size_t i;
for( i = 0; i < m_GridList.GetCount(); i++ ) for( i = 0; i < m_grids.size(); i++ )
{ {
if( m_GridList[i].m_Id == id ) if( m_grids[i].m_Id == id )
{ {
m_Grid = m_GridList[i]; m_Grid = m_grids[i];
return; return;
} }
} }
m_Grid = m_GridList[0]; m_Grid = m_grids[0];
wxLogWarning( wxT( "Grid ID %d not in grid list, falling back to " ) \ wxLogWarning( wxT( "Grid ID %d not in grid list, falling back to " ) \
wxT( "grid size( %g, %g )." ), id, m_Grid.m_Size.x, wxT( "grid size( %g, %g )." ), id, m_Grid.m_Size.x,
...@@ -407,29 +411,27 @@ void BASE_SCREEN::AddGrid( const GRID_TYPE& grid ) ...@@ -407,29 +411,27 @@ void BASE_SCREEN::AddGrid( const GRID_TYPE& grid )
{ {
size_t i; size_t i;
for( i = 0; i < m_GridList.GetCount(); i++ ) for( i = 0; i < m_grids.size(); i++ )
{ {
if( m_GridList[i].m_Size == grid.m_Size if( m_grids[i].m_Size == grid.m_Size && grid.m_Id != ID_POPUP_GRID_USER )
&& grid.m_Id != ID_POPUP_GRID_USER )
{ {
wxLogDebug( wxT( "Discarding duplicate grid size( %g, %g )." ), wxLogDebug( wxT( "Discarding duplicate grid size( %g, %g )." ),
grid.m_Size.x, grid.m_Size.y ); grid.m_Size.x, grid.m_Size.y );
return; return;
} }
if( m_GridList[i].m_Id == grid.m_Id )
if( m_grids[i].m_Id == grid.m_Id )
{ {
wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " ) \ wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " ) \
wxT( "size( %g, %g )." ), wxT( "size( %g, %g )." ),
grid.m_Id, m_GridList[i].m_Size.x, grid.m_Id, m_grids[i].m_Size.x,
m_GridList[i].m_Size.y, grid.m_Size.x, grid.m_Size.y ); m_grids[i].m_Size.y, grid.m_Size.x, grid.m_Size.y );
m_GridList[i].m_Size = grid.m_Size; m_grids[i].m_Size = grid.m_Size;
return; return;
} }
} }
// wxLogDebug( wxT( "Adding grid ID %d size( %d, %d ) to grid list." ), grid.m_Id, grid.m_Size.x, grid.m_Size.y ); m_grids.push_back( grid );
m_GridList.Add( grid );
} }
...@@ -473,18 +475,27 @@ void BASE_SCREEN::AddGrid( const wxRealPoint& size, UserUnitType aUnit, int id ) ...@@ -473,18 +475,27 @@ void BASE_SCREEN::AddGrid( const wxRealPoint& size, UserUnitType aUnit, int id )
} }
GRID_TYPE& BASE_SCREEN::GetGrid( size_t aIndex )
{
wxCHECK_MSG( !m_grids.empty() && aIndex < m_grids.size(), m_Grid,
wxT( "Cannot get grid object outside the bounds of the grid list." ) );
return m_grids[ aIndex ];
}
GRID_TYPE BASE_SCREEN::GetGrid() GRID_TYPE BASE_SCREEN::GetGrid()
{ {
return m_Grid; return m_Grid;
} }
/*********************************/
const wxPoint& BASE_SCREEN::GetGridOrigin() const wxPoint& BASE_SCREEN::GetGridOrigin()
/*********************************/
{ {
return m_GridOrigin; return m_GridOrigin;
} }
wxRealPoint BASE_SCREEN::GetGridSize() wxRealPoint BASE_SCREEN::GetGridSize()
{ {
return m_Grid.m_Size; return m_Grid.m_Size;
...@@ -515,6 +526,7 @@ void BASE_SCREEN::PushCommandToUndoList( PICKED_ITEMS_LIST* aNewitem ) ...@@ -515,6 +526,7 @@ void BASE_SCREEN::PushCommandToUndoList( PICKED_ITEMS_LIST* aNewitem )
/* Delete the extra items, if count max reached */ /* Delete the extra items, if count max reached */
int extraitems = GetUndoCommandCount() - m_UndoRedoCountMax; int extraitems = GetUndoCommandCount() - m_UndoRedoCountMax;
if( extraitems > 0 ) // Delete the extra items if( extraitems > 0 ) // Delete the extra items
ClearUndoORRedoList( m_UndoList, extraitems ); ClearUndoORRedoList( m_UndoList, extraitems );
} }
...@@ -526,6 +538,7 @@ void BASE_SCREEN::PushCommandToRedoList( PICKED_ITEMS_LIST* aNewitem ) ...@@ -526,6 +538,7 @@ void BASE_SCREEN::PushCommandToRedoList( PICKED_ITEMS_LIST* aNewitem )
/* Delete the extra items, if count max reached */ /* Delete the extra items, if count max reached */
int extraitems = GetRedoCommandCount() - m_UndoRedoCountMax; int extraitems = GetRedoCommandCount() - m_UndoRedoCountMax;
if( extraitems > 0 ) // Delete the extra items if( extraitems > 0 ) // Delete the extra items
ClearUndoORRedoList( m_RedoList, extraitems ); ClearUndoORRedoList( m_RedoList, extraitems );
} }
...@@ -543,7 +556,7 @@ PICKED_ITEMS_LIST* BASE_SCREEN::PopCommandFromRedoList( ) ...@@ -543,7 +556,7 @@ PICKED_ITEMS_LIST* BASE_SCREEN::PopCommandFromRedoList( )
} }
void BASE_SCREEN::AddItem( EDA_BaseStruct* aItem ) void BASE_SCREEN::AddItem( EDA_ITEM* aItem )
{ {
wxCHECK_RET( aItem != NULL, wxT( "Attempt to add NULL item pointer to " ) + GetClass() + wxCHECK_RET( aItem != NULL, wxT( "Attempt to add NULL item pointer to " ) + GetClass() +
wxT( "item list" ) ); wxT( "item list" ) );
...@@ -551,7 +564,7 @@ void BASE_SCREEN::AddItem( EDA_BaseStruct* aItem ) ...@@ -551,7 +564,7 @@ void BASE_SCREEN::AddItem( EDA_BaseStruct* aItem )
} }
void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_BaseStruct* aItem ) void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_ITEM* aItem )
{ {
wxCHECK_RET( aItem != NULL, wxT( "Attempt to insert NULL item pointer to " ) + GetClass() + wxCHECK_RET( aItem != NULL, wxT( "Attempt to insert NULL item pointer to " ) + GetClass() +
wxT( "item list" ) ); wxT( "item list" ) );
...@@ -569,11 +582,10 @@ void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_BaseStruct* aItem ) ...@@ -569,11 +582,10 @@ void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_BaseStruct* aItem )
*/ */
void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) void BASE_SCREEN::Show( int nestLevel, std::ostream& os )
{ {
SCH_ITEM* item = EEDrawList; EDA_ITEM* item = m_drawList;
// for now, make it look like XML, expand on this later. // for now, make it look like XML, expand on this later.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
">\n";
for( ; item; item = item->Next() ) for( ; item; item = item->Next() )
{ {
......
/****************************************/ /****************************************/
/* Basic classes for Kicad: */ /* Basic classes for Kicad: */
/* EDA_BaseStruct */ /* EDA_ITEM */
/* EDA_TextStruct */ /* EDA_TextStruct */
/****************************************/ /****************************************/
...@@ -20,7 +20,7 @@ enum textbox { ...@@ -20,7 +20,7 @@ enum textbox {
}; };
EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType ) EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType )
{ {
InitVars(); InitVars();
m_StructType = idType; m_StructType = idType;
...@@ -28,14 +28,14 @@ EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType ) ...@@ -28,14 +28,14 @@ EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType )
} }
EDA_BaseStruct::EDA_BaseStruct( KICAD_T idType ) EDA_ITEM::EDA_ITEM( KICAD_T idType )
{ {
InitVars(); InitVars();
m_StructType = idType; m_StructType = idType;
} }
EDA_BaseStruct::EDA_BaseStruct( const EDA_BaseStruct& base ) EDA_ITEM::EDA_ITEM( const EDA_ITEM& base )
{ {
m_StructType = base.m_StructType; m_StructType = base.m_StructType;
m_Parent = base.m_Parent; m_Parent = base.m_Parent;
...@@ -47,7 +47,7 @@ EDA_BaseStruct::EDA_BaseStruct( const EDA_BaseStruct& base ) ...@@ -47,7 +47,7 @@ EDA_BaseStruct::EDA_BaseStruct( const EDA_BaseStruct& base )
} }
void EDA_BaseStruct::InitVars() void EDA_ITEM::InitVars()
{ {
m_StructType = TYPE_NOT_INIT; m_StructType = TYPE_NOT_INIT;
Pnext = NULL; // Linked list: Link (next struct) Pnext = NULL; // Linked list: Link (next struct)
...@@ -63,7 +63,7 @@ void EDA_BaseStruct::InitVars() ...@@ -63,7 +63,7 @@ void EDA_BaseStruct::InitVars()
} }
void EDA_BaseStruct::SetModified() void EDA_ITEM::SetModified()
{ {
m_Flags |= IS_CHANGED; m_Flags |= IS_CHANGED;
...@@ -74,12 +74,12 @@ void EDA_BaseStruct::SetModified() ...@@ -74,12 +74,12 @@ void EDA_BaseStruct::SetModified()
// see base_struct.h // see base_struct.h
SEARCH_RESULT EDA_BaseStruct::IterateForward( EDA_BaseStruct* listStart, SEARCH_RESULT EDA_ITEM::IterateForward( EDA_ITEM* listStart,
INSPECTOR* inspector, INSPECTOR* inspector,
const void* testData, const void* testData,
const KICAD_T scanTypes[] ) const KICAD_T scanTypes[] )
{ {
EDA_BaseStruct* p = listStart; EDA_ITEM* p = listStart;
for( ; p; p = p->Pnext ) for( ; p; p = p->Pnext )
{ {
...@@ -93,8 +93,8 @@ SEARCH_RESULT EDA_BaseStruct::IterateForward( EDA_BaseStruct* listStart, ...@@ -93,8 +93,8 @@ SEARCH_RESULT EDA_BaseStruct::IterateForward( EDA_BaseStruct* listStart,
// see base_struct.h // see base_struct.h
// many classes inherit this method, be careful: // many classes inherit this method, be careful:
SEARCH_RESULT EDA_BaseStruct::Visit( INSPECTOR* inspector, const void* testData, SEARCH_RESULT EDA_ITEM::Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ) const KICAD_T scanTypes[] )
{ {
KICAD_T stype; KICAD_T stype;
...@@ -143,7 +143,7 @@ std::ostream& operator<<( std::ostream& out, const wxPoint& pt ) ...@@ -143,7 +143,7 @@ std::ostream& operator<<( std::ostream& out, const wxPoint& pt )
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void EDA_BaseStruct::Show( int nestLevel, std::ostream& os ) void EDA_ITEM::Show( int nestLevel, std::ostream& os )
{ {
// XML output: // XML output:
wxString s = GetClass(); wxString s = GetClass();
...@@ -161,7 +161,7 @@ void EDA_BaseStruct::Show( int nestLevel, std::ostream& os ) ...@@ -161,7 +161,7 @@ void EDA_BaseStruct::Show( int nestLevel, std::ostream& os )
* @param os The ostream&, where to output * @param os The ostream&, where to output
* @return std::ostream& - for continuation. * @return std::ostream& - for continuation.
**/ **/
std::ostream& EDA_BaseStruct::NestedSpace( int nestLevel, std::ostream& os ) std::ostream& EDA_ITEM::NestedSpace( int nestLevel, std::ostream& os )
{ {
for( int i = 0; i<nestLevel; ++i ) for( int i = 0; i<nestLevel; ++i )
os << " "; os << " ";
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
BLOCK_SELECTOR::BLOCK_SELECTOR() : BLOCK_SELECTOR::BLOCK_SELECTOR() :
EDA_BaseStruct( BLOCK_LOCATE_STRUCT_TYPE ), EDA_ITEM( BLOCK_LOCATE_STRUCT_TYPE ),
EDA_Rect() EDA_Rect()
{ {
m_State = STATE_NO_BLOCK; /* State (enum BlockState) of block. */ m_State = STATE_NO_BLOCK; /* State (enum BlockState) of block. */
...@@ -133,7 +133,7 @@ void BLOCK_SELECTOR::InitData( WinEDA_DrawPanel* aPanel, ...@@ -133,7 +133,7 @@ void BLOCK_SELECTOR::InitData( WinEDA_DrawPanel* aPanel,
/** /**
* Function ClearItemsList * Function ClearItemsList
* delete only the list of EDA_BaseStruct * pointers, NOT the pointed data * delete only the list of EDA_ITEM * pointers, NOT the pointed data
* itself * itself
*/ */
void BLOCK_SELECTOR::ClearItemsList() void BLOCK_SELECTOR::ClearItemsList()
...@@ -143,7 +143,7 @@ void BLOCK_SELECTOR::ClearItemsList() ...@@ -143,7 +143,7 @@ void BLOCK_SELECTOR::ClearItemsList()
/** /**
* Function ClearListAndDeleteItems * Function ClearListAndDeleteItems
* delete only the list of EDA_BaseStruct * pointers, AND the data pinted * delete only the list of EDA_ITEM * pointers, AND the data pinted
* by m_Item * by m_Item
*/ */
void BLOCK_SELECTOR::ClearListAndDeleteItems() void BLOCK_SELECTOR::ClearListAndDeleteItems()
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "class_undoredo_container.h" #include "class_undoredo_container.h"
ITEM_PICKER::ITEM_PICKER( EDA_BaseStruct* aItem, UndoRedoOpType aUndoRedoStatus ) ITEM_PICKER::ITEM_PICKER( EDA_ITEM* aItem, UndoRedoOpType aUndoRedoStatus )
{ {
m_UndoRedoStatus = aUndoRedoStatus; m_UndoRedoStatus = aUndoRedoStatus;
m_PickedItem = aItem; m_PickedItem = aItem;
...@@ -115,11 +115,12 @@ void PICKED_ITEMS_LIST::ClearListAndDeleteItems() ...@@ -115,11 +115,12 @@ void PICKED_ITEMS_LIST::ClearListAndDeleteItems()
{ {
// Specific to eeschema: a linked list of wires is stored. // Specific to eeschema: a linked list of wires is stored.
// the wrapper picks only the first item (head of list), and is owner of all picked items // the wrapper picks only the first item (head of list), and is owner of all picked items
EDA_BaseStruct* item = wrapper.m_PickedItem; EDA_ITEM* item = wrapper.m_PickedItem;
while( item ) while( item )
{ {
// Delete old copy of wires // Delete old copy of wires
EDA_BaseStruct* nextitem = item->Next(); EDA_ITEM* nextitem = item->Next();
delete item; delete item;
item = nextitem; item = nextitem;
} }
...@@ -186,7 +187,7 @@ ITEM_PICKER PICKED_ITEMS_LIST::GetItemWrapper( unsigned int aIdx ) ...@@ -186,7 +187,7 @@ ITEM_PICKER PICKED_ITEMS_LIST::GetItemWrapper( unsigned int aIdx )
* @return a pointer to the picked item, or null if does not exist * @return a pointer to the picked item, or null if does not exist
* @param aIdx = index of the picked item in the picked list * @param aIdx = index of the picked item in the picked list
*/ */
EDA_BaseStruct* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx ) EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].m_PickedItem; return m_ItemsList[aIdx].m_PickedItem;
...@@ -200,7 +201,7 @@ EDA_BaseStruct* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx ) ...@@ -200,7 +201,7 @@ EDA_BaseStruct* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx )
* @return link of the picked item, or null if does not exist * @return link of the picked item, or null if does not exist
* @param aIdx = index of the picked item in the picked list * @param aIdx = index of the picked item in the picked list
*/ */
EDA_BaseStruct* PICKED_ITEMS_LIST::GetPickedItemLink( unsigned int aIdx ) EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItemLink( unsigned int aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].m_Link; return m_ItemsList[aIdx].m_Link;
...@@ -243,7 +244,7 @@ int PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx ) ...@@ -243,7 +244,7 @@ int PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx )
* @param aIdx = index of the picker in the picked list * @param aIdx = index of the picker in the picked list
* @return true if the picker exists, or false if does not exist * @return true if the picker exists, or false if does not exist
*/ */
bool PICKED_ITEMS_LIST::SetPickedItem( EDA_BaseStruct* aItem, unsigned aIdx ) bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, unsigned aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
{ {
...@@ -262,7 +263,7 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_BaseStruct* aItem, unsigned aIdx ) ...@@ -262,7 +263,7 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_BaseStruct* aItem, unsigned aIdx )
* @param aIdx = index of the picker in the picked list * @param aIdx = index of the picker in the picked list
* @return true if the picker exists, or false if does not exist * @return true if the picker exists, or false if does not exist
*/ */
bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_BaseStruct* aLink, unsigned aIdx ) bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_ITEM* aLink, unsigned aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
{ {
...@@ -281,9 +282,7 @@ bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_BaseStruct* aLink, unsigned aIdx ...@@ -281,9 +282,7 @@ bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_BaseStruct* aLink, unsigned aIdx
* @param aIdx = index of the picker in the picked list * @param aIdx = index of the picker in the picked list
* @return true if the picker exists, or false if does not exist * @return true if the picker exists, or false if does not exist
*/ */
bool PICKED_ITEMS_LIST::SetPickedItem( EDA_BaseStruct* aItem, bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, UndoRedoOpType aStatus, unsigned aIdx )
UndoRedoOpType aStatus,
unsigned aIdx )
{ {
if( aIdx < m_ItemsList.size() ) if( aIdx < m_ItemsList.size() )
{ {
......
...@@ -40,8 +40,8 @@ DHEAD::~DHEAD() ...@@ -40,8 +40,8 @@ DHEAD::~DHEAD()
void DHEAD::DeleteAll() void DHEAD::DeleteAll()
{ {
EDA_BaseStruct* next; EDA_ITEM* next;
EDA_BaseStruct* item = first; EDA_ITEM* item = first;
while( item ) while( item )
{ {
...@@ -56,7 +56,7 @@ void DHEAD::DeleteAll() ...@@ -56,7 +56,7 @@ void DHEAD::DeleteAll()
} }
void DHEAD::append( EDA_BaseStruct* aNewElement ) void DHEAD::append( EDA_ITEM* aNewElement )
{ {
wxASSERT( aNewElement != NULL ); wxASSERT( aNewElement != NULL );
...@@ -85,7 +85,7 @@ void DHEAD::append( EDA_BaseStruct* aNewElement ) ...@@ -85,7 +85,7 @@ void DHEAD::append( EDA_BaseStruct* aNewElement )
} }
void DHEAD::insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aAfterMe ) void DHEAD::insert( EDA_ITEM* aNewElement, EDA_ITEM* aAfterMe )
{ {
wxASSERT( aNewElement != NULL ); wxASSERT( aNewElement != NULL );
...@@ -109,7 +109,7 @@ void DHEAD::insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aAfterMe ) ...@@ -109,7 +109,7 @@ void DHEAD::insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aAfterMe )
} }
else else
{ {
EDA_BaseStruct* oldBack = aAfterMe->Back(); EDA_ITEM* oldBack = aAfterMe->Back();
aAfterMe->SetBack( aNewElement ); aAfterMe->SetBack( aNewElement );
...@@ -126,7 +126,7 @@ void DHEAD::insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aAfterMe ) ...@@ -126,7 +126,7 @@ void DHEAD::insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aAfterMe )
} }
void DHEAD::remove( EDA_BaseStruct* aElement ) void DHEAD::remove( EDA_ITEM* aElement )
{ {
wxASSERT( aElement ); wxASSERT( aElement );
wxASSERT( aElement->GetList() == this ); wxASSERT( aElement->GetList() == this );
...@@ -162,7 +162,7 @@ void DHEAD::remove( EDA_BaseStruct* aElement ) ...@@ -162,7 +162,7 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
void DHEAD::VerifyListIntegrity() void DHEAD::VerifyListIntegrity()
{ {
EDA_BaseStruct* item; EDA_ITEM* item;
unsigned i = 0; unsigned i = 0;
for( item = first; item && i<count; ++i, item = item->Next() ) for( item = first; item && i<count; ++i, item = item->Next() )
......
...@@ -174,8 +174,7 @@ void WinEDA_DrawFrame::ReCreateMenuBar() ...@@ -174,8 +174,7 @@ void WinEDA_DrawFrame::ReCreateMenuBar()
// Virtual function // Virtual function
void WinEDA_DrawFrame::OnHotKey( wxDC* DC, int hotkey, void WinEDA_DrawFrame::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
EDA_BaseStruct* DrawStruct )
{ {
} }
...@@ -192,9 +191,8 @@ void WinEDA_DrawFrame::ToolOnRightClick( wxCommandEvent& event ) ...@@ -192,9 +191,8 @@ void WinEDA_DrawFrame::ToolOnRightClick( wxCommandEvent& event )
* because WinEDA_DrawFrame does not know how to print a page * because WinEDA_DrawFrame does not know how to print a page
* This is the reason it is a virtual function * This is the reason it is a virtual function
*/ */
void WinEDA_DrawFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, void WinEDA_DrawFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,int aPrintMask,
int aPrintMask, bool aPrintMirrorMode, bool aPrintMirrorMode, void* aData )
void * aData)
{ {
wxMessageBox( wxT("WinEDA_DrawFrame::PrintPage() error")); wxMessageBox( wxT("WinEDA_DrawFrame::PrintPage() error"));
} }
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
* in debug mode * in debug mode
*/ */
SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) : SCH_ITEM::SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType ) :
EDA_BaseStruct( aParent, aType ) EDA_ITEM( aParent, aType )
{ {
m_Layer = 0; m_Layer = 0;
} }
...@@ -40,18 +40,20 @@ SCH_ITEM::~SCH_ITEM() ...@@ -40,18 +40,20 @@ SCH_ITEM::~SCH_ITEM()
/** /**
* place the struct in EEDrawList. * place the struct in m_drawList.
* if it is a new item, it it also put in undo list * if it is a new item, it it also put in undo list
* for an "old" item, saving it in undo list must be done before editiing, * for an "old" item, saving it in undo list must be done before editiing,
* and not here! * and not here!
*/ */
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_ITEM::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
if( m_Flags & IS_NEW ) if( m_Flags & IS_NEW )
{ {
SCH_SCREEN* screen = frame->GetScreen(); SCH_SCREEN* screen = frame->GetScreen();
if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop! if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
screen->AddToDrawList( this ); screen->AddToDrawList( this );
g_ItemToRepeat = this; g_ItemToRepeat = this;
frame->SaveCopyInUndoList( this, UR_NEW ); frame->SaveCopyInUndoList( this, UR_NEW );
} }
......
...@@ -228,19 +228,18 @@ void WinEDA_DrawFrame::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -228,19 +228,18 @@ void WinEDA_DrawFrame::AddMenuZoomAndGrid( wxMenu* MasterMenu )
} }
/* Create grid submenu as required. */ /* Create grid submenu as required. */
if( !screen->m_GridList.IsEmpty() ) if( screen->GetGridCount() )
{ {
wxMenu* gridMenu = new wxMenu; wxMenu* gridMenu = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( MasterMenu, gridMenu, ADD_MENUITEM_WITH_SUBMENU( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
ID_POPUP_GRID_SELECT, _( "Grid Select" ), _( "Grid Select" ), grid_select_xpm );
grid_select_xpm );
GRID_TYPE tmp; GRID_TYPE tmp;
wxRealPoint grid = screen->GetGridSize(); wxRealPoint grid = screen->GetGridSize();
for( unsigned i = 0; i < screen->m_GridList.GetCount(); i++ ) for( size_t i = 0; i < screen->GetGridCount(); i++ )
{ {
tmp = screen->m_GridList[i]; tmp = screen->GetGrid( i );
double gridValueInch = To_User_Unit( INCHES, tmp.m_Size.x, m_InternalUnits ); double gridValueInch = To_User_Unit( INCHES, tmp.m_Size.x, m_InternalUnits );
double gridValue_mm = To_User_Unit( MILLIMETRES, tmp.m_Size.x, m_InternalUnits ); double gridValue_mm = To_User_Unit( MILLIMETRES, tmp.m_Size.x, m_InternalUnits );
...@@ -267,7 +266,9 @@ void WinEDA_DrawFrame::AddMenuZoomAndGrid( wxMenu* MasterMenu ) ...@@ -267,7 +266,9 @@ void WinEDA_DrawFrame::AddMenuZoomAndGrid( wxMenu* MasterMenu )
break; break;
} }
} }
gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true ); gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true );
if( grid == tmp.m_Size ) if( grid == tmp.m_Size )
gridMenu->Check( tmp.m_Id, true ); gridMenu->Check( tmp.m_Id, true );
} }
......
...@@ -35,7 +35,7 @@ static int ReplaceDuplicatedTimeStamps(); ...@@ -35,7 +35,7 @@ static int ReplaceDuplicatedTimeStamps();
/* Set a sheet number, the sheet count for sheets in the whole schematic /* Set a sheet number, the sheet count for sheets in the whole schematic
* and update the date in all screens * and update the date in all screens
*/ */
void WinEDA_SchematicFrame::UpdateSheetNumberAndDate() void SCH_EDIT_FRAME::UpdateSheetNumberAndDate()
{ {
wxString date = GenDate(); wxString date = GenDate();
SCH_SCREENS s_list; SCH_SCREENS s_list;
...@@ -69,11 +69,13 @@ void ReAnnotatePowerSymbolsOnly( void ) ...@@ -69,11 +69,13 @@ void ReAnnotatePowerSymbolsOnly( void )
for( sheet = SheetList.GetFirst(); sheet != NULL; for( sheet = SheetList.GetFirst(); sheet != NULL;
sheet = SheetList.GetNext() ) sheet = SheetList.GetNext() )
{ {
EDA_BaseStruct* DrawList = sheet->LastDrawList(); EDA_ITEM* DrawList = sheet->LastDrawList();
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
{ {
if( DrawList->Type() != TYPE_SCH_COMPONENT ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
LIB_COMPONENT* Entry = LIB_COMPONENT* Entry =
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
...@@ -204,8 +206,7 @@ static bool SortByTimeStamp( const OBJ_CMP_TO_LIST& item1, ...@@ -204,8 +206,7 @@ static bool SortByTimeStamp( const OBJ_CMP_TO_LIST& item1,
* annotation relative to the current sheet only * annotation relative to the current sheet only
* @param aRedraw : true to refresh display * @param aRedraw : true to refresh display
*/ */
void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw )
bool aRedraw )
{ {
SCH_ITEM* strct; SCH_ITEM* strct;
SCH_SCREEN* screen; SCH_SCREEN* screen;
...@@ -218,9 +219,11 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, ...@@ -218,9 +219,11 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly,
if( screen == NULL ) if( screen == NULL )
return; return;
while( screen ) while( screen )
{ {
strct = screen->EEDrawList; strct = screen->GetDrawItems();
for( ; strct; strct = strct->Next() ) for( ; strct; strct = strct->Next() )
{ {
if( strct->Type() == TYPE_SCH_COMPONENT ) if( strct->Type() == TYPE_SCH_COMPONENT )
...@@ -267,11 +270,11 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, ...@@ -267,11 +270,11 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly,
* stamps are used to handle annotation mainly in complex * stamps are used to handle annotation mainly in complex
* hierarchies. * hierarchies.
*/ */
void AnnotateComponents( WinEDA_SchematicFrame* parent, void AnnotateComponents( SCH_EDIT_FRAME* parent,
bool annotateSchematic, bool annotateSchematic,
int sortOption, int sortOption,
bool resetAnnotation, bool resetAnnotation,
bool repairsTimestamps ) bool repairsTimestamps )
{ {
std::vector <OBJ_CMP_TO_LIST> ComponentsList; std::vector <OBJ_CMP_TO_LIST> ComponentsList;
...@@ -358,18 +361,18 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent, ...@@ -358,18 +361,18 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent,
int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList, int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList,
SCH_SHEET_PATH* aSheet ) SCH_SHEET_PATH* aSheet )
{ {
int NbrCmp = 0; int NbrCmp = 0;
EDA_BaseStruct* DrawList = aSheet->LastDrawList(); EDA_ITEM* DrawList = aSheet->LastDrawList();
SCH_COMPONENT* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
{ {
if( DrawList->Type() == TYPE_SCH_COMPONENT ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
DrawLibItem = (SCH_COMPONENT*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
Entry = Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
if( Entry == NULL ) if( Entry == NULL )
continue; continue;
...@@ -707,8 +710,7 @@ static int ExistUnit( int aObjet, int Unit, ...@@ -707,8 +710,7 @@ static int ExistUnit( int aObjet, int Unit,
* false = search in whole hierarchy (usual search). * false = search in whole hierarchy (usual search).
* @return errors count * @return errors count
*/ */
int WinEDA_SchematicFrame::CheckAnnotate( wxArrayString* aMessageList, int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly )
bool aOneSheetOnly )
{ {
int error; int error;
wxString Buff; wxString Buff;
...@@ -1005,10 +1007,11 @@ int ReplaceDuplicatedTimeStamps() ...@@ -1005,10 +1007,11 @@ int ReplaceDuplicatedTimeStamps()
std::vector <SCH_ITEM*> itemlist; std::vector <SCH_ITEM*> itemlist;
SCH_SCREEN* screen; SCH_SCREEN* screen;
SCH_ITEM* item; SCH_ITEM* item;
for( screen = ScreenList.GetFirst(); screen != NULL;
screen = ScreenList.GetNext() ) for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
{ {
item = screen->EEDrawList; item = screen->GetDrawItems();
while( item ) while( item )
{ {
if( ( item->Type() == DRAW_SHEET_STRUCT_TYPE ) if( ( item->Type() == DRAW_SHEET_STRUCT_TYPE )
......
...@@ -32,10 +32,9 @@ ...@@ -32,10 +32,9 @@
* the search is not stopped when a reference is found (all instances must be * the search is not stopped when a reference is found (all instances must be
* found). * found).
*/ */
bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent( bool SCH_EDIT_FRAME::FillFootprintFieldForAllInstancesofComponent( const wxString& aReference,
const wxString& aReference, const wxString& aFootPrint,
const wxString& aFootPrint, bool aSetVisible )
bool aSetVisible )
{ {
SCH_SHEET_PATH* sheet; SCH_SHEET_PATH* sheet;
SCH_ITEM* DrawList = NULL; SCH_ITEM* DrawList = NULL;
...@@ -101,8 +100,7 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent( ...@@ -101,8 +100,7 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
* visible * visible
* @return true if OK. * @return true if OK.
*/ */
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool bool SCH_EDIT_FRAME::ProcessStuffFile( FILE* aStuffFile, bool aSetFielsAttributeToVisible )
aSetFielsAttributeToVisible )
{ {
int LineNum = 0; int LineNum = 0;
char* cp, Ref[256], FootPrint[256], Line[1024]; char* cp, Ref[256], FootPrint[256], Line[1024];
...@@ -134,7 +132,7 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool ...@@ -134,7 +132,7 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
/* Backann footprint info to schematic. /* Backann footprint info to schematic.
*/ */
bool WinEDA_SchematicFrame::ReadInputStuffFile() bool SCH_EDIT_FRAME::ReadInputStuffFile()
{ {
wxString Line, filename; wxString Line, filename;
FILE* StuffFile; FILE* StuffFile;
......
...@@ -47,7 +47,7 @@ static void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList ); ...@@ -47,7 +47,7 @@ static void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList );
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to /* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
* the key (ALT, SHIFT ALT ..) * the key (ALT, SHIFT ALT ..)
*/ */
int WinEDA_SchematicFrame::ReturnBlockCommand( int key ) int SCH_EDIT_FRAME::ReturnBlockCommand( int key )
{ {
int cmd; int cmd;
...@@ -85,7 +85,7 @@ int WinEDA_SchematicFrame::ReturnBlockCommand( int key ) ...@@ -85,7 +85,7 @@ int WinEDA_SchematicFrame::ReturnBlockCommand( int key )
/* Init the parameters used by the block paste command /* Init the parameters used by the block paste command
*/ */
void WinEDA_SchematicFrame::InitBlockPasteInfos() void SCH_EDIT_FRAME::InitBlockPasteInfos()
{ {
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
...@@ -99,7 +99,7 @@ void WinEDA_SchematicFrame::InitBlockPasteInfos() ...@@ -99,7 +99,7 @@ void WinEDA_SchematicFrame::InitBlockPasteInfos()
* - block move & drag * - block move & drag
* - block copy & paste * - block copy & paste
*/ */
void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
bool err = false; bool err = false;
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
...@@ -181,7 +181,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) ...@@ -181,7 +181,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
block->m_Command = BLOCK_IDLE; block->m_Command = BLOCK_IDLE;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
if( block->GetCount() ) if( block->GetCount() )
{ {
...@@ -204,7 +204,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) ...@@ -204,7 +204,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
* @return false if no item selected, or command finished, * @return false if no item selected, or command finished,
* true if some items found and HandleBlockPlace must be called later * true if some items found and HandleBlockPlace must be called later
*/ */
bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
bool nextcmd = false; bool nextcmd = false;
bool zoom_command = false; bool zoom_command = false;
...@@ -269,7 +269,7 @@ bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) ...@@ -269,7 +269,7 @@ bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
OnModify(); OnModify();
} }
block->ClearItemsList(); block->ClearItemsList();
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
DrawPanel->Refresh(); DrawPanel->Refresh();
break; break;
...@@ -334,7 +334,7 @@ bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) ...@@ -334,7 +334,7 @@ bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
* a mirror/rotate command is immediatly executed and multible block commands * a mirror/rotate command is immediatly executed and multible block commands
* are not allowed (multiple commands are tricky to undo/redo in one time) * are not allowed (multiple commands are tricky to undo/redo in one time)
*/ */
void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
{ {
bool blockCmdFinished = true; /* set to false for block command which bool blockCmdFinished = true; /* set to false for block command which
* have a next step * have a next step
...@@ -386,7 +386,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -386,7 +386,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); DeleteItemsInList( DrawPanel, block->m_ItemsSelection );
OnModify(); OnModify();
} }
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
DrawPanel->Refresh(); DrawPanel->Refresh();
break; break;
...@@ -421,7 +421,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -421,7 +421,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
RotateListOfItems( block->m_ItemsSelection, rotationPoint ); RotateListOfItems( block->m_ItemsSelection, rotationPoint );
OnModify(); OnModify();
} }
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
DrawPanel->Refresh(); DrawPanel->Refresh();
// block->m_State = STATE_BLOCK_MOVE; // block->m_State = STATE_BLOCK_MOVE;
// block->m_Command = BLOCK_MOVE; //allows multiple rotate // block->m_Command = BLOCK_MOVE; //allows multiple rotate
...@@ -442,7 +442,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -442,7 +442,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
// block->m_State = STATE_BLOCK_MOVE; // block->m_State = STATE_BLOCK_MOVE;
// block->m_Command = BLOCK_MOVE; //allows multiple mirrors // block->m_Command = BLOCK_MOVE; //allows multiple mirrors
} }
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
DrawPanel->Refresh(); DrawPanel->Refresh();
break; break;
...@@ -461,7 +461,8 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -461,7 +461,8 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
// block->m_State = STATE_BLOCK_MOVE; // block->m_State = STATE_BLOCK_MOVE;
// block->m_Command = BLOCK_MOVE; //allows multiple mirrors // block->m_Command = BLOCK_MOVE; //allows multiple mirrors
} }
TestDanglingEnds( GetScreen()->EEDrawList, DC );
TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
DrawPanel->Refresh(); DrawPanel->Refresh();
break; break;
...@@ -489,7 +490,6 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -489,7 +490,6 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
BLOCK_SELECTOR* block = &panel->GetScreen()->m_BlockLocate;; BLOCK_SELECTOR* block = &panel->GetScreen()->m_BlockLocate;;
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
SCH_ITEM* schitem; SCH_ITEM* schitem;
...@@ -497,6 +497,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era ...@@ -497,6 +497,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
if( erase ) if( erase )
{ {
block->Draw( panel, DC, block->m_MoveVector, g_XorMode, block->m_Color ); block->Draw( panel, DC, block->m_MoveVector, g_XorMode, block->m_Color );
for( unsigned ii = 0; ii < block->GetCount(); ii++ ) for( unsigned ii = 0; ii < block->GetCount(); ii++ )
{ {
schitem = (SCH_ITEM*) block->m_ItemsSelection.GetPickedItem( ii ); schitem = (SCH_ITEM*) block->m_ItemsSelection.GetPickedItem( ii );
...@@ -548,7 +549,7 @@ void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList ) ...@@ -548,7 +549,7 @@ void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
* Routine to paste a structure from the g_BlockSaveDataList stack. * Routine to paste a structure from the g_BlockSaveDataList stack.
* This routine is the same as undelete but original list is NOT removed. * This routine is the same as undelete but original list is NOT removed.
*****************************************************************************/ *****************************************************************************/
void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC ) void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
{ {
SCH_ITEM* Struct; SCH_ITEM* Struct;
...@@ -577,8 +578,8 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC ) ...@@ -577,8 +578,8 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )
} }
SetaParent( Struct, GetScreen() ); SetaParent( Struct, GetScreen() );
RedrawOneStruct( DrawPanel, DC, Struct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( DrawPanel, DC, Struct, GR_DEFAULT_DRAWMODE );
Struct->SetNext( GetScreen()->EEDrawList ); Struct->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->EEDrawList = Struct; GetScreen()->SetDrawItems( Struct );
} }
SaveCopyInUndoList( picklist, UR_NEW ); SaveCopyInUndoList( picklist, UR_NEW );
...@@ -738,7 +739,8 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position ) ...@@ -738,7 +739,8 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
/* Review the list of elements not selected. */ /* Review the list of elements not selected. */
ITEM_PICKER picker; ITEM_PICKER picker;
Struct = screen->EEDrawList; Struct = (SCH_ITEM*) screen->GetDrawItems();
while( Struct ) while( Struct )
{ {
picker.m_PickedItem = Struct; picker.m_PickedItem = Struct;
......
...@@ -41,7 +41,7 @@ void BuildComponentsListFromSchematic( std::vector <OBJ_CMP_TO_LIST>& aList ) ...@@ -41,7 +41,7 @@ void BuildComponentsListFromSchematic( std::vector <OBJ_CMP_TO_LIST>& aList )
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() ) for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() ) for( EDA_ITEM* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() )
{ {
if( schItem->Type() != TYPE_SCH_COMPONENT ) if( schItem->Type() != TYPE_SCH_COMPONENT )
continue; continue;
......
This diff is collapsed.
...@@ -66,21 +66,18 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -66,21 +66,18 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
SCH_BUS_ENTRY* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, SCH_BUS_ENTRY* SCH_EDIT_FRAME::CreateBusEntry( wxDC* DC, int entry_type )
int entry_type )
{ {
// Create and place a new bus entry at cursor position // Create and place a new bus entry at cursor position
SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->m_Curseur, SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->m_Curseur, s_LastShape, entry_type );
s_LastShape, entry_type );
BusEntry->m_Flags = IS_NEW; BusEntry->m_Flags = IS_NEW;
BusEntry->Place( this, DC );; BusEntry->Place( this, DC );;
OnModify( ); OnModify();
return BusEntry; return BusEntry;
} }
void WinEDA_SchematicFrame::StartMoveBusEntry( SCH_BUS_ENTRY* BusEntry, void SCH_EDIT_FRAME::StartMoveBusEntry( SCH_BUS_ENTRY* BusEntry, wxDC* DC )
wxDC* DC )
{ {
if( BusEntry == NULL ) if( BusEntry == NULL )
return; return;
...@@ -109,9 +106,7 @@ void WinEDA_SchematicFrame::StartMoveBusEntry( SCH_BUS_ENTRY* BusEntry, ...@@ -109,9 +106,7 @@ void WinEDA_SchematicFrame::StartMoveBusEntry( SCH_BUS_ENTRY* BusEntry,
/* set the shape of BusEntry (shape = / or \ ) /* set the shape of BusEntry (shape = / or \ )
*/ */
void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC, void SCH_EDIT_FRAME::SetBusEntryShape( wxDC* DC, SCH_BUS_ENTRY* BusEntry, int entry_shape )
SCH_BUS_ENTRY* BusEntry,
int entry_shape )
{ {
if( BusEntry == NULL ) if( BusEntry == NULL )
return; return;
...@@ -141,13 +136,13 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC, ...@@ -141,13 +136,13 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
break; break;
} }
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
RedrawOneStruct( DrawPanel, DC, BusEntry, g_XorMode ); RedrawOneStruct( DrawPanel, DC, BusEntry, g_XorMode );
OnModify( ); OnModify( );
} }
int WinEDA_SchematicFrame::GetBusEntryShape( SCH_BUS_ENTRY* BusEntry ) int SCH_EDIT_FRAME::GetBusEntryShape( SCH_BUS_ENTRY* BusEntry )
{ {
int entry_shape = '\\'; int entry_shape = '\\';
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
*/ */
LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_COMPONENT* aRootComponent ): LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_COMPONENT* aRootComponent ):
EDA_BaseStruct( LIB_ALIAS_T ) EDA_ITEM( LIB_ALIAS_T )
{ {
root = aRootComponent; root = aRootComponent;
name = aName; name = aName;
...@@ -59,7 +59,7 @@ LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_COMPONENT* aRootComponent ): ...@@ -59,7 +59,7 @@ LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_COMPONENT* aRootComponent ):
LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_COMPONENT* aRootComponent ) : LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_COMPONENT* aRootComponent ) :
EDA_BaseStruct( aAlias ) EDA_ITEM( aAlias )
{ {
name = aAlias.name; name = aAlias.name;
root = aRootComponent; root = aRootComponent;
...@@ -158,7 +158,7 @@ int LibraryEntryCompare( const LIB_ALIAS* aItem1, const LIB_ALIAS* aItem2 ) ...@@ -158,7 +158,7 @@ int LibraryEntryCompare( const LIB_ALIAS* aItem1, const LIB_ALIAS* aItem2 )
* Library components are different from schematic components. * Library components are different from schematic components.
*/ */
LIB_COMPONENT::LIB_COMPONENT( const wxString& aName, CMP_LIBRARY* aLibrary ) : LIB_COMPONENT::LIB_COMPONENT( const wxString& aName, CMP_LIBRARY* aLibrary ) :
EDA_BaseStruct( LIB_COMPONENT_T ) EDA_ITEM( LIB_COMPONENT_T )
{ {
m_name = aName; m_name = aName;
m_library = aLibrary; m_library = aLibrary;
...@@ -187,7 +187,7 @@ LIB_COMPONENT::LIB_COMPONENT( const wxString& aName, CMP_LIBRARY* aLibrary ) : ...@@ -187,7 +187,7 @@ LIB_COMPONENT::LIB_COMPONENT( const wxString& aName, CMP_LIBRARY* aLibrary ) :
LIB_COMPONENT::LIB_COMPONENT( LIB_COMPONENT& aComponent, CMP_LIBRARY* aLibrary ) : LIB_COMPONENT::LIB_COMPONENT( LIB_COMPONENT& aComponent, CMP_LIBRARY* aLibrary ) :
EDA_BaseStruct( aComponent ) EDA_ITEM( aComponent )
{ {
LIB_DRAW_ITEM* newItem; LIB_DRAW_ITEM* newItem;
......
...@@ -48,7 +48,7 @@ enum LibrEntryOptions ...@@ -48,7 +48,7 @@ enum LibrEntryOptions
* Component aliases are not really components. They are references * Component aliases are not really components. They are references
* to an actual component object. * to an actual component object.
*/ */
class LIB_ALIAS : public EDA_BaseStruct class LIB_ALIAS : public EDA_ITEM
{ {
/** /**
* The actual component of the alias. * The actual component of the alias.
...@@ -149,7 +149,7 @@ extern int LibraryEntryCompare( const LIB_ALIAS* aItem1, const LIB_ALIAS* aItem2 ...@@ -149,7 +149,7 @@ extern int LibraryEntryCompare( const LIB_ALIAS* aItem1, const LIB_ALIAS* aItem2
* A library component object is typically saved and loaded in a component library file (.lib). * A library component object is typically saved and loaded in a component library file (.lib).
* Library components are different from schematic components. * Library components are different from schematic components.
*/ */
class LIB_COMPONENT : public EDA_BaseStruct class LIB_COMPONENT : public EDA_ITEM
{ {
wxString m_name; wxString m_name;
int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to 0 int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to 0
......
...@@ -60,7 +60,7 @@ class NETLIST_OBJECT ...@@ -60,7 +60,7 @@ class NETLIST_OBJECT
public: public:
NetObjetType m_Type; /* Type of item (see NetObjetType NetObjetType m_Type; /* Type of item (see NetObjetType
* enum) */ * enum) */
EDA_BaseStruct* m_Comp; /* Pointer on the library item that EDA_ITEM * m_Comp; /* Pointer on the library item that
* created this net object (the parent) * created this net object (the parent)
*/ */
SCH_ITEM* m_Link; /* For SCH_SHEET_PIN: SCH_ITEM* m_Link; /* For SCH_SHEET_PIN:
......
...@@ -28,7 +28,8 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen ) ...@@ -28,7 +28,8 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
return; return;
} }
DrawList = Screen->EEDrawList; DrawList = Screen->GetDrawItems();
while( DrawList ) while( DrawList )
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
...@@ -76,8 +77,7 @@ void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint ) ...@@ -76,8 +77,7 @@ void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint )
{ {
SCH_LINE* segment, * NewSegment; SCH_LINE* segment, * NewSegment;
for( SCH_ITEM* DrawList = aScreen->EEDrawList; DrawList; for( SCH_ITEM* DrawList = aScreen->GetDrawItems(); DrawList; DrawList = DrawList->Next() )
DrawList = DrawList->Next() )
{ {
if( DrawList->Type() != DRAW_SEGMENT_STRUCT_TYPE ) if( DrawList->Type() != DRAW_SEGMENT_STRUCT_TYPE )
continue; continue;
......
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
* - label * - label
* - pin * - pin
* - component * - component
* @return an EDA_BaseStruct pointer on the item or NULL if no item found * @return an EDA_ITEM pointer on the item or NULL if no item found
* @param IncludePin = true to search for pins, false to ignore them * @param IncludePin = true to search for pins, false to ignore them
* *
* For some items, characteristics are displayed on the screen. * For some items, characteristics are displayed on the screen.
*/ */
SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool IncludePin ) SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( bool IncludePin )
{ {
SCH_ITEM* DrawStruct; SCH_ITEM* DrawStruct;
wxString msg; wxString msg;
...@@ -66,8 +66,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include ...@@ -66,8 +66,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include
break; break;
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, Pin = LocateAnyPin( GetScreen()->GetDrawItems(), GetScreen()->m_Curseur, &LibItem );
&LibItem );
if( Pin ) if( Pin )
break; // Priority is probing a pin first break; // Priority is probing a pin first
LibItem = (SCH_COMPONENT*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
...@@ -75,8 +74,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include ...@@ -75,8 +74,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include
break; break;
default: default:
Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, Pin = LocateAnyPin( GetScreen()->GetDrawItems(), GetScreen()->m_Curseur, &LibItem );
&LibItem );
break; break;
case COMPONENT_PIN_DRAW_TYPE: case COMPONENT_PIN_DRAW_TYPE:
...@@ -113,14 +111,14 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include ...@@ -113,14 +111,14 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Include
* - label * - label
* - pin * - pin
* - component * - component
* @return an EDA_BaseStruct pointer on the item or NULL if no item found * @return an EDA_ITEM pointer on the item or NULL if no item found
* @param refpoint = the wxPoint location where to search * @param refpoint = the wxPoint location where to search
* @param IncludePin = true to search for pins, false to ignore them * @param IncludePin = true to search for pins, false to ignore them
* *
* For some items, characteristics are displayed on the screen. * For some items, characteristics are displayed on the screen.
*/ */
SCH_ITEM* WinEDA_SchematicFrame::SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpoint,
bool IncludePin ) bool IncludePin )
{ {
SCH_ITEM* DrawStruct; SCH_ITEM* DrawStruct;
LIB_PIN* Pin; LIB_PIN* Pin;
...@@ -227,7 +225,7 @@ SCH_ITEM* WinEDA_SchematicFrame::SchematicGeneralLocateAndDisplay( const wxPoint ...@@ -227,7 +225,7 @@ SCH_ITEM* WinEDA_SchematicFrame::SchematicGeneralLocateAndDisplay( const wxPoint
} }
void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) void SCH_EDIT_FRAME::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels )
{ {
wxRealPoint delta; wxRealPoint delta;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
......
...@@ -38,9 +38,9 @@ void RemoteCommand( const char* cmdline ) ...@@ -38,9 +38,9 @@ void RemoteCommand( const char* cmdline )
char* idcmd; char* idcmd;
char* text; char* text;
wxString part_ref, msg; wxString part_ref, msg;
WinEDA_SchematicFrame* frame; SCH_EDIT_FRAME* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow(); frame = (SCH_EDIT_FRAME*)wxGetApp().GetTopWindow();
strncpy( line, cmdline, sizeof(line) - 1 ); strncpy( line, cmdline, sizeof(line) - 1 );
...@@ -85,11 +85,6 @@ void RemoteCommand( const char* cmdline ) ...@@ -85,11 +85,6 @@ void RemoteCommand( const char* cmdline )
} }
/*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
SCH_COMPONENT* LibItem )
/*****************************************************************************/
/** Send a remote command to eeschema via a socket, /** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on board (footprint, pad or text) * @param objectToSync = item to be located on board (footprint, pad or text)
* @param LibItem = component in lib if objectToSync is a sub item of a component * @param LibItem = component in lib if objectToSync is a sub item of a component
...@@ -97,6 +92,7 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, ...@@ -97,6 +92,7 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
* $PART: reference put cursor on footprint anchor * $PART: reference put cursor on footprint anchor
* $PIN: number $PART: reference put cursor on the footprint pad * $PIN: number $PART: reference put cursor on the footprint pad
*/ */
void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* objectToSync, SCH_COMPONENT* LibItem )
{ {
if( objectToSync == NULL ) if( objectToSync == NULL )
return; return;
...@@ -112,16 +108,15 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, ...@@ -112,16 +108,15 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
{ {
if( LibItem == NULL ) if( LibItem == NULL )
break; break;
sprintf( Line, "$PART: %s",
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) ); sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
} }
break; break;
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
LibItem = (SCH_COMPONENT*) objectToSync; LibItem = (SCH_COMPONENT*) objectToSync;
sprintf( Line, "$PART: %s", sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
break; break;
...@@ -139,8 +134,9 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, ...@@ -139,8 +134,9 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) ); CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
} }
else else
sprintf( Line, "$PART: %s", {
CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) ); sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->GetField( REFERENCE )->m_Text ) );
}
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
break; break;
......
...@@ -32,7 +32,7 @@ bool SegmentIntersect( wxPoint aSegStart, wxPoint aSegEnd, wxPoint aTestPoint ) ...@@ -32,7 +32,7 @@ bool SegmentIntersect( wxPoint aSegStart, wxPoint aSegEnd, wxPoint aTestPoint )
} }
void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC ) void SCH_EDIT_FRAME::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC )
{ {
SCH_ITEM* item; SCH_ITEM* item;
std::vector< DANGLING_END_ITEM > endPoints; std::vector< DANGLING_END_ITEM > endPoints;
...@@ -57,7 +57,7 @@ void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC ) ...@@ -57,7 +57,7 @@ void WinEDA_SchematicFrame::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC )
* @param DrawList = List of SCH_ITEMs to check. * @param DrawList = List of SCH_ITEMs to check.
* @return a LIB_PIN pointer to the located pin or NULL if no pin was found. * @return a LIB_PIN pointer to the located pin or NULL if no pin was found.
*/ */
LIB_PIN* WinEDA_SchematicFrame::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos ) LIB_PIN* SCH_EDIT_FRAME::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos )
{ {
SCH_COMPONENT* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LIB_PIN* Pin; LIB_PIN* Pin;
......
This diff is collapsed.
...@@ -14,29 +14,25 @@ ...@@ -14,29 +14,25 @@
#include "sch_sheet.h" #include "sch_sheet.h"
/**************************************************************************/
void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
/**************************************************************************/
/* Free (delete) all schematic data (include the sub hierarchy sheets ) /* Free (delete) all schematic data (include the sub hierarchy sheets )
* for the hierarchical sheet FirstSheet * for the hierarchical sheet FirstSheet
* FirstSheet is not deleted. * FirstSheet is not deleted.
*/ */
void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
{ {
EDA_BaseStruct* DrawStruct; EDA_ITEM* DrawStruct;
EDA_BaseStruct* EEDrawList; EDA_ITEM* EEDrawList;
wxString msg; wxString msg;
WinEDA_SchematicFrame* frame; SCH_EDIT_FRAME* frame;
frame = (WinEDA_SchematicFrame*)wxGetApp().GetTopWindow(); frame = (SCH_EDIT_FRAME*)wxGetApp().GetTopWindow();
if( FirstSheet == NULL ) if( FirstSheet == NULL )
return; return;
if( FirstSheet->Type() != DRAW_SHEET_STRUCT_TYPE ) if( FirstSheet->Type() != DRAW_SHEET_STRUCT_TYPE )
{ {
DisplayError( NULL, DisplayError( NULL, wxT( "DeleteSubHierarchy error(): NOT a Sheet" ) );
wxT( "DeleteSubHierarchy error(): NOT a Sheet" ) );
return; return;
} }
...@@ -45,6 +41,7 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion ) ...@@ -45,6 +41,7 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ), msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ),
FirstSheet->m_SheetName.GetData(), FirstSheet->m_SheetName.GetData(),
FirstSheet->GetFileName().GetData() ); FirstSheet->GetFileName().GetData() );
if( IsOK( NULL, msg ) ) if( IsOK( NULL, msg ) )
{ {
frame->SaveEEFile( FirstSheet->m_AssociatedScreen, FILE_SAVE_AS ); frame->SaveEEFile( FirstSheet->m_AssociatedScreen, FILE_SAVE_AS );
...@@ -54,15 +51,16 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion ) ...@@ -54,15 +51,16 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
/* free the sub hierarchy */ /* free the sub hierarchy */
if( FirstSheet->m_AssociatedScreen ) if( FirstSheet->m_AssociatedScreen )
{ {
EEDrawList = FirstSheet->m_AssociatedScreen->EEDrawList; EEDrawList = FirstSheet->m_AssociatedScreen->GetDrawItems();
while( EEDrawList != NULL ) while( EEDrawList != NULL )
{ {
DrawStruct = EEDrawList; DrawStruct = EEDrawList;
EEDrawList = EEDrawList->Next(); EEDrawList = EEDrawList->Next();
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
DeleteSubHierarchy( (SCH_SHEET*) DrawStruct, DeleteSubHierarchy( (SCH_SHEET*) DrawStruct, confirm_deletion );
confirm_deletion );
} }
} }
...@@ -71,13 +69,10 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion ) ...@@ -71,13 +69,10 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
} }
/********************************************************************/
bool ClearProjectDrawList( SCH_SCREEN* screen, bool confirm_deletion )
/********************************************************************/
/* free the draw list screen->EEDrawList and the subhierarchies /* free the draw list screen->EEDrawList and the subhierarchies
* clear the screen datas (filenames ..) * clear the screen datas (filenames ..)
*/ */
bool ClearProjectDrawList( SCH_SCREEN* screen, bool confirm_deletion )
{ {
if( screen == NULL ) if( screen == NULL )
return TRUE; return TRUE;
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
#define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption") #define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption")
extern void AnnotateComponents( WinEDA_SchematicFrame* parent, extern void AnnotateComponents( SCH_EDIT_FRAME* parent,
bool annotateSchematic, bool annotateSchematic,
int sortOption, int sortOption,
bool resetAnnotation, bool resetAnnotation,
bool repairsTimestamps ); bool repairsTimestamps );
DIALOG_ANNOTATE::DIALOG_ANNOTATE( WinEDA_SchematicFrame* parent ) DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
: DIALOG_ANNOTATE_BASE( parent ) : DIALOG_ANNOTATE_BASE( parent )
{ {
m_Parent = parent; m_Parent = parent;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "dialog_annotate_base.h" #include "dialog_annotate_base.h"
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
class wxConfig; class wxConfig;
...@@ -38,11 +38,11 @@ class wxConfig; ...@@ -38,11 +38,11 @@ class wxConfig;
class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE
{ {
private: private:
WinEDA_SchematicFrame * m_Parent; SCH_EDIT_FRAME * m_Parent;
wxConfig* m_Config; wxConfig* m_Config;
public: public:
DIALOG_ANNOTATE( WinEDA_SchematicFrame* parent ); DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent );
~DIALOG_ANNOTATE(){}; ~DIALOG_ANNOTATE(){};
/// Initialises member variables /// Initialises member variables
......
...@@ -107,13 +107,13 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref ) ...@@ -107,13 +107,13 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
if( aPrintAll && m_Parent->m_Ident == SCHEMATIC_FRAME ) if( aPrintAll && m_Parent->m_Ident == SCHEMATIC_FRAME )
{ {
WinEDA_SchematicFrame* schframe = (WinEDA_SchematicFrame*) m_Parent; SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet(); SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
SCH_SCREEN* schscreen = schframe->GetScreen(); SCH_SCREEN* schscreen = schframe->GetScreen();
oldscreen = schscreen; oldscreen = schscreen;
SCH_SHEET_LIST SheetList( NULL ); SCH_SHEET_LIST SheetList( NULL );
sheetpath = SheetList.GetFirst(); sheetpath = SheetList.GetFirst();
SCH_SHEET_PATH list; SCH_SHEET_PATH list;
for( ; ; ) for( ; ; )
{ {
......
...@@ -623,7 +623,8 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( ...@@ -623,7 +623,8 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef(
// Print list of items // Print list of items
for( unsigned ii = 0; ii < aList.size(); ii++ ) for( unsigned ii = 0; ii < aList.size(); ii++ )
{ {
EDA_BaseStruct* item = aList[ii].m_RootCmp; EDA_ITEM* item = aList[ii].m_RootCmp;
if( item == NULL ) if( item == NULL )
continue; continue;
...@@ -860,11 +861,11 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( ...@@ -860,11 +861,11 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal(
std::vector <OBJ_CMP_TO_LIST>& aList, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
{ {
EDA_BaseStruct* schItem; EDA_ITEM* schItem;
SCH_COMPONENT* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LIB_COMPONENT* entry; LIB_COMPONENT* entry;
std::string CmpName; std::string CmpName;
wxString msg; wxString msg;
msg = _( "\n#Cmp ( order = Value )" ); msg = _( "\n#Cmp ( order = Value )" );
......
...@@ -26,8 +26,7 @@ int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_SelectedRow; ...@@ -26,8 +26,7 @@ int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_SelectedRow;
wxSize DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = wxDefaultSize; wxSize DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = wxDefaultSize;
void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos, void InstallCmpeditFrame( SCH_EDIT_FRAME* parent, wxPoint& pos, SCH_COMPONENT* aComponent )
SCH_COMPONENT* aComponent )
{ {
if( aComponent == NULL ) // Null component not accepted if( aComponent == NULL ) // Null component not accepted
return; return;
...@@ -77,7 +76,7 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos, ...@@ -77,7 +76,7 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow* parent ) : DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow* parent ) :
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( parent ) DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( parent )
{ {
m_Parent = (WinEDA_SchematicFrame*) parent; m_Parent = (SCH_EDIT_FRAME*) parent;
m_LibEntry = NULL; m_LibEntry = NULL;
m_skipCopyFromPanel = false; m_skipCopyFromPanel = false;
...@@ -268,7 +267,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event ...@@ -268,7 +267,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
m_Parent->OnModify(); m_Parent->OnModify();
m_Parent->TestDanglingEnds( m_Parent->GetScreen()->EEDrawList, NULL ); m_Parent->TestDanglingEnds( m_Parent->GetScreen()->GetDrawItems(), NULL );
m_Parent->DrawPanel->Refresh( TRUE ); m_Parent->DrawPanel->Refresh( TRUE );
......
...@@ -16,22 +16,22 @@ ...@@ -16,22 +16,22 @@
*/ */
class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
{ {
friend void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, friend void InstallCmpeditFrame( SCH_EDIT_FRAME* parent,
wxPoint& pos, wxPoint& pos,
SCH_COMPONENT* aComponent ); SCH_COMPONENT* aComponent );
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
SCH_COMPONENT* m_Cmp; SCH_COMPONENT* m_Cmp;
LIB_COMPONENT* m_LibEntry; LIB_COMPONENT* m_LibEntry;
bool m_skipCopyFromPanel; bool m_skipCopyFromPanel;
static int s_SelectedRow; static int s_SelectedRow;
/// The size of the dialog window last time it was displayed; /// The size of the dialog window last time it was displayed;
static wxSize s_LastSize; static wxSize s_LastSize;
/// a copy of the edited component's SCH_FIELDs /// a copy of the edited component's SCH_FIELDs
SCH_FIELDS m_FieldsBuf; SCH_FIELDS m_FieldsBuf;
void setSelectedFieldNdx( int aFieldNdx ); void setSelectedFieldNdx( int aFieldNdx );
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* Edit the properties of the text (Label, Global label, graphic text).. ) /* Edit the properties of the text (Label, Global label, graphic text).. )
* pointed by "aTextStruct" * pointed by "aTextStruct"
*/ */
void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* aTextItem ) void SCH_EDIT_FRAME::EditSchematicText( SCH_TEXT* aTextItem )
{ {
if( aTextItem == NULL ) if( aTextItem == NULL )
return; return;
...@@ -34,7 +34,7 @@ void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* aTextItem ) ...@@ -34,7 +34,7 @@ void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* aTextItem )
} }
DialogLabelEditor::DialogLabelEditor( WinEDA_SchematicFrame* aParent, SCH_TEXT* aTextItem ) : DialogLabelEditor::DialogLabelEditor( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTextItem ) :
DialogLabelEditor_Base( aParent ) DialogLabelEditor_Base( aParent )
{ {
m_Parent = aParent; m_Parent = aParent;
......
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
#include "dialog_edit_label_base.h" #include "dialog_edit_label_base.h"
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
class SCH_TEXT; class SCH_TEXT;
class DialogLabelEditor : public DialogLabelEditor_Base class DialogLabelEditor : public DialogLabelEditor_Base
{ {
private: private:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
SCH_TEXT* m_CurrentText; SCH_TEXT* m_CurrentText;
wxTextCtrl * m_textLabel; wxTextCtrl* m_textLabel;
public: public:
DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT* aTextItem ); DialogLabelEditor( SCH_EDIT_FRAME* parent, SCH_TEXT* aTextItem );
~DialogLabelEditor(){}; ~DialogLabelEditor(){};
......
...@@ -283,8 +283,8 @@ An alias %s already exists!\nCannot update this component" ), ...@@ -283,8 +283,8 @@ An alias %s already exists!\nCannot update this component" ),
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::addFieldButtonHandler( wxCommandEvent& event ) void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::addFieldButtonHandler( wxCommandEvent& event )
/**************************************************************************************/ /**************************************************************************************/
{ {
WinEDA_SchematicFrame* frame; SCH_EDIT_FRAME* frame;
frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); frame = (SCH_EDIT_FRAME*) wxGetApp().GetTopWindow();
// in case m_FieldsBuf[REFERENCE].m_Orient has changed on screen only, grab // in case m_FieldsBuf[REFERENCE].m_Orient has changed on screen only, grab
// screen contents. // screen contents.
...@@ -491,7 +491,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::InitBuffers() ...@@ -491,7 +491,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::InitBuffers()
// Now copy in the template fields, in the order that they are present in the // Now copy in the template fields, in the order that they are present in the
// template field editor UI. // template field editor UI.
const TEMPLATE_FIELDNAMES& tfnames = const TEMPLATE_FIELDNAMES& tfnames =
((WinEDA_SchematicFrame*)m_Parent->GetParent())->GetTemplateFieldNames(); ((SCH_EDIT_FRAME*)m_Parent->GetParent())->GetTemplateFieldNames();
for( TEMPLATE_FIELDNAMES::const_iterator it = tfnames.begin(); it!=tfnames.end(); ++it ) for( TEMPLATE_FIELDNAMES::const_iterator it = tfnames.begin(); it!=tfnames.end(); ++it )
{ {
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include "dialog_eeschema_config.h" #include "dialog_eeschema_config.h"
DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* aSchFrame, DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( SCH_EDIT_FRAME* aSchFrame,
WinEDA_DrawFrame* aParent ) WinEDA_DrawFrame* aParent )
: DIALOG_EESCHEMA_CONFIG_FBP( aParent ) : DIALOG_EESCHEMA_CONFIG_FBP( aParent )
{ {
wxString msg; wxString msg;
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
#include "dialog_eeschema_config_fbp.h" #include "dialog_eeschema_config_fbp.h"
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
class WinEDA_DrawFrame; class WinEDA_DrawFrame;
class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP
{ {
private: private:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
bool m_LibListChanged; bool m_LibListChanged;
bool m_LibPathChanged; bool m_LibPathChanged;
wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer
...@@ -34,7 +34,7 @@ private: ...@@ -34,7 +34,7 @@ private:
public: public:
DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent, WinEDA_DrawFrame* activeWindow ); DIALOG_EESCHEMA_CONFIG( SCH_EDIT_FRAME* parent, WinEDA_DrawFrame* activeWindow );
~DIALOG_EESCHEMA_CONFIG() {}; ~DIALOG_EESCHEMA_CONFIG() {};
}; };
......
...@@ -22,13 +22,13 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select ) ...@@ -22,13 +22,13 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select )
} }
void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GridArray& grid_sizes, int grid_id ) void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id )
{ {
wxASSERT( grid_sizes.GetCount() > 0 ); wxASSERT( grid_sizes.size() > 0 );
int select = wxNOT_FOUND; int select = wxNOT_FOUND;
for( size_t i = 0; i < grid_sizes.GetCount(); i++ ) for( size_t i = 0; i < grid_sizes.size(); i++ )
{ {
wxString tmp; wxString tmp;
tmp.Printf( wxT( "%0.1f" ), grid_sizes[i].m_Size.x ); tmp.Printf( wxT( "%0.1f" ), grid_sizes[i].m_Size.x );
......
...@@ -21,7 +21,7 @@ public: ...@@ -21,7 +21,7 @@ public:
m_choiceGridSize->SetSelection( select ); m_choiceGridSize->SetSelection( select );
} }
int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); } int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
void SetGridSizes( const GridArray& grid_sizes, int grid_id ); void SetGridSizes( const GRIDS& grid_sizes, int grid_id );
void SetLineWidth( int line_width ) void SetLineWidth( int line_width )
{ {
......
...@@ -37,7 +37,7 @@ BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE ) ...@@ -37,7 +37,7 @@ BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
DIALOG_ERC::ChangeErrorLevel ) DIALOG_ERC::ChangeErrorLevel )
END_EVENT_TABLE() END_EVENT_TABLE()
DIALOG_ERC::DIALOG_ERC( WinEDA_SchematicFrame* parent ) : DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
DIALOG_ERC_BASE( parent ) DIALOG_ERC_BASE( parent )
{ {
m_Parent = parent; m_Parent = parent;
...@@ -53,6 +53,7 @@ void DIALOG_ERC::Init() ...@@ -53,6 +53,7 @@ void DIALOG_ERC::Init()
SetFocus(); SetFocus();
m_Initialized = FALSE; m_Initialized = FALSE;
for( int ii = 0; ii < PIN_NMAX; ii++ ) for( int ii = 0; ii < PIN_NMAX; ii++ )
for( int jj = 0; jj < PIN_NMAX; jj++ ) for( int jj = 0; jj < PIN_NMAX; jj++ )
m_ButtonList[ii][jj] = NULL; m_ButtonList[ii][jj] = NULL;
......
...@@ -32,15 +32,15 @@ class DIALOG_ERC : public DIALOG_ERC_BASE ...@@ -32,15 +32,15 @@ class DIALOG_ERC : public DIALOG_ERC_BASE
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX]; wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX];
bool m_Initialized; bool m_Initialized;
static bool m_writeErcFile; static bool m_writeErcFile;
public: public:
/// Constructors /// Constructors
DIALOG_ERC( WinEDA_SchematicFrame* parent ); DIALOG_ERC( SCH_EDIT_FRAME* parent );
void Init(); void Init();
......
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
class DIALOG_PLOT_SCHEMATIC_DXF : public DIALOG_PLOT_SCHEMATIC_DXF_BASE class DIALOG_PLOT_SCHEMATIC_DXF : public DIALOG_PLOT_SCHEMATIC_DXF_BASE
{ {
private: private:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
public: public:
/// Constructors /// Constructors
DIALOG_PLOT_SCHEMATIC_DXF( WinEDA_SchematicFrame* parent ); DIALOG_PLOT_SCHEMATIC_DXF( SCH_EDIT_FRAME* parent );
private: private:
static bool m_plotColorOpt; static bool m_plotColorOpt;
...@@ -74,14 +74,14 @@ bool DIALOG_PLOT_SCHEMATIC_DXF::m_plot_Sheet_Ref = true; ...@@ -74,14 +74,14 @@ bool DIALOG_PLOT_SCHEMATIC_DXF::m_plot_Sheet_Ref = true;
void WinEDA_SchematicFrame::ToPlot_DXF( wxCommandEvent& event ) void SCH_EDIT_FRAME::ToPlot_DXF( wxCommandEvent& event )
{ {
DIALOG_PLOT_SCHEMATIC_DXF DXF_frame( this ); DIALOG_PLOT_SCHEMATIC_DXF DXF_frame( this );
DXF_frame.ShowModal(); DXF_frame.ShowModal();
} }
DIALOG_PLOT_SCHEMATIC_DXF::DIALOG_PLOT_SCHEMATIC_DXF( WinEDA_SchematicFrame* parent ) DIALOG_PLOT_SCHEMATIC_DXF::DIALOG_PLOT_SCHEMATIC_DXF( SCH_EDIT_FRAME* parent )
: DIALOG_PLOT_SCHEMATIC_DXF_BASE( parent ) : DIALOG_PLOT_SCHEMATIC_DXF_BASE( parent )
{ {
m_Parent = parent; m_Parent = parent;
...@@ -143,13 +143,13 @@ void DIALOG_PLOT_SCHEMATIC_DXF::initOptVars() ...@@ -143,13 +143,13 @@ void DIALOG_PLOT_SCHEMATIC_DXF::initOptVars()
void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( ) void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
{ {
WinEDA_SchematicFrame* schframe = (WinEDA_SchematicFrame*) m_Parent; SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
SCH_SCREEN* screen = schframe->GetScreen(); SCH_SCREEN* screen = schframe->GetScreen();
SCH_SCREEN* oldscreen = screen; SCH_SCREEN* oldscreen = screen;
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet(); SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
wxString PlotFileName; wxString PlotFileName;
Ki_PageDescr* PlotSheet; Ki_PageDescr* PlotSheet;
wxPoint plot_offset; wxPoint plot_offset;
/* When printing all pages, the printed page is not the current page. /* When printing all pages, the printed page is not the current page.
* In complex hierarchies, we must setup references and others parameters * In complex hierarchies, we must setup references and others parameters
...@@ -241,7 +241,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName, ...@@ -241,7 +241,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
m_Parent->PlotWorkSheet( plotter, screen ); m_Parent->PlotWorkSheet( plotter, screen );
} }
PlotDrawlist( plotter, screen->EEDrawList ); PlotDrawlist( plotter, screen->GetDrawItems() );
/* fin */ /* fin */
plotter->end_plot(); plotter->end_plot();
......
...@@ -75,10 +75,10 @@ static Ki_PageDescr* Plot_sheet_list[] = ...@@ -75,10 +75,10 @@ static Ki_PageDescr* Plot_sheet_list[] =
class DIALOG_PLOT_SCHEMATIC_HPGL : public DIALOG_PLOT_SCHEMATIC_HPGL_BASE class DIALOG_PLOT_SCHEMATIC_HPGL : public DIALOG_PLOT_SCHEMATIC_HPGL_BASE
{ {
private: private:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
public: public:
DIALOG_PLOT_SCHEMATIC_HPGL( WinEDA_SchematicFrame* parent ); DIALOG_PLOT_SCHEMATIC_HPGL( SCH_EDIT_FRAME* parent );
private: private:
static PageFormatReq m_pageSizeSelect; static PageFormatReq m_pageSizeSelect;
...@@ -110,14 +110,14 @@ PageFormatReq DIALOG_PLOT_SCHEMATIC_HPGL:: m_pageSizeSelect = PAGE_DEFAULT; ...@@ -110,14 +110,14 @@ PageFormatReq DIALOG_PLOT_SCHEMATIC_HPGL:: m_pageSizeSelect = PAGE_DEFAULT;
bool DIALOG_PLOT_SCHEMATIC_HPGL::m_plot_Sheet_Ref = true; bool DIALOG_PLOT_SCHEMATIC_HPGL::m_plot_Sheet_Ref = true;
void WinEDA_SchematicFrame::ToPlot_HPGL( wxCommandEvent& event ) void SCH_EDIT_FRAME::ToPlot_HPGL( wxCommandEvent& event )
{ {
DIALOG_PLOT_SCHEMATIC_HPGL dlg( this ); DIALOG_PLOT_SCHEMATIC_HPGL dlg( this );
dlg.ShowModal(); dlg.ShowModal();
} }
DIALOG_PLOT_SCHEMATIC_HPGL::DIALOG_PLOT_SCHEMATIC_HPGL( WinEDA_SchematicFrame* parent ) DIALOG_PLOT_SCHEMATIC_HPGL::DIALOG_PLOT_SCHEMATIC_HPGL( SCH_EDIT_FRAME* parent )
:DIALOG_PLOT_SCHEMATIC_HPGL_BASE(parent) :DIALOG_PLOT_SCHEMATIC_HPGL_BASE(parent)
{ {
m_Parent = parent; m_Parent = parent;
...@@ -386,7 +386,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName, ...@@ -386,7 +386,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName,
if( m_plot_Sheet_Ref ) if( m_plot_Sheet_Ref )
m_Parent->PlotWorkSheet( plotter, screen ); m_Parent->PlotWorkSheet( plotter, screen );
PlotDrawlist( plotter, screen->EEDrawList ); PlotDrawlist( plotter, screen->GetDrawItems() );
plotter->end_plot(); plotter->end_plot();
delete plotter; delete plotter;
......
...@@ -50,12 +50,12 @@ enum PageFormatReq { ...@@ -50,12 +50,12 @@ enum PageFormatReq {
class DIALOG_PLOT_SCHEMATIC_PS : public DIALOG_PLOT_SCHEMATIC_PS_BASE class DIALOG_PLOT_SCHEMATIC_PS : public DIALOG_PLOT_SCHEMATIC_PS_BASE
{ {
private: private:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
public: public:
/// Constructors /// Constructors
DIALOG_PLOT_SCHEMATIC_PS( WinEDA_SchematicFrame* parent ); DIALOG_PLOT_SCHEMATIC_PS( SCH_EDIT_FRAME* parent );
private: private:
static bool m_plotColorOpt; static bool m_plotColorOpt;
...@@ -80,7 +80,7 @@ int DIALOG_PLOT_SCHEMATIC_PS:: m_pageSizeSelect = PAGE_SIZE_AUTO; ...@@ -80,7 +80,7 @@ int DIALOG_PLOT_SCHEMATIC_PS:: m_pageSizeSelect = PAGE_SIZE_AUTO;
bool DIALOG_PLOT_SCHEMATIC_PS::m_plot_Sheet_Ref = true; bool DIALOG_PLOT_SCHEMATIC_PS::m_plot_Sheet_Ref = true;
void WinEDA_SchematicFrame::ToPlot_PS( wxCommandEvent& event ) void SCH_EDIT_FRAME::ToPlot_PS( wxCommandEvent& event )
{ {
DIALOG_PLOT_SCHEMATIC_PS dlg( this ); DIALOG_PLOT_SCHEMATIC_PS dlg( this );
...@@ -88,7 +88,7 @@ void WinEDA_SchematicFrame::ToPlot_PS( wxCommandEvent& event ) ...@@ -88,7 +88,7 @@ void WinEDA_SchematicFrame::ToPlot_PS( wxCommandEvent& event )
} }
DIALOG_PLOT_SCHEMATIC_PS::DIALOG_PLOT_SCHEMATIC_PS( WinEDA_SchematicFrame* parent ) : DIALOG_PLOT_SCHEMATIC_PS::DIALOG_PLOT_SCHEMATIC_PS( SCH_EDIT_FRAME* parent ) :
DIALOG_PLOT_SCHEMATIC_PS_BASE( parent ) DIALOG_PLOT_SCHEMATIC_PS_BASE( parent )
{ {
m_Parent = parent; m_Parent = parent;
...@@ -290,7 +290,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName, ...@@ -290,7 +290,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
m_Parent->PlotWorkSheet( plotter, screen ); m_Parent->PlotWorkSheet( plotter, screen );
} }
PlotDrawlist( plotter, screen->EEDrawList ); PlotDrawlist( plotter, screen->GetDrawItems() );
plotter->end_plot(); plotter->end_plot();
delete plotter; delete plotter;
......
...@@ -87,7 +87,7 @@ BEGIN_EVENT_TABLE( SCH_PREVIEW_FRAME, wxPreviewFrame ) ...@@ -87,7 +87,7 @@ BEGIN_EVENT_TABLE( SCH_PREVIEW_FRAME, wxPreviewFrame )
END_EVENT_TABLE() END_EVENT_TABLE()
DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* aParent ) : DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( SCH_EDIT_FRAME* aParent ) :
DIALOG_PRINT_USING_PRINTER_BASE( aParent ) DIALOG_PRINT_USING_PRINTER_BASE( aParent )
{ {
wxASSERT( aParent != NULL ); wxASSERT( aParent != NULL );
...@@ -97,15 +97,15 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* a ...@@ -97,15 +97,15 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* a
} }
WinEDA_SchematicFrame* DIALOG_PRINT_USING_PRINTER::GetParent() const SCH_EDIT_FRAME* DIALOG_PRINT_USING_PRINTER::GetParent() const
{ {
return ( WinEDA_SchematicFrame* ) wxWindow::GetParent(); return ( SCH_EDIT_FRAME* ) wxWindow::GetParent();
} }
void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event ) void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event )
{ {
WinEDA_SchematicFrame* parent = GetParent(); SCH_EDIT_FRAME* parent = GetParent();
if ( GetSizer() ) if ( GetSizer() )
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
...@@ -129,7 +129,7 @@ void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event ) ...@@ -129,7 +129,7 @@ void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event )
void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event ) void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event )
{ {
WinEDA_SchematicFrame* parent = GetParent(); SCH_EDIT_FRAME* parent = GetParent();
if( !IsIconized() ) if( !IsIconized() )
{ {
...@@ -148,7 +148,7 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event ) ...@@ -148,7 +148,7 @@ void DIALOG_PRINT_USING_PRINTER::OnCloseWindow( wxCloseEvent& event )
*/ */
void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event )
{ {
WinEDA_SchematicFrame* parent = GetParent(); SCH_EDIT_FRAME* parent = GetParent();
wxPageSetupDialog pageSetupDialog( this, &parent->GetPageSetupData() ); wxPageSetupDialog pageSetupDialog( this, &parent->GetPageSetupData() );
...@@ -162,7 +162,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) ...@@ -162,7 +162,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event )
*/ */
void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
{ {
WinEDA_SchematicFrame* parent = GetParent(); SCH_EDIT_FRAME* parent = GetParent();
parent->SetPrintMonochrome( m_checkMonochrome->IsChecked() ); parent->SetPrintMonochrome( m_checkMonochrome->IsChecked() );
parent->SetPrintSheetReference( m_checkReference->IsChecked() ); parent->SetPrintSheetReference( m_checkReference->IsChecked() );
...@@ -191,7 +191,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event ) ...@@ -191,7 +191,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event ) void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
{ {
WinEDA_SchematicFrame* parent = GetParent(); SCH_EDIT_FRAME* parent = GetParent();
parent->SetPrintMonochrome( m_checkMonochrome->IsChecked() ); parent->SetPrintMonochrome( m_checkMonochrome->IsChecked() );
parent->SetPrintSheetReference( m_checkReference->IsChecked() ); parent->SetPrintSheetReference( m_checkReference->IsChecked() );
...@@ -221,7 +221,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event ) ...@@ -221,7 +221,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
bool SCH_PRINTOUT::OnPrintPage( int page ) bool SCH_PRINTOUT::OnPrintPage( int page )
{ {
wxString msg; wxString msg;
WinEDA_SchematicFrame* parent = m_Parent->GetParent(); SCH_EDIT_FRAME* parent = m_Parent->GetParent();
msg.Printf( _( "Print page %d" ), page ); msg.Printf( _( "Print page %d" ), page );
parent->ClearMsgPanel(); parent->ClearMsgPanel();
parent->AppendMsgPanel( msg, wxEmptyString, CYAN ); parent->AppendMsgPanel( msg, wxEmptyString, CYAN );
...@@ -285,7 +285,7 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage ) ...@@ -285,7 +285,7 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
return false; return false;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
WinEDA_SchematicFrame* parent = m_Parent->GetParent(); SCH_EDIT_FRAME* parent = m_Parent->GetParent();
wxLogDebug( wxT( "Printer name: " ) + wxLogDebug( wxT( "Printer name: " ) +
parent->GetPageSetupData().GetPrintData().GetPrinterName() ); parent->GetPageSetupData().GetPrintData().GetPrinterName() );
wxLogDebug( wxT( "Paper ID: %d" ), wxLogDebug( wxT( "Paper ID: %d" ),
...@@ -315,7 +315,7 @@ void SCH_PRINTOUT::DrawPage() ...@@ -315,7 +315,7 @@ void SCH_PRINTOUT::DrawPage()
EDA_Rect oldClipBox; EDA_Rect oldClipBox;
wxRect fitRect; wxRect fitRect;
wxDC* dc = GetDC(); wxDC* dc = GetDC();
WinEDA_SchematicFrame* parent = m_Parent->GetParent(); SCH_EDIT_FRAME* parent = m_Parent->GetParent();
WinEDA_DrawPanel* panel = parent->DrawPanel; WinEDA_DrawPanel* panel = parent->DrawPanel;
wxBusyCursor dummy; wxBusyCursor dummy;
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_BASE class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_BASE
{ {
public: public:
DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* aParent ); DIALOG_PRINT_USING_PRINTER( SCH_EDIT_FRAME* aParent );
~DIALOG_PRINT_USING_PRINTER() {}; ~DIALOG_PRINT_USING_PRINTER() {};
WinEDA_SchematicFrame* GetParent() const; SCH_EDIT_FRAME* GetParent() const;
private: private:
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );
......
...@@ -24,7 +24,7 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); ...@@ -24,7 +24,7 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
/* Prepare the displacement of the text being edited. /* Prepare the displacement of the text being edited.
*/ */
/******************************************************************************/ /******************************************************************************/
void WinEDA_SchematicFrame::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC ) void SCH_EDIT_FRAME::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC )
{ {
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
...@@ -86,7 +86,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC ) ...@@ -86,7 +86,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC )
/******************************************************************************/ /******************************************************************************/
/* Edit the field Field (text, size) */ /* Edit the field Field (text, size) */
/******************************************************************************/ /******************************************************************************/
void WinEDA_SchematicFrame::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC ) void SCH_EDIT_FRAME::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC )
{ {
int fieldNdx, flag; int fieldNdx, flag;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
...@@ -189,8 +189,8 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -189,8 +189,8 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
wxPoint pos; wxPoint pos;
int fieldNdx; int fieldNdx;
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->GetParent(); SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) panel->GetParent();
SCH_FIELD* currentField = frame->GetCurrentField(); SCH_FIELD* currentField = frame->GetCurrentField();
if( currentField == NULL ) if( currentField == NULL )
return; return;
...@@ -220,8 +220,8 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -220,8 +220,8 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel->ForceCloseManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL;
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) Panel->GetParent(); SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) Panel->GetParent();
SCH_FIELD* currentField = frame->GetCurrentField(); SCH_FIELD* currentField = frame->GetCurrentField();
if( currentField ) if( currentField )
{ {
...@@ -238,7 +238,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -238,7 +238,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
void WinEDA_SchematicFrame::RotateCmpField( SCH_FIELD* Field, wxDC* DC ) void SCH_EDIT_FRAME::RotateCmpField( SCH_FIELD* Field, wxDC* DC )
{ {
int fieldNdx, flag; int fieldNdx, flag;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
...@@ -284,7 +284,7 @@ void WinEDA_SchematicFrame::RotateCmpField( SCH_FIELD* Field, wxDC* DC ) ...@@ -284,7 +284,7 @@ void WinEDA_SchematicFrame::RotateCmpField( SCH_FIELD* Field, wxDC* DC )
/****************************************************************************/ /****************************************************************************/
/* Edit the component text reference*/ /* Edit the component text reference*/
/****************************************************************************/ /****************************************************************************/
void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC ) void SCH_EDIT_FRAME::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
{ {
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
int flag = 0; int flag = 0;
...@@ -331,7 +331,7 @@ void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC ...@@ -331,7 +331,7 @@ void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC
/*****************************************************************************/ /*****************************************************************************/
/* Routine to change the selected text */ /* Routine to change the selected text */
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC ) void SCH_EDIT_FRAME::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
{ {
wxString message; wxString message;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
...@@ -373,7 +373,7 @@ void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC ) ...@@ -373,7 +373,7 @@ void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
} }
void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC ) void SCH_EDIT_FRAME::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
{ {
wxString message; wxString message;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
......
...@@ -31,7 +31,7 @@ static bool lastTextBold = false; ...@@ -31,7 +31,7 @@ static bool lastTextBold = false;
static bool lastTextItalic = false; static bool lastTextItalic = false;
void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC ) void SCH_EDIT_FRAME::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC )
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
return; return;
...@@ -75,7 +75,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC ) ...@@ -75,7 +75,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC )
} }
void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ) void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur, TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur,
...@@ -116,7 +116,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC ) ...@@ -116,7 +116,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
/* Routine to create new text struct (GraphicText, label or Glabel). /* Routine to create new text struct (GraphicText, label or Glabel).
*/ */
SCH_TEXT* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* DC, int type )
{ {
SCH_TEXT* NewText = NULL; SCH_TEXT* NewText = NULL;
...@@ -143,8 +143,7 @@ SCH_TEXT* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) ...@@ -143,8 +143,7 @@ SCH_TEXT* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
break; break;
default: default:
DisplayError( this, DisplayError( this, wxT( "SCH_EDIT_FRAME::CreateNewText() Internal error" ) );
wxT( "WinEDA_SchematicFrame::CreateNewText() Internal error" ) );
return NULL; return NULL;
} }
...@@ -265,7 +264,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -265,7 +264,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
* A new test, label or hierarchical or global label is created from the old text. * A new test, label or hierarchical or global label is created from the old text.
* the old text is deleted * the old text is deleted
*/ */
void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype ) void SCH_EDIT_FRAME::ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype )
{ {
if( Text == NULL ) if( Text == NULL )
return; return;
...@@ -315,9 +314,9 @@ void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newty ...@@ -315,9 +314,9 @@ void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newty
/* add the new text in linked list if old text is in list */ /* add the new text in linked list if old text is in list */
if( (flags & IS_NEW) == 0 ) if( (flags & IS_NEW) == 0 )
{ {
newtext->SetNext( GetScreen()->EEDrawList ); newtext->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->EEDrawList = newtext; GetScreen()->SetDrawItems( newtext );
OnModify( ); OnModify();
} }
/* now delete the old text /* now delete the old text
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* *
* Clear all already loaded libraries and load all of the project libraries. * Clear all already loaded libraries and load all of the project libraries.
*/ */
void WinEDA_SchematicFrame::LoadLibraries( void ) void SCH_EDIT_FRAME::LoadLibraries( void )
{ {
size_t ii; size_t ii;
wxFileName fn; wxFileName fn;
......
...@@ -22,11 +22,10 @@ ...@@ -22,11 +22,10 @@
#include "build_version.h" #include "build_version.h"
static EDA_BaseStruct* HighLightStruct = NULL; static EDA_ITEM* HighLightStruct = NULL;
void DrawDanglingSymbol( WinEDA_DrawPanel* panel, wxDC* DC, void DrawDanglingSymbol( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& pos, int Color )
const wxPoint& pos, int Color )
{ {
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
...@@ -40,7 +39,7 @@ void DrawDanglingSymbol( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -40,7 +39,7 @@ void DrawDanglingSymbol( WinEDA_DrawPanel* panel, wxDC* DC,
} }
void SetHighLightStruct( EDA_BaseStruct* HighLight ) void SetHighLightStruct( EDA_ITEM* HighLight )
{ {
HighLightStruct = HighLight; HighLightStruct = HighLight;
} }
...@@ -49,7 +48,7 @@ void SetHighLightStruct( EDA_BaseStruct* HighLight ) ...@@ -49,7 +48,7 @@ void SetHighLightStruct( EDA_BaseStruct* HighLight )
/* /*
* Redraws only the active window which is assumed to be whole visible. * Redraws only the active window which is assumed to be whole visible.
*/ */
void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{ {
wxString title; wxString title;
...@@ -60,8 +59,7 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -60,8 +59,7 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->DrawBackGround( DC ); DrawPanel->DrawBackGround( DC );
RedrawStructList( DrawPanel, DC, GetScreen()->EEDrawList, RedrawStructList( DrawPanel, DC, GetScreen()->GetDrawItems(), GR_DEFAULT_DRAWMODE );
GR_DEFAULT_DRAWMODE );
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
...@@ -118,13 +116,12 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -118,13 +116,12 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode) * @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not used here) * @param aData = a pointer on an auxiliary data (not used here)
*/ */
void WinEDA_SchematicFrame::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMask,
int aPrintMask, bool aPrintMirrorMode, bool aPrintMirrorMode, void* aData)
void * aData)
{ {
wxBeginBusyCursor(); wxBeginBusyCursor();
RedrawStructList( DrawPanel, aDC, ActiveScreen->EEDrawList, GR_COPY ); RedrawStructList( DrawPanel, aDC, (SCH_ITEM*) ActiveScreen->GetDrawItems(), GR_COPY );
if( aPrint_Sheet_Ref ) if( aPrint_Sheet_Ref )
TraceWorkSheet( aDC, ActiveScreen, g_DrawDefaultLineThickness ); TraceWorkSheet( aDC, ActiveScreen, g_DrawDefaultLineThickness );
...@@ -145,7 +142,7 @@ void RedrawStructList( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -145,7 +142,7 @@ void RedrawStructList( WinEDA_DrawPanel* panel, wxDC* DC,
if( !(Structlist->m_Flags & IS_MOVED) ) if( !(Structlist->m_Flags & IS_MOVED) )
{ {
// uncomment line below when there is a virtual // uncomment line below when there is a virtual
// EDA_BaseStruct::GetBoundingBox() // EDA_ITEM::GetBoundingBox()
// if( panel->m_ClipBox.Intersects( Structs->GetBoundingBox() // if( panel->m_ClipBox.Intersects( Structs->GetBoundingBox()
// ) ) // ) )
RedrawOneStruct( panel, DC, Structlist, DrawMode, Color ); RedrawOneStruct( panel, DC, Structlist, DrawMode, Color );
......
...@@ -105,8 +105,8 @@ IMPLEMENT_APP( WinEDA_App ) ...@@ -105,8 +105,8 @@ IMPLEMENT_APP( WinEDA_App )
*/ */
void WinEDA_App::MacOpenFile( const wxString &fileName ) void WinEDA_App::MacOpenFile( const wxString &fileName )
{ {
wxFileName filename = fileName; wxFileName filename = fileName;
WinEDA_SchematicFrame * frame = ((WinEDA_SchematicFrame*) GetTopWindow()); SCH_EDIT_FRAME* frame = ((SCH_EDIT_FRAME*) GetTopWindow());
if( !frame ) if( !frame )
return; return;
...@@ -127,8 +127,8 @@ bool WinEDA_App::OnInit() ...@@ -127,8 +127,8 @@ bool WinEDA_App::OnInit()
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP; wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
#endif /* __WXMAC__ */ #endif /* __WXMAC__ */
wxFileName filename; wxFileName filename;
WinEDA_SchematicFrame* frame = NULL; SCH_EDIT_FRAME* frame = NULL;
InitEDA_Appl( wxT( "EESchema" ), APP_TYPE_EESCHEMA ); InitEDA_Appl( wxT( "EESchema" ), APP_TYPE_EESCHEMA );
...@@ -154,8 +154,7 @@ bool WinEDA_App::OnInit() ...@@ -154,8 +154,7 @@ bool WinEDA_App::OnInit()
ReadHotkeyConfig( wxT("SchematicFrame"), s_Eeschema_Hokeys_Descr ); ReadHotkeyConfig( wxT("SchematicFrame"), s_Eeschema_Hokeys_Descr );
// Create main frame (schematic frame) : // Create main frame (schematic frame) :
frame = new WinEDA_SchematicFrame( NULL, wxT( "EESchema" ), frame = new SCH_EDIT_FRAME( NULL, wxT( "EESchema" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
SetTopWindow( frame ); SetTopWindow( frame );
frame->Show( TRUE ); frame->Show( TRUE );
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event ) void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
{ {
DIALOG_EESCHEMA_CONFIG CfgFrame( (WinEDA_SchematicFrame *)GetParent(), this ); DIALOG_EESCHEMA_CONFIG CfgFrame( (SCH_EDIT_FRAME *)GetParent(), this );
CfgFrame.ShowModal(); CfgFrame.ShowModal();
} }
...@@ -54,7 +54,7 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) ...@@ -54,7 +54,7 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxFileName fn; wxFileName fn;
WinEDA_SchematicFrame * schFrame = ( WinEDA_SchematicFrame * ) GetParent(); SCH_EDIT_FRAME* schFrame = ( SCH_EDIT_FRAME* ) GetParent();
switch( id ) switch( id )
{ {
...@@ -103,7 +103,7 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) ...@@ -103,7 +103,7 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
} }
void WinEDA_SchematicFrame::OnColorConfig( wxCommandEvent& aEvent ) void SCH_EDIT_FRAME::OnColorConfig( wxCommandEvent& aEvent )
{ {
DIALOG_COLOR_CONFIG dlg( this ); DIALOG_COLOR_CONFIG dlg( this );
...@@ -111,7 +111,7 @@ void WinEDA_SchematicFrame::OnColorConfig( wxCommandEvent& aEvent ) ...@@ -111,7 +111,7 @@ void WinEDA_SchematicFrame::OnColorConfig( wxCommandEvent& aEvent )
} }
void WinEDA_SchematicFrame::InstallConfigFrame( wxCommandEvent& event ) void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
{ {
DIALOG_EESCHEMA_CONFIG CfgFrame( this, this ); DIALOG_EESCHEMA_CONFIG CfgFrame( this, this );
...@@ -119,7 +119,7 @@ void WinEDA_SchematicFrame::InstallConfigFrame( wxCommandEvent& event ) ...@@ -119,7 +119,7 @@ void WinEDA_SchematicFrame::InstallConfigFrame( wxCommandEvent& event )
} }
void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxFileName fn; wxFileName fn;
...@@ -166,20 +166,19 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) ...@@ -166,20 +166,19 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config error" ) ); DisplayError( this, wxT( "SCH_EDIT_FRAME::Process_Config error" ) );
} }
} }
void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
{ {
wxArrayString units; wxArrayString units;
GridArray& grid_list = GetBaseScreen()->m_GridList; GRIDS grid_list;
DIALOG_EESCHEMA_OPTIONS dlg( this ); GetBaseScreen()->GetGrids( grid_list );
wxLogDebug( wxT( "Current grid array index %d." ), DIALOG_EESCHEMA_OPTIONS dlg( this );
grid_list.Index( GetBaseScreen()->GetGrid() ) );
units.Add( GetUnitsLabel( INCHES ) ); units.Add( GetUnitsLabel( INCHES ) );
units.Add( GetUnitsLabel( MILLIMETRES ) ); units.Add( GetUnitsLabel( MILLIMETRES ) );
...@@ -204,8 +203,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event ) ...@@ -204,8 +203,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event )
for( unsigned i=0; i<tfnames.size(); ++i ) for( unsigned i=0; i<tfnames.size(); ++i )
{ {
D(printf("dlg.SetFieldName(%d, '%s')\n", D(printf("dlg.SetFieldName(%d, '%s')\n", i, CONV_TO_UTF8( tfnames[i].m_Name) );)
i, CONV_TO_UTF8( tfnames[i].m_Name) );)
dlg.SetFieldName( i, tfnames[i].m_Name ); dlg.SetFieldName( i, tfnames[i].m_Name );
} }
...@@ -215,8 +213,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event ) ...@@ -215,8 +213,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event )
g_UserUnit = (UserUnitType)dlg.GetUnitsSelection(); g_UserUnit = (UserUnitType)dlg.GetUnitsSelection();
GetBaseScreen()->SetGrid( GetBaseScreen()->SetGrid( grid_list[ (size_t) dlg.GetGridSelection() ].m_Size );
grid_list[ (size_t) dlg.GetGridSelection() ].m_Size );
g_DrawDefaultLineThickness = dlg.GetLineWidth(); g_DrawDefaultLineThickness = dlg.GetLineWidth();
g_DefaultTextLabelSize = dlg.GetTextSize(); g_DefaultTextLabelSize = dlg.GetTextSize();
...@@ -235,6 +232,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event ) ...@@ -235,6 +232,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event )
// look like the component field property editor, showing visibility and value also // look like the component field property editor, showing visibility and value also
DeleteAllTemplateFieldNames(); DeleteAllTemplateFieldNames();
for( int i=0; i<8; ++i ) // no. fields in this dialog window for( int i=0; i<8; ++i ) // no. fields in this dialog window
{ {
templateFieldName = dlg.GetFieldName( i ); templateFieldName = dlg.GetFieldName( i );
...@@ -262,7 +260,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event ) ...@@ -262,7 +260,7 @@ void WinEDA_SchematicFrame::OnSetOptions( wxCommandEvent& event )
* to define local variables. The old method of statically building the array * to define local variables. The old method of statically building the array
* at compile time requiring global variable definitions. * at compile time requiring global variable definitions.
*/ */
PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void ) PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters( void )
{ {
if( !m_projectFileParams.empty() ) if( !m_projectFileParams.empty() )
return m_projectFileParams; return m_projectFileParams;
...@@ -349,8 +347,7 @@ PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void ) ...@@ -349,8 +347,7 @@ PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void )
/* /*
* Load the Kicad project file (*.pro) settings specific to EESchema. * Load the Kicad project file (*.pro) settings specific to EESchema.
*/ */
bool WinEDA_SchematicFrame::LoadProjectFile( const wxString& CfgFileName, bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig )
bool ForceRereadConfig )
{ {
wxFileName fn; wxFileName fn;
bool IsRead = TRUE; bool IsRead = TRUE;
...@@ -396,7 +393,7 @@ bool WinEDA_SchematicFrame::LoadProjectFile( const wxString& CfgFileName, ...@@ -396,7 +393,7 @@ bool WinEDA_SchematicFrame::LoadProjectFile( const wxString& CfgFileName,
/* /*
* Save the Kicad project file (*.pro) settings specific to EESchema. * Save the Kicad project file (*.pro) settings specific to EESchema.
*/ */
void WinEDA_SchematicFrame::SaveProjectFile( wxWindow* displayframe, bool askoverwrite ) void SCH_EDIT_FRAME::SaveProjectFile( wxWindow* displayframe, bool askoverwrite )
{ {
wxFileName fn; wxFileName fn;
...@@ -457,7 +454,7 @@ static const wxString SimulatorCommandEntry( wxT( "SimCmdLine" ) ); ...@@ -457,7 +454,7 @@ static const wxString SimulatorCommandEntry( wxT( "SimCmdLine" ) );
* global variables or move them to the object class where they are * global variables or move them to the object class where they are
* used. * used.
*/ */
PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void ) PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
{ {
if( !m_configSettings.empty() ) if( !m_configSettings.empty() )
return m_configSettings; return m_configSettings;
...@@ -549,7 +546,7 @@ PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void ) ...@@ -549,7 +546,7 @@ PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void )
/* /*
* Load the EESchema configuration parameters. * Load the EESchema configuration parameters.
*/ */
void WinEDA_SchematicFrame::LoadSettings() void SCH_EDIT_FRAME::LoadSettings()
{ {
wxASSERT( wxGetApp().m_EDA_Config != NULL ); wxASSERT( wxGetApp().m_EDA_Config != NULL );
...@@ -647,7 +644,7 @@ void WinEDA_SchematicFrame::LoadSettings() ...@@ -647,7 +644,7 @@ void WinEDA_SchematicFrame::LoadSettings()
/* /*
* Save the EESchema configuration parameters. * Save the EESchema configuration parameters.
*/ */
void WinEDA_SchematicFrame::SaveSettings() void SCH_EDIT_FRAME::SaveSettings()
{ {
wxASSERT( wxGetApp().m_EDA_Config != NULL ); wxASSERT( wxGetApp().m_EDA_Config != NULL );
......
...@@ -169,7 +169,7 @@ int TestDuplicateSheetNames( bool aCreateMarker ) ...@@ -169,7 +169,7 @@ int TestDuplicateSheetNames( bool aCreateMarker )
Screen != NULL; Screen != NULL;
Screen = ScreenList.GetNext() ) Screen = ScreenList.GetNext() )
{ {
for( SCH_ITEM* ref_item = Screen->EEDrawList; for( SCH_ITEM* ref_item = Screen->GetDrawItems();
ref_item != NULL; ref_item != NULL;
ref_item = ref_item->Next() ) ref_item = ref_item->Next() )
{ {
...@@ -199,9 +199,10 @@ int TestDuplicateSheetNames( bool aCreateMarker ) ...@@ -199,9 +199,10 @@ int TestDuplicateSheetNames( bool aCreateMarker )
( (SCH_SHEET*) item_to_test )->m_Pos ); ( (SCH_SHEET*) item_to_test )->m_Pos );
Marker->SetMarkerType( MARK_ERC ); Marker->SetMarkerType( MARK_ERC );
Marker->SetErrorLevel( ERR ); Marker->SetErrorLevel( ERR );
Marker->SetNext( Screen->EEDrawList ); Marker->SetNext( Screen->GetDrawItems() );
Screen->EEDrawList = Marker; Screen->SetDrawItems( Marker );
} }
err_count++; err_count++;
} }
} }
...@@ -235,12 +236,13 @@ void Diagnose( WinEDA_DrawPanel* aPanel, ...@@ -235,12 +236,13 @@ void Diagnose( WinEDA_DrawPanel* aPanel,
Marker->SetMarkerType( MARK_ERC ); Marker->SetMarkerType( MARK_ERC );
Marker->SetErrorLevel( WAR ); Marker->SetErrorLevel( WAR );
screen = aNetItemRef->m_SheetList.LastScreen(); screen = aNetItemRef->m_SheetList.LastScreen();
Marker->SetNext( screen->EEDrawList ); Marker->SetNext( screen->GetDrawItems() );
screen->EEDrawList = Marker; screen->SetDrawItems( Marker );
g_EESchemaVar.NbErrorErc++; g_EESchemaVar.NbErrorErc++;
g_EESchemaVar.NbWarningErc++; g_EESchemaVar.NbWarningErc++;
wxString msg; wxString msg;
if( aMinConn < 0 ) if( aMinConn < 0 )
{ {
if( (aNetItemRef->m_Type == NET_HIERLABEL) if( (aNetItemRef->m_Type == NET_HIERLABEL)
...@@ -271,6 +273,7 @@ void Diagnose( WinEDA_DrawPanel* aPanel, ...@@ -271,6 +273,7 @@ void Diagnose( WinEDA_DrawPanel* aPanel,
memcpy( ascii_buf, &aNetItemRef->m_PinNum, 4 ); memcpy( ascii_buf, &aNetItemRef->m_PinNum, 4 );
string_pinnum = CONV_FROM_UTF8( ascii_buf ); string_pinnum = CONV_FROM_UTF8( ascii_buf );
cmp_ref = wxT( "?" ); cmp_ref = wxT( "?" );
if( aNetItemRef->m_Type == NET_PIN && aNetItemRef->m_Link ) if( aNetItemRef->m_Type == NET_PIN && aNetItemRef->m_Link )
cmp_ref = ( (SCH_COMPONENT*) aNetItemRef->m_Link )->GetRef( &aNetItemRef->m_SheetList ); cmp_ref = ( (SCH_COMPONENT*) aNetItemRef->m_Link )->GetRef( &aNetItemRef->m_SheetList );
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
#include "sch_text.h" #include "sch_text.h"
/** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest /** Event function SCH_EDIT_FRAME::OnCopySchematicItemRequest
* duplicate the current located item * duplicate the current located item
*/ */
void WinEDA_SchematicFrame::OnCopySchematicItemRequest( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnCopySchematicItemRequest( wxCommandEvent& event )
{ {
SCH_ITEM * curr_item = GetScreen()->GetCurItem(); SCH_ITEM * curr_item = GetScreen()->GetCurItem();
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* FileSave controls how the file is to be saved - under what name. * * FileSave controls how the file is to be saved - under what name. *
* Returns TRUE if the file has been saved. * * Returns TRUE if the file has been saved. *
*****************************************************************************/ *****************************************************************************/
bool WinEDA_SchematicFrame::SaveEEFile( SCH_SCREEN* screen, int FileSave ) bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* screen, int FileSave )
{ {
wxString msg; wxString msg;
wxFileName schematicFileName, backupFileName; wxFileName schematicFileName, backupFileName;
...@@ -100,7 +100,7 @@ bool WinEDA_SchematicFrame::SaveEEFile( SCH_SCREEN* screen, int FileSave ) ...@@ -100,7 +100,7 @@ bool WinEDA_SchematicFrame::SaveEEFile( SCH_SCREEN* screen, int FileSave )
/* Commands to save project or the current page. /* Commands to save project or the current page.
*/ */
void WinEDA_SchematicFrame::Save_File( wxCommandEvent& event ) void SCH_EDIT_FRAME::Save_File( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
...@@ -119,7 +119,7 @@ void WinEDA_SchematicFrame::Save_File( wxCommandEvent& event ) ...@@ -119,7 +119,7 @@ void WinEDA_SchematicFrame::Save_File( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_SchematicFrame::Save_File Internal Error" ) ); DisplayError( this, wxT( "SCH_EDIT_FRAME::Save_File Internal Error" ) );
break; break;
} }
} }
...@@ -131,7 +131,7 @@ void WinEDA_SchematicFrame::Save_File( wxCommandEvent& event ) ...@@ -131,7 +131,7 @@ void WinEDA_SchematicFrame::Save_File( wxCommandEvent& event )
* Schematic root file and its subhierarchies, the configuration and the libs * Schematic root file and its subhierarchies, the configuration and the libs
* which are not already loaded) * which are not already loaded)
*/ */
bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNew ) bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& FileName, bool IsNew )
{ {
SCH_SCREEN* screen; SCH_SCREEN* screen;
wxString FullFileName, msg; wxString FullFileName, msg;
...@@ -308,14 +308,13 @@ bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsN ...@@ -308,14 +308,13 @@ bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsN
* *
* The library archive name is <root_name>-cache.lib * The library archive name is <root_name>-cache.lib
*/ */
void WinEDA_SchematicFrame::SaveProject() void SCH_EDIT_FRAME::SaveProject()
{ {
SCH_SCREEN* screen; SCH_SCREEN* screen;
wxFileName fn; wxFileName fn;
SCH_SCREENS ScreenList; SCH_SCREENS ScreenList;
for( screen = ScreenList.GetFirst(); screen != NULL; for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
screen = ScreenList.GetNext() )
{ {
D( printf( "SaveEEFile, %s\n", CONV_TO_UTF8( screen->m_FileName ) ); ) D( printf( "SaveEEFile, %s\n", CONV_TO_UTF8( screen->m_FileName ) ); )
SaveEEFile( screen, FILE_SAVE_AS ); SaveEEFile( screen, FILE_SAVE_AS );
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "dialogs/dialog_schematic_find.h" #include "dialogs/dialog_schematic_find.h"
void WinEDA_SchematicFrame::OnFindDrcMarker( wxFindDialogEvent& event ) void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
{ {
static SCH_MARKER* lastMarker = NULL; static SCH_MARKER* lastMarker = NULL;
...@@ -99,11 +99,11 @@ void WinEDA_SchematicFrame::OnFindDrcMarker( wxFindDialogEvent& event ) ...@@ -99,11 +99,11 @@ void WinEDA_SchematicFrame::OnFindDrcMarker( wxFindDialogEvent& event )
* >= 4 => unused (same as 0) * >= 4 => unused (same as 0)
* @param mouseWarp If true, then move the mouse cursor to the item. * @param mouseWarp If true, then move the mouse cursor to the item.
*/ */
SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( const wxString& component_reference, SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_reference,
bool Find_in_hierarchy, bool Find_in_hierarchy,
int SearchType, int SearchType,
const wxString& text_to_find, const wxString& text_to_find,
bool mouseWarp ) bool mouseWarp )
{ {
SCH_SHEET_PATH* sheet, * SheetWithComponentFound = NULL; SCH_SHEET_PATH* sheet, * SheetWithComponentFound = NULL;
SCH_ITEM* DrawList = NULL; SCH_ITEM* DrawList = NULL;
...@@ -179,6 +179,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( const wxString& component ...@@ -179,6 +179,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( const wxString& component
if( Component ) if( Component )
{ {
sheet = SheetWithComponentFound; sheet = SheetWithComponentFound;
if( sheet != GetSheet() ) if( sheet != GetSheet() )
{ {
sheet->LastScreen()->SetZoom( GetScreen()->GetZoom() ); sheet->LastScreen()->SetZoom( GetScreen()->GetZoom() );
...@@ -294,7 +295,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( const wxString& component ...@@ -294,7 +295,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( const wxString& component
* *
* @param event - Find dialog event containing the find parameters. * @param event - Find dialog event containing the find parameters.
*/ */
void WinEDA_SchematicFrame::OnFindSchematicItem( wxFindDialogEvent& event ) void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& event )
{ {
static SCH_ITEM* lastItem = NULL; /* last item found when searching a match static SCH_ITEM* lastItem = NULL; /* last item found when searching a match
* note: the actual matched item can be a * note: the actual matched item can be a
...@@ -318,7 +319,8 @@ void WinEDA_SchematicFrame::OnFindSchematicItem( wxFindDialogEvent& event ) ...@@ -318,7 +319,8 @@ void WinEDA_SchematicFrame::OnFindSchematicItem( wxFindDialogEvent& event )
} }
else else
{ {
lastItem = schematic.MatchNextItem( searchCriteria, &sheetFoundIn, lastItem, &lastItemPosition ); lastItem = schematic.MatchNextItem( searchCriteria, &sheetFoundIn, lastItem,
&lastItemPosition );
} }
if( lastItem != NULL ) if( lastItem != NULL )
......
...@@ -32,7 +32,7 @@ class TRANSFORM; ...@@ -32,7 +32,7 @@ class TRANSFORM;
#define HIGHLIGHT_COLOR WHITE #define HIGHLIGHT_COLOR WHITE
/* Used for EDA_BaseStruct, .m_Select member */ /* Used for EDA_ITEM, .m_Select member */
#define IS_SELECTED 1 #define IS_SELECTED 1
#define TEXT_NO_VISIBLE 1 #define TEXT_NO_VISIBLE 1
......
...@@ -29,7 +29,7 @@ static TRANSFORM OldTransform; ...@@ -29,7 +29,7 @@ static TRANSFORM OldTransform;
static wxPoint OldPos; static wxPoint OldPos;
wxString WinEDA_SchematicFrame::SelectFromLibBrowser( void ) wxString SCH_EDIT_FRAME::SelectFromLibBrowser( void )
{ {
wxSemaphore semaphore( 0, 1 ); wxSemaphore semaphore( 0, 1 );
...@@ -61,10 +61,10 @@ wxString WinEDA_SchematicFrame::SelectFromLibBrowser( void ) ...@@ -61,10 +61,10 @@ wxString WinEDA_SchematicFrame::SelectFromLibBrowser( void )
* if libname != "", search in lib "libname" * if libname != "", search in lib "libname"
* else search in all loaded libs * else search in all loaded libs
*/ */
SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
const wxString& libname, const wxString& libname,
wxArrayString& HistoryList, wxArrayString& HistoryList,
bool UseLibBrowser ) bool UseLibBrowser )
{ {
int CmpCount = 0; int CmpCount = 0;
int unit = 1; int unit = 1;
...@@ -98,7 +98,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -98,7 +98,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
msg.Printf( _( "component selection (%d items loaded):" ), CmpCount ); msg.Printf( _( "component selection (%d items loaded):" ), CmpCount );
DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), HistoryList, DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), HistoryList,
msg, UseLibBrowser ); msg, UseLibBrowser );
dlg.SetComponentName( lastCommponentName ); dlg.SetComponentName( lastCommponentName );
if ( dlg.ShowModal() == wxID_CANCEL ) if ( dlg.ShowModal() == wxID_CANCEL )
...@@ -135,6 +135,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -135,6 +135,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
AllowWildSeach = FALSE; AllowWildSeach = FALSE;
keys = Name.AfterFirst( '=' ); keys = Name.AfterFirst( '=' );
Name = DataBaseGetName( this, keys, Name ); Name = DataBaseGetName( this, keys, Name );
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = FALSE;
...@@ -145,6 +146,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -145,6 +146,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
else if( Name == wxT( "*" ) ) else if( Name == wxT( "*" ) )
{ {
AllowWildSeach = FALSE; AllowWildSeach = FALSE;
if( GetNameOfPartToLoad( this, Library, Name ) == 0 ) if( GetNameOfPartToLoad( this, Library, Name ) == 0 )
{ {
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = FALSE;
...@@ -186,6 +188,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -186,6 +188,7 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = FALSE;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
if( Entry == NULL ) if( Entry == NULL )
{ {
msg = _( "Failed to find part " ) + Name + _( " in library" ); msg = _( "Failed to find part " ) + Name + _( " in library" );
...@@ -244,8 +247,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -244,8 +247,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
* *
** If DC == NULL: no repaint ** If DC == NULL: no repaint
*/ */
void WinEDA_SchematicFrame::CmpRotationMiroir( SCH_COMPONENT* DrawComponent, void SCH_EDIT_FRAME::CmpRotationMiroir( SCH_COMPONENT* DrawComponent, wxDC* DC, int type_rotate )
wxDC* DC, int type_rotate )
{ {
if( DrawComponent == NULL ) if( DrawComponent == NULL )
return; return;
...@@ -254,6 +256,7 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( SCH_COMPONENT* DrawComponent, ...@@ -254,6 +256,7 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
if( DC ) if( DC )
{ {
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) );
else else
...@@ -270,12 +273,11 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( SCH_COMPONENT* DrawComponent, ...@@ -270,12 +273,11 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint(0,0) ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint(0,0) );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
} }
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
OnModify( ); OnModify( );
} }
...@@ -312,8 +314,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -312,8 +314,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* /*
* Handle select part in multi-part component. * Handle select part in multi-part component.
*/ */
void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC* DC )
int unit, wxDC* DC )
{ {
int m_UnitCount; int m_UnitCount;
LIB_COMPONENT* LibEntry; LIB_COMPONENT* LibEntry;
...@@ -333,8 +334,10 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, ...@@ -333,8 +334,10 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Multi == unit ) if( DrawComponent->m_Multi == unit )
return; return;
if( unit < 1 ) if( unit < 1 )
unit = 1; unit = 1;
if( unit > m_UnitCount ) if( unit > m_UnitCount )
unit = m_UnitCount; unit = m_UnitCount;
...@@ -351,16 +354,14 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent, ...@@ -351,16 +354,14 @@ void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
GR_DEFAULT_DRAWMODE );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
OnModify( ); OnModify( );
} }
void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
wxDC* DC )
{ {
LIB_COMPONENT* LibEntry; LIB_COMPONENT* LibEntry;
...@@ -400,15 +401,16 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent, ...@@ -400,15 +401,16 @@ void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
GR_DEFAULT_DRAWMODE ); GR_DEFAULT_DRAWMODE );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
OnModify( ); OnModify( );
} }
void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component, wxDC* DC ) void SCH_EDIT_FRAME::StartMovePart( SCH_COMPONENT* Component, wxDC* DC )
{ {
if( Component == NULL ) if( Component == NULL )
return; return;
if( Component->Type() != TYPE_SCH_COMPONENT ) if( Component->Type() != TYPE_SCH_COMPONENT )
return; return;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "wx/treectrl.h" #include "wx/treectrl.h"
static bool UpdateScreenFromSheet( WinEDA_SchematicFrame* frame ); static bool UpdateScreenFromSheet( SCH_EDIT_FRAME* frame );
enum enum
{ {
...@@ -79,17 +79,17 @@ WinEDA_Tree::WinEDA_Tree( WinEDA_HierFrame* parent ) : ...@@ -79,17 +79,17 @@ WinEDA_Tree::WinEDA_Tree( WinEDA_HierFrame* parent ) :
class WinEDA_HierFrame : public wxDialog class WinEDA_HierFrame : public wxDialog
{ {
public: public:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
WinEDA_Tree* m_Tree; WinEDA_Tree* m_Tree;
int m_nbsheets; int m_nbsheets;
wxDC* m_DC; wxDC* m_DC;
private: private:
wxSize m_TreeSize; wxSize m_TreeSize;
int maxposx; int maxposx;
public: public:
WinEDA_HierFrame( WinEDA_SchematicFrame* parent, wxDC* DC, const wxPoint& pos ); WinEDA_HierFrame( SCH_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos );
void BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId* previousmenu ); void BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId* previousmenu );
~WinEDA_HierFrame(); ~WinEDA_HierFrame();
...@@ -108,7 +108,7 @@ BEGIN_EVENT_TABLE( WinEDA_HierFrame, wxDialog ) ...@@ -108,7 +108,7 @@ BEGIN_EVENT_TABLE( WinEDA_HierFrame, wxDialog )
END_EVENT_TABLE() END_EVENT_TABLE()
void WinEDA_SchematicFrame::InstallHierarchyFrame( wxDC* DC, wxPoint& pos ) void SCH_EDIT_FRAME::InstallHierarchyFrame( wxDC* DC, wxPoint& pos )
{ {
WinEDA_HierFrame* treeframe = new WinEDA_HierFrame( this, DC, pos ); WinEDA_HierFrame* treeframe = new WinEDA_HierFrame( this, DC, pos );
...@@ -117,10 +117,8 @@ void WinEDA_SchematicFrame::InstallHierarchyFrame( wxDC* DC, wxPoint& pos ) ...@@ -117,10 +117,8 @@ void WinEDA_SchematicFrame::InstallHierarchyFrame( wxDC* DC, wxPoint& pos )
} }
WinEDA_HierFrame::WinEDA_HierFrame( WinEDA_SchematicFrame* parent, wxDC* DC, WinEDA_HierFrame::WinEDA_HierFrame( SCH_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos ) :
const wxPoint& pos ) : wxDialog( parent, -1, _( "Navigator" ), pos, wxSize( 110, 50 ), DIALOG_STYLE )
wxDialog( parent, -1, _( "Navigator" ), pos, wxSize( 110, 50 ),
DIALOG_STYLE )
{ {
wxTreeItemId cellule; wxTreeItemId cellule;
...@@ -253,7 +251,7 @@ void WinEDA_HierFrame::OnSelect( wxTreeEvent& event ) ...@@ -253,7 +251,7 @@ void WinEDA_HierFrame::OnSelect( wxTreeEvent& event )
/* Set the current screen to display the parent sheet of the current /* Set the current screen to display the parent sheet of the current
* displayed sheet * displayed sheet
*/ */
void WinEDA_SchematicFrame::InstallPreviousSheet() void SCH_EDIT_FRAME::InstallPreviousSheet()
{ {
if( m_CurrentSheet->Last() == g_RootSheet ) if( m_CurrentSheet->Last() == g_RootSheet )
return; return;
...@@ -264,24 +262,25 @@ void WinEDA_SchematicFrame::InstallPreviousSheet() ...@@ -264,24 +262,25 @@ void WinEDA_SchematicFrame::InstallPreviousSheet()
//make a copy for testing purposes. //make a copy for testing purposes.
SCH_SHEET_PATH listtemp = *m_CurrentSheet; SCH_SHEET_PATH listtemp = *m_CurrentSheet;
listtemp.Pop(); listtemp.Pop();
if( listtemp.LastScreen() == NULL ) if( listtemp.LastScreen() == NULL )
{ {
DisplayError( this, DisplayError( this, wxT( "InstallPreviousScreen() Error: Sheet not found" ) );
wxT( "InstallPreviousScreen() Error: Sheet not found" ) );
return; return;
} }
m_CurrentSheet->Pop(); m_CurrentSheet->Pop();
UpdateScreenFromSheet( this ); UpdateScreenFromSheet( this );
} }
/* Routine installation of the screen corresponding to the symbol edge Sheet /* Routine installation of the screen corresponding to the symbol edge Sheet
* Be careful here because the SCH_SHEETs within the EEDrawList * Be careful here because the SCH_SHEETs within the GetDrawItems()
* don't actually have a valid m_AssociatedScreen (on purpose -- you need the * don't actually have a valid m_AssociatedScreen (on purpose -- you need the
* m_SubSheet hierarchy to maintain path info (well, this is but one way to * m_SubSheet hierarchy to maintain path info (well, this is but one way to
* maintain path info..) * maintain path info..)
*/ */
void WinEDA_SchematicFrame::InstallNextScreen( SCH_SHEET* Sheet ) void SCH_EDIT_FRAME::InstallNextScreen( SCH_SHEET* Sheet )
{ {
if( Sheet == NULL ) if( Sheet == NULL )
{ {
...@@ -297,7 +296,7 @@ void WinEDA_SchematicFrame::InstallNextScreen( SCH_SHEET* Sheet ) ...@@ -297,7 +296,7 @@ void WinEDA_SchematicFrame::InstallNextScreen( SCH_SHEET* Sheet )
/* Find and install the screen on the sheet symbol Sheet. /* Find and install the screen on the sheet symbol Sheet.
* If Sheet == NULL installation of the screen base (Root). * If Sheet == NULL installation of the screen base (Root).
*/ */
static bool UpdateScreenFromSheet( WinEDA_SchematicFrame* frame ) static bool UpdateScreenFromSheet( SCH_EDIT_FRAME* frame )
{ {
SCH_SCREEN* NewScreen; SCH_SCREEN* NewScreen;
......
...@@ -256,8 +256,7 @@ struct Ki_HotkeyInfoSectionDescriptor s_Viewlib_Hokeys_Descr[] = ...@@ -256,8 +256,7 @@ struct Ki_HotkeyInfoSectionDescriptor s_Viewlib_Hokeys_Descr[] =
* Hot keys. Some commands are relative to the item under the mouse cursor * Hot keys. Some commands are relative to the item under the mouse cursor
* Commands are case insensitive * Commands are case insensitive
*/ */
void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, void SCH_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
EDA_BaseStruct* DrawStruct )
{ {
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
...@@ -346,7 +345,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -346,7 +345,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
RefreshToolBar = LocateAndDeleteItem( this, DC ); RefreshToolBar = LocateAndDeleteItem( this, DC );
OnModify(); OnModify();
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
} }
break; break;
...@@ -659,7 +658,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -659,7 +658,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
RefreshToolBar = TRUE; RefreshToolBar = TRUE;
} }
CmpRotationMiroir( (SCH_COMPONENT*) DrawStruct, DC, CMP_NORMAL ); CmpRotationMiroir( (SCH_COMPONENT*) DrawStruct, DC, CMP_NORMAL );
TestDanglingEnds( GetScreen()->EEDrawList, DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
} }
break; break;
...@@ -837,7 +836,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -837,7 +836,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
* under the mouse cursor * under the mouse cursor
* Commands are case insensitive * Commands are case insensitive
*/ */
void LIB_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ) void LIB_EDIT_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
{ {
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
wxCommandEvent toolCmd( wxEVT_COMMAND_TOOL_CLICKED ); wxCommandEvent toolCmd( wxEVT_COMMAND_TOOL_CLICKED );
......
...@@ -22,12 +22,12 @@ LIB_DRAW_ITEM::LIB_DRAW_ITEM( KICAD_T aType, ...@@ -22,12 +22,12 @@ LIB_DRAW_ITEM::LIB_DRAW_ITEM( KICAD_T aType,
int aUnit, int aUnit,
int aConvert, int aConvert,
FILL_T aFillType ) : FILL_T aFillType ) :
EDA_BaseStruct( aType ) EDA_ITEM( aType )
{ {
m_Unit = aUnit; m_Unit = aUnit;
m_Convert = aConvert; m_Convert = aConvert;
m_Fill = aFillType; m_Fill = aFillType;
m_Parent = (EDA_BaseStruct*) aComponent; m_Parent = (EDA_ITEM*) aComponent;
m_typeName = _( "Undefined" ); m_typeName = _( "Undefined" );
m_isFillable = false; m_isFillable = false;
m_eraseLastDrawItem = false; m_eraseLastDrawItem = false;
...@@ -35,7 +35,7 @@ LIB_DRAW_ITEM::LIB_DRAW_ITEM( KICAD_T aType, ...@@ -35,7 +35,7 @@ LIB_DRAW_ITEM::LIB_DRAW_ITEM( KICAD_T aType,
LIB_DRAW_ITEM::LIB_DRAW_ITEM( const LIB_DRAW_ITEM& aItem ) : LIB_DRAW_ITEM::LIB_DRAW_ITEM( const LIB_DRAW_ITEM& aItem ) :
EDA_BaseStruct( aItem ) EDA_ITEM( aItem )
{ {
m_Unit = aItem.m_Unit; m_Unit = aItem.m_Unit;
m_Convert = aItem.m_Convert; m_Convert = aItem.m_Convert;
......
...@@ -50,7 +50,7 @@ typedef std::vector< LIB_PIN* > LIB_PIN_LIST; ...@@ -50,7 +50,7 @@ typedef std::vector< LIB_PIN* > LIB_PIN_LIST;
* Base class for drawable items used in library components. * Base class for drawable items used in library components.
* (graphic shapes, texts, fields, pins) * (graphic shapes, texts, fields, pins)
*/ */
class LIB_DRAW_ITEM : public EDA_BaseStruct class LIB_DRAW_ITEM : public EDA_ITEM
{ {
/** /**
* Draws the item. * Draws the item.
...@@ -229,7 +229,7 @@ public: ...@@ -229,7 +229,7 @@ public:
*/ */
virtual EDA_Rect GetBoundingBox() virtual EDA_Rect GetBoundingBox()
{ {
return EDA_BaseStruct::GetBoundingBox(); return EDA_ITEM::GetBoundingBox();
} }
/** /**
......
...@@ -806,7 +806,7 @@ void LIB_PIN::drawGraphic( WinEDA_DrawPanel* aPanel, ...@@ -806,7 +806,7 @@ void LIB_PIN::drawGraphic( WinEDA_DrawPanel* aPanel,
{ {
// Invisible pins are only drawn on request. In libedit they are drawn // Invisible pins are only drawn on request. In libedit they are drawn
// in g_InvisibleItemColor because we must see them. // in g_InvisibleItemColor because we must see them.
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) wxGetApp().GetTopWindow();
if( m_attributes & PINNOTDRAW ) if( m_attributes & PINNOTDRAW )
{ {
......
...@@ -38,8 +38,7 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName ) ...@@ -38,8 +38,7 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName )
for( SCH_SCREEN* screen = ScreenList.GetFirst(); screen != NULL; for( SCH_SCREEN* screen = ScreenList.GetFirst(); screen != NULL;
screen = ScreenList.GetNext() ) screen = ScreenList.GetNext() )
{ {
for( SCH_ITEM* SchItem = screen->EEDrawList; SchItem; for( SCH_ITEM* SchItem = screen->GetDrawItems(); SchItem; SchItem = SchItem->Next() )
SchItem = SchItem->Next() )
{ {
if( SchItem->Type() != TYPE_SCH_COMPONENT ) if( SchItem->Type() != TYPE_SCH_COMPONENT )
continue; continue;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "class_libentry.h" #include "class_libentry.h"
void LIB_EDIT_FRAME::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int unused_flag ) void LIB_EDIT_FRAME::SaveCopyInUndoList( EDA_ITEM* ItemToCopy, int unused_flag )
{ {
LIB_COMPONENT* CopyItem; LIB_COMPONENT* CopyItem;
PICKED_ITEMS_LIST* lastcmd; PICKED_ITEMS_LIST* lastcmd;
......
...@@ -163,7 +163,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, WinEDA_DrawFrame ) ...@@ -163,7 +163,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, WinEDA_DrawFrame )
END_EVENT_TABLE() END_EVENT_TABLE()
LIB_EDIT_FRAME::LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent, LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
...@@ -247,7 +247,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent, ...@@ -247,7 +247,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent,
LIB_EDIT_FRAME::~LIB_EDIT_FRAME() LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
{ {
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) wxGetApp().GetTopWindow();
frame->m_LibeditFrame = NULL; frame->m_LibeditFrame = NULL;
m_drawItem = m_lastDrawItem = NULL; m_drawItem = m_lastDrawItem = NULL;
...@@ -958,7 +958,7 @@ void LIB_EDIT_FRAME::EnsureActiveLibExists() ...@@ -958,7 +958,7 @@ void LIB_EDIT_FRAME::EnsureActiveLibExists()
void LIB_EDIT_FRAME::SetLanguage( wxCommandEvent& event ) void LIB_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
{ {
WinEDA_BasicFrame::SetLanguage( event ); WinEDA_BasicFrame::SetLanguage( event );
WinEDA_SchematicFrame *parent = (WinEDA_SchematicFrame *)GetParent(); SCH_EDIT_FRAME *parent = (SCH_EDIT_FRAME *)GetParent();
parent->WinEDA_BasicFrame::SetLanguage( event ); parent->WinEDA_BasicFrame::SetLanguage( event );
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "lib_draw_item.h" #include "lib_draw_item.h"
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
class CMP_LIBRARY; class CMP_LIBRARY;
class LIB_COMPONENT; class LIB_COMPONENT;
class LIB_ALIAS; class LIB_ALIAS;
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
WinEDAChoiceBox* m_SelAliasBox; // a box to select the alias to edit (if any) WinEDAChoiceBox* m_SelAliasBox; // a box to select the alias to edit (if any)
public: public:
LIB_EDIT_FRAME( WinEDA_SchematicFrame* aParent, const wxString& title, LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct );
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ); void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
...@@ -223,7 +223,7 @@ private: ...@@ -223,7 +223,7 @@ private:
// General editing // General editing
public: public:
void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int flag_type_command = 0 ); void SaveCopyInUndoList( EDA_ITEM* ItemToCopy, int flag_type_command = 0 );
private: private:
void GetComponentFromUndoList( wxCommandEvent& event ); void GetComponentFromUndoList( wxCommandEvent& event );
......
...@@ -27,7 +27,7 @@ static void LoadLayers( LINE_READER* aLine ); ...@@ -27,7 +27,7 @@ static void LoadLayers( LINE_READER* aLine );
* Routine to load an EESchema file. * Routine to load an EESchema file.
* Returns true if file has been loaded (at least partially.) * Returns true if file has been loaded (at least partially.)
*/ */
bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& FullFileName ) bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* screen, const wxString& FullFileName )
{ {
char Name1[256]; char Name1[256];
bool itemLoaded = false; bool itemLoaded = false;
...@@ -188,8 +188,8 @@ again." ); ...@@ -188,8 +188,8 @@ again." );
} }
else else
{ {
item->SetNext( screen->EEDrawList ); item->SetNext( screen->GetDrawItems() );
screen->EEDrawList = item; screen->SetDrawItems( item );
} }
} }
...@@ -200,23 +200,24 @@ again." ); ...@@ -200,23 +200,24 @@ again." );
} }
} }
/* EEDrawList was constructed in reverse order - reverse it back: */ /* GetDrawItems() was constructed in reverse order - reverse it back: */
Phead = NULL; Phead = NULL;
while( screen->EEDrawList )
while( screen->GetDrawItems() )
{ {
Pnext = screen->EEDrawList; Pnext = screen->GetDrawItems();
screen->EEDrawList = screen->EEDrawList->Next(); screen->SetDrawItems( screen->GetDrawItems()->Next() );
Pnext->SetNext( Phead ); Pnext->SetNext( Phead );
Phead = Pnext; Phead = Pnext;
} }
screen->EEDrawList = Phead; screen->SetDrawItems( Phead );
#if 0 && defined (DEBUG) #if 0 && defined (DEBUG)
screen->Show( 0, std::cout ); screen->Show( 0, std::cout );
#endif #endif
TestDanglingEnds( screen->EEDrawList, NULL ); TestDanglingEnds( screen->GetDrawItems(), NULL );
MsgDiag = _( "Done Loading " ) + screen->m_FileName; MsgDiag = _( "Done Loading " ) + screen->m_FileName;
PrintMsg( MsgDiag ); PrintMsg( MsgDiag );
...@@ -257,7 +258,7 @@ static void LoadLayers( LINE_READER* aLine ) ...@@ -257,7 +258,7 @@ static void LoadLayers( LINE_READER* aLine )
/* Read the schematic header. */ /* Read the schematic header. */
bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ) bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* aScreen )
{ {
char Text[256], buf[1024]; char Text[256], buf[1024];
int ii; int ii;
...@@ -273,9 +274,11 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Windo ...@@ -273,9 +274,11 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Windo
sscanf( ((char*)(*aLine)), "%s %s %d %d", Text, Text, &PageSize.x, &PageSize.y ); sscanf( ((char*)(*aLine)), "%s %s %d %d", Text, Text, &PageSize.x, &PageSize.y );
wxString pagename = CONV_FROM_UTF8( Text ); wxString pagename = CONV_FROM_UTF8( Text );
for( ii = 0; SheetFormatList[ii] != NULL; ii++ ) for( ii = 0; SheetFormatList[ii] != NULL; ii++ )
{ {
wsheet = SheetFormatList[ii]; wsheet = SheetFormatList[ii];
if( wsheet->m_Name.CmpNoCase( pagename ) == 0 ) /* Descr found ! */ if( wsheet->m_Name.CmpNoCase( pagename ) == 0 ) /* Descr found ! */
{ {
// Get the user page size and make it the default // Get the user page size and make it the default
...@@ -283,6 +286,7 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Windo ...@@ -283,6 +286,7 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Windo
{ {
g_Sheet_user.m_Size = PageSize; g_Sheet_user.m_Size = PageSize;
} }
break; break;
} }
} }
...@@ -295,7 +299,7 @@ line %d, \aAbort reading file.\n" ), ...@@ -295,7 +299,7 @@ line %d, \aAbort reading file.\n" ),
aMsgDiag << CONV_FROM_UTF8( ((char*)(*aLine)) ); aMsgDiag << CONV_FROM_UTF8( ((char*)(*aLine)) );
} }
Window->m_CurrentSheetDesc = wsheet; aScreen->m_CurrentSheetDesc = wsheet;
for( ; ; ) for( ; ; )
{ {
...@@ -307,61 +311,61 @@ line %d, \aAbort reading file.\n" ), ...@@ -307,61 +311,61 @@ line %d, \aAbort reading file.\n" ),
if( strnicmp( ((char*)(*aLine)), "Sheet", 2 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Sheet", 2 ) == 0 )
sscanf( ((char*)(*aLine)) + 5, " %d %d", sscanf( ((char*)(*aLine)) + 5, " %d %d",
&Window->m_ScreenNumber, &Window->m_NumberOfScreen ); &aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreen );
if( strnicmp( ((char*)(*aLine)), "Title", 2 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Title", 2 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Title = CONV_FROM_UTF8( buf ); aScreen->m_Title = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Date", 2 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Date", 2 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Date = CONV_FROM_UTF8( buf ); aScreen->m_Date = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Rev", 2 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Rev", 2 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Revision = CONV_FROM_UTF8( buf ); aScreen->m_Revision = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Comp", 4 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Comp", 4 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Company = CONV_FROM_UTF8( buf ); aScreen->m_Company = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Comment1", 8 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Comment1", 8 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Commentaire1 = CONV_FROM_UTF8( buf ); aScreen->m_Commentaire1 = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Comment2", 8 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Comment2", 8 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Commentaire2 = CONV_FROM_UTF8( buf ); aScreen->m_Commentaire2 = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Comment3", 8 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Comment3", 8 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Commentaire3 = CONV_FROM_UTF8( buf ); aScreen->m_Commentaire3 = CONV_FROM_UTF8( buf );
continue; continue;
} }
if( strnicmp( ((char*)(*aLine)), "Comment4", 8 ) == 0 ) if( strnicmp( ((char*)(*aLine)), "Comment4", 8 ) == 0 )
{ {
ReadDelimitedText( buf, ((char*)(*aLine)), 256 ); ReadDelimitedText( buf, ((char*)(*aLine)), 256 );
Window->m_Commentaire4 = CONV_FROM_UTF8( buf ); aScreen->m_Commentaire4 = CONV_FROM_UTF8( buf );
continue; continue;
} }
} }
......
...@@ -40,31 +40,30 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ) ...@@ -40,31 +40,30 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
EDA_Rect BoundaryBox; EDA_Rect BoundaryBox;
float sizeref = 0, sizecurr; float sizeref = 0, sizecurr;
DrawList = Screen->EEDrawList; DrawList = Screen->GetDrawItems();
while( DrawList ) while( DrawList )
{ {
if( ( SnapPoint2( Screen->m_MousePosition, LIBITEM, if( !SnapPoint2( Screen->m_MousePosition, LIBITEM, DrawList, Screen->GetZoom() ) )
DrawList, Screen->GetZoom() ) ) == FALSE )
{ {
if( ( SnapPoint2( Screen->m_Curseur, LIBITEM, if( !SnapPoint2( Screen->m_Curseur, LIBITEM, DrawList, Screen->GetScalingFactor() ) )
DrawList, Screen->GetScalingFactor() ) ) == FALSE )
break; break;
} }
component = (SCH_COMPONENT*) LastSnappedStruct; component = (SCH_COMPONENT*) LastSnappedStruct;
DrawList = component->Next(); DrawList = component->Next();
if( lastcomponent == NULL ) // First time a component is located if( lastcomponent == NULL ) // First time a component is located
{ {
lastcomponent = component; lastcomponent = component;
BoundaryBox = lastcomponent->GetBoundaryBox(); BoundaryBox = lastcomponent->GetBoundaryBox();
sizeref = ABS( (float) BoundaryBox.GetWidth() * sizeref = ABS( (float) BoundaryBox.GetWidth() * BoundaryBox.GetHeight() );
BoundaryBox.GetHeight() );
} }
else else
{ {
BoundaryBox = component->GetBoundaryBox(); BoundaryBox = component->GetBoundaryBox();
sizecurr = ABS( (float) BoundaryBox.GetWidth() * sizecurr = ABS( (float) BoundaryBox.GetWidth() * BoundaryBox.GetHeight() );
BoundaryBox.GetHeight() );
if( sizeref > sizecurr ) // a smallest component is found if( sizeref > sizecurr ) // a smallest component is found
{ {
sizeref = sizecurr; sizeref = sizecurr;
...@@ -104,21 +103,16 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ) ...@@ -104,21 +103,16 @@ SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
* pointer on item found or NULL * pointer on item found or NULL
* *
*/ */
SCH_ITEM* PickStruct( const wxPoint& refpos, SCH_ITEM* PickStruct( const wxPoint& refpos, SCH_SCREEN* screen, int SearchMask )
BASE_SCREEN* screen,
int SearchMask )
{ {
bool Snapped; if( screen == NULL || screen->GetDrawItems() == NULL )
if( screen == NULL || screen->EEDrawList == NULL )
return NULL; return NULL;
if( ( Snapped = SnapPoint2( refpos, SearchMask, if( SnapPoint2( refpos, SearchMask, screen->GetDrawItems(), screen->GetScalingFactor() ) )
screen->EEDrawList,
screen->GetScalingFactor() ) ) != FALSE )
{ {
return LastSnappedStruct; return LastSnappedStruct;
} }
return NULL; return NULL;
} }
...@@ -130,7 +124,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, ...@@ -130,7 +124,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos,
* @param aBlock a BLOCK_SELECTOR that gives the search area boundary * @param aBlock a BLOCK_SELECTOR that gives the search area boundary
* list of items is stored in aBlock * list of items is stored in aBlock
*/ */
int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* aScreen ) int PickItemsInBlock( BLOCK_SELECTOR& aBlock, SCH_SCREEN* aScreen )
{ {
int itemcount = 0; int itemcount = 0;
...@@ -144,7 +138,8 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* aScreen ) ...@@ -144,7 +138,8 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* aScreen )
area.Normalize(); area.Normalize();
ITEM_PICKER picker; ITEM_PICKER picker;
SCH_ITEM* DrawStruct = aScreen->EEDrawList; SCH_ITEM* DrawStruct = aScreen->GetDrawItems();
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
{ {
if( IsItemInBox( area, DrawStruct ) ) if( IsItemInBox( area, DrawStruct ) )
...@@ -169,12 +164,12 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* aScreen ) ...@@ -169,12 +164,12 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* aScreen )
* a point. This variable is global to this module only (see above). * * a point. This variable is global to this module only (see above). *
* The routine returns true if point was snapped. * * The routine returns true if point was snapped. *
*****************************************************************************/ *****************************************************************************/
bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, bool SnapPoint2( const wxPoint& aPosRef, int SearchMask, SCH_ITEM* DrawList, double aScaleFactor )
SCH_ITEM* DrawList, double aScaleFactor )
{ {
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
{ {
int hitminDist = MAX( g_DrawDefaultLineThickness, 3 ); int hitminDist = MAX( g_DrawDefaultLineThickness, 3 );
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
...@@ -476,11 +471,11 @@ LIB_PIN* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, SCH_COMPONENT* ...@@ -476,11 +471,11 @@ LIB_PIN* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, SCH_COMPONENT*
SCH_COMPONENT* schItem = NULL; SCH_COMPONENT* schItem = NULL;
LIB_PIN* Pin = NULL; LIB_PIN* Pin = NULL;
for( DrawStruct = DrawList; DrawStruct != NULL; for( DrawStruct = DrawList; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
DrawStruct = DrawStruct->Next() )
{ {
if( DrawStruct->Type() != TYPE_SCH_COMPONENT ) if( DrawStruct->Type() != TYPE_SCH_COMPONENT )
continue; continue;
schItem = (SCH_COMPONENT*) DrawStruct; schItem = (SCH_COMPONENT*) DrawStruct;
Entry = CMP_LIBRARY::FindLibraryComponent( schItem->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( schItem->m_ChipName );
...@@ -503,6 +498,7 @@ LIB_PIN* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, SCH_COMPONENT* ...@@ -503,6 +498,7 @@ LIB_PIN* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos, SCH_COMPONENT*
if( libpart ) if( libpart )
*libpart = schItem; *libpart = schItem;
return Pin; return Pin;
} }
...@@ -512,13 +508,13 @@ SCH_SHEET_PIN* LocateAnyPinSheet( const wxPoint& RefPos, SCH_ITEM* DrawList ) ...@@ -512,13 +508,13 @@ SCH_SHEET_PIN* LocateAnyPinSheet( const wxPoint& RefPos, SCH_ITEM* DrawList )
SCH_ITEM* DrawStruct; SCH_ITEM* DrawStruct;
SCH_SHEET_PIN* PinSheet = NULL; SCH_SHEET_PIN* PinSheet = NULL;
for( DrawStruct = DrawList; DrawStruct != NULL; for( DrawStruct = DrawList; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
DrawStruct = DrawStruct->Next() )
{ {
if( DrawStruct->Type() != DRAW_SHEET_STRUCT_TYPE ) if( DrawStruct->Type() != DRAW_SHEET_STRUCT_TYPE )
continue; continue;
PinSheet = LocateSheetLabel( (SCH_SHEET*) DrawStruct, RefPos ); PinSheet = LocateSheetLabel( (SCH_SHEET*) DrawStruct, RefPos );
if( PinSheet ) if( PinSheet )
break; break;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* @brief Create or update the menubar for the schematic frame * @brief Create or update the menubar for the schematic frame
*/ */
void WinEDA_SchematicFrame::ReCreateMenuBar() void SCH_EDIT_FRAME::ReCreateMenuBar()
{ {
wxString text; wxString text;
wxMenuItem* item; wxMenuItem* item;
......
...@@ -137,9 +137,9 @@ class EXPORT_HELP ...@@ -137,9 +137,9 @@ class EXPORT_HELP
* A suitable component is a "new" real component (power symbols are not * A suitable component is a "new" real component (power symbols are not
* considered). * considered).
*/ */
SCH_COMPONENT* findNextComponentAndCreatPinList( EDA_BaseStruct* aItem, SCH_SHEET_PATH* aSheetPath ); SCH_COMPONENT* findNextComponentAndCreatPinList( EDA_ITEM* aItem, SCH_SHEET_PATH* aSheetPath );
SCH_COMPONENT* findNextComponent( EDA_BaseStruct* aItem, SCH_SHEET_PATH* aSheetPath ); SCH_COMPONENT* findNextComponent( EDA_ITEM* aItem, SCH_SHEET_PATH* aSheetPath );
/** /**
* Function eraseDuplicatePins * Function eraseDuplicatePins
...@@ -242,7 +242,7 @@ public: ...@@ -242,7 +242,7 @@ public:
* creates a generic netlist, now in XML. * creates a generic netlist, now in XML.
* @return bool - true if there were no errors, else false. * @return bool - true if there were no errors, else false.
*/ */
bool WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxString& aOutFileName ); bool WriteGENERICNetList( SCH_EDIT_FRAME* frame, const wxString& aOutFileName );
/** /**
* Function WriteNetListPCBNEW * Function WriteNetListPCBNEW
...@@ -251,8 +251,7 @@ public: ...@@ -251,8 +251,7 @@ public:
* @param with_pcbnew if true, then format Pcbnew (OrcadPcb2 + reviews and lists of net),<p> * @param with_pcbnew if true, then format Pcbnew (OrcadPcb2 + reviews and lists of net),<p>
* else output ORCADPCB2 strict format. * else output ORCADPCB2 strict format.
*/ */
bool WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool WriteNetListPCBNEW( SCH_EDIT_FRAME* frame, FILE* f, bool with_pcbnew );
bool with_pcbnew );
/** /**
* Function WriteNetListCADSTAR * Function WriteNetListCADSTAR
...@@ -282,7 +281,7 @@ public: ...@@ -282,7 +281,7 @@ public:
* .. B * T3 1 * .. B * T3 1
*U1 * 14 *U1 * 14
*/ */
void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f ); void WriteNetListCADSTAR( SCH_EDIT_FRAME* frame, FILE* f );
/** /**
* Function WriteNetListPspice * Function WriteNetListPspice
...@@ -295,8 +294,7 @@ public: ...@@ -295,8 +294,7 @@ public:
* @param use_netnames if true, then nodes are identified by the netname, * @param use_netnames if true, then nodes are identified by the netname,
* else by net number. * else by net number.
*/ */
bool WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool WriteNetListPspice( SCH_EDIT_FRAME* frame, FILE* f, bool use_netnames );
bool use_netnames );
/** /**
* Function MakeCommandLine * Function MakeCommandLine
...@@ -357,8 +355,8 @@ wxString EXPORT_HELP::MakeCommandLine( const wxString& aFormatString, ...@@ -357,8 +355,8 @@ wxString EXPORT_HELP::MakeCommandLine( const wxString& aFormatString,
* bool aUse_netnames is used only for Spice netlist * bool aUse_netnames is used only for Spice netlist
* @return true if success. * @return true if success.
*/ */
bool WinEDA_SchematicFrame::WriteNetListFile( int aFormat, const wxString& aFullFileName, bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileName,
bool aUse_netnames ) bool aUse_netnames )
{ {
bool ret = true; bool ret = true;
FILE* f = NULL; FILE* f = NULL;
...@@ -489,7 +487,7 @@ void EXPORT_HELP::sprintPinNetName( wxString* aResult, ...@@ -489,7 +487,7 @@ void EXPORT_HELP::sprintPinNetName( wxString* aResult,
} }
SCH_COMPONENT* EXPORT_HELP::findNextComponent( EDA_BaseStruct* aItem, SCH_SHEET_PATH* aSheetPath ) SCH_COMPONENT* EXPORT_HELP::findNextComponent( EDA_ITEM* aItem, SCH_SHEET_PATH* aSheetPath )
{ {
wxString ref; wxString ref;
...@@ -536,8 +534,8 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponent( EDA_BaseStruct* aItem, SCH_SHEET_ ...@@ -536,8 +534,8 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponent( EDA_BaseStruct* aItem, SCH_SHEET_
} }
SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aItem,
EDA_BaseStruct* aItem, SCH_SHEET_PATH* aSheetPath ) SCH_SHEET_PATH* aSheetPath )
{ {
wxString ref; wxString ref;
...@@ -555,6 +553,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( ...@@ -555,6 +553,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList(
// Power symbols and other components which have the reference starting // Power symbols and other components which have the reference starting
// with "#" are not included in netlist (pseudo or virtual components) // with "#" are not included in netlist (pseudo or virtual components)
ref = comp->GetRef( aSheetPath ); ref = comp->GetRef( aSheetPath );
if( ref[0] == wxChar( '#' ) ) if( ref[0] == wxChar( '#' ) )
continue; continue;
...@@ -565,6 +564,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( ...@@ -565,6 +564,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList(
// toggled. // toggled.
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
if( !entry ) if( !entry )
continue; continue;
...@@ -942,7 +942,7 @@ XNODE* EXPORT_HELP::makeGenericComponents() ...@@ -942,7 +942,7 @@ XNODE* EXPORT_HELP::makeGenericComponents()
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() ) for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() ) for( EDA_ITEM* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() )
{ {
SCH_COMPONENT* comp = findNextComponentAndCreatPinList( schItem, path ); SCH_COMPONENT* comp = findNextComponentAndCreatPinList( schItem, path );
if( !comp ) if( !comp )
...@@ -1036,7 +1036,7 @@ XNODE* EXPORT_HELP::makeGenericComponents() ...@@ -1036,7 +1036,7 @@ XNODE* EXPORT_HELP::makeGenericComponents()
#include <wx/wfstream.h> // wxFFileOutputStream #include <wx/wfstream.h> // wxFFileOutputStream
bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxString& aOutFileName ) bool EXPORT_HELP::WriteGENERICNetList( SCH_EDIT_FRAME* frame, const wxString& aOutFileName )
{ {
#if 0 #if 0
...@@ -1106,7 +1106,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr ...@@ -1106,7 +1106,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() ) for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() ) for( EDA_ITEM* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() )
{ {
SCH_COMPONENT* comp = findNextComponentAndCreatPinList( schItem, path ); SCH_COMPONENT* comp = findNextComponentAndCreatPinList( schItem, path );
if( !comp ) if( !comp )
...@@ -1174,7 +1174,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr ...@@ -1174,7 +1174,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr
} }
bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_netnames ) bool EXPORT_HELP::WriteNetListPspice( SCH_EDIT_FRAME* frame, FILE* f, bool use_netnames )
{ {
int ret = 0; int ret = 0;
char Line[1024]; char Line[1024];
...@@ -1190,8 +1190,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo ...@@ -1190,8 +1190,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo
DateAndTime( Line ); DateAndTime( Line );
ret |= fprintf( f, "* %s (Spice format) creation date: %s\n\n", ret |= fprintf( f, "* %s (Spice format) creation date: %s\n\n", NETLIST_HEAD_STRING, Line );
NETLIST_HEAD_STRING, Line );
// Create text list starting by [.-]pspice , or [.-]gnucap (simulator // Create text list starting by [.-]pspice , or [.-]gnucap (simulator
// commands) and create text list starting by [+]pspice , or [+]gnucap // commands) and create text list starting by [+]pspice , or [+]gnucap
...@@ -1201,7 +1200,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo ...@@ -1201,7 +1200,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() ) for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* item = sheet->LastDrawList(); item; item = item->Next() ) for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
{ {
wxChar ident; wxChar ident;
if( item->Type() != TYPE_SCH_TEXT ) if( item->Type() != TYPE_SCH_TEXT )
...@@ -1265,7 +1264,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo ...@@ -1265,7 +1264,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() ) for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* item = sheet->LastDrawList(); item; item = item->Next() ) for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
{ {
SCH_COMPONENT* comp = findNextComponentAndCreatPinList( item, sheet ); SCH_COMPONENT* comp = findNextComponentAndCreatPinList( item, sheet );
if( !comp ) if( !comp )
...@@ -1328,7 +1327,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo ...@@ -1328,7 +1327,7 @@ bool EXPORT_HELP::WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, boo
} }
bool EXPORT_HELP::WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with_pcbnew ) bool EXPORT_HELP::WriteNetListPCBNEW( SCH_EDIT_FRAME* frame, FILE* f, bool with_pcbnew )
{ {
wxString field; wxString field;
wxString footprint; wxString footprint;
...@@ -1353,7 +1352,7 @@ bool EXPORT_HELP::WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, boo ...@@ -1353,7 +1352,7 @@ bool EXPORT_HELP::WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, boo
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() ) for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* item = path->LastDrawList(); item; item = item->Next() ) for( EDA_ITEM* item = path->LastDrawList(); item; item = item->Next() )
{ {
SCH_COMPONENT* comp = findNextComponentAndCreatPinList( item, path ); SCH_COMPONENT* comp = findNextComponentAndCreatPinList( item, path );
if( !comp ) if( !comp )
...@@ -1569,7 +1568,7 @@ void EXPORT_HELP::findAllInstancesOfComponent( SCH_COMPONENT* aComponent, ...@@ -1569,7 +1568,7 @@ void EXPORT_HELP::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() ) for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
{ {
for( EDA_BaseStruct* item = sheet->LastDrawList(); item; item = item->Next() ) for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
{ {
if( item->Type() != TYPE_SCH_COMPONENT ) if( item->Type() != TYPE_SCH_COMPONENT )
continue; continue;
...@@ -1690,14 +1689,14 @@ bool EXPORT_HELP::writeGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjects ...@@ -1690,14 +1689,14 @@ bool EXPORT_HELP::writeGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjects
static wxString StartLine( wxT( "." ) ); static wxString StartLine( wxT( "." ) );
void EXPORT_HELP::WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f ) void EXPORT_HELP::WriteNetListCADSTAR( SCH_EDIT_FRAME* frame, FILE* f )
{ {
wxString StartCmpDesc = StartLine + wxT( "ADD_COM" ); wxString StartCmpDesc = StartLine + wxT( "ADD_COM" );
wxString msg; wxString msg;
wxString footprint; wxString footprint;
char Line[1024]; char Line[1024];
SCH_SHEET_PATH* sheet; SCH_SHEET_PATH* sheet;
EDA_BaseStruct* DrawList; EDA_ITEM* DrawList;
SCH_COMPONENT* Component; SCH_COMPONENT* Component;
wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion(); wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
......
...@@ -82,7 +82,7 @@ void FreeNetObjectsList( NETLIST_OBJECT_LIST& aNetObjectsBuffer ) ...@@ -82,7 +82,7 @@ void FreeNetObjectsList( NETLIST_OBJECT_LIST& aNetObjectsBuffer )
* Updates: * Updates:
* g_NetObjectslist * g_NetObjectslist
*/ */
void WinEDA_SchematicFrame::BuildNetListBase() void SCH_EDIT_FRAME::BuildNetListBase()
{ {
int NetNumber; int NetNumber;
int NetCode; int NetCode;
...@@ -509,7 +509,7 @@ static void AddConnectedObjects( SCH_SHEET_PATH* sheetlist, ...@@ -509,7 +509,7 @@ static void AddConnectedObjects( SCH_SHEET_PATH* sheetlist,
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
SCH_SHEET_PATH list; SCH_SHEET_PATH list;
DrawList = sheetlist->LastScreen()->EEDrawList; DrawList = sheetlist->LastScreen()->GetDrawItems();
for( ; DrawList; DrawList = DrawList->Next() ) for( ; DrawList; DrawList = DrawList->Next() )
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
......
...@@ -173,7 +173,7 @@ EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent, ...@@ -173,7 +173,7 @@ EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent,
/*************************************************************************************/ /*************************************************************************************/
WinEDA_NetlistFrame::WinEDA_NetlistFrame( WinEDA_SchematicFrame* parent ) : WinEDA_NetlistFrame::WinEDA_NetlistFrame( SCH_EDIT_FRAME* parent ) :
wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition, wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition,
wxDefaultSize, DIALOG_STYLE | MAYBE_RESIZE_BORDER ) wxDefaultSize, DIALOG_STYLE | MAYBE_RESIZE_BORDER )
/*************************************************************************************/ /*************************************************************************************/
...@@ -525,8 +525,8 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event ) ...@@ -525,8 +525,8 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
* bool aUse_netnames is used only for Spice netlist * bool aUse_netnames is used only for Spice netlist
* @return true if success. * @return true if success.
*/ */
bool WinEDA_SchematicFrame::CreateNetlist( int aFormat, const wxString& aFullFileName, bool SCH_EDIT_FRAME::CreateNetlist( int aFormat, const wxString& aFullFileName,
bool aUse_netnames ) bool aUse_netnames )
{ {
ReAnnotatePowerSymbolsOnly(); ReAnnotatePowerSymbolsOnly();
......
...@@ -61,16 +61,15 @@ public: ...@@ -61,16 +61,15 @@ public:
class WinEDA_NetlistFrame : public wxDialog class WinEDA_NetlistFrame : public wxDialog
{ {
public: public:
WinEDA_SchematicFrame* m_Parent; SCH_EDIT_FRAME* m_Parent;
wxNotebook* m_NoteBook; wxNotebook* m_NoteBook;
EDA_NoteBookPage* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX]; EDA_NoteBookPage* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX];
wxRadioBox* m_UseNetNamesInNetlist;
wxRadioBox* m_UseNetNamesInNetlist;
public: public:
// Constructor and destructor // Constructor and destructor
WinEDA_NetlistFrame( WinEDA_SchematicFrame* parent ); WinEDA_NetlistFrame( SCH_EDIT_FRAME* parent );
~WinEDA_NetlistFrame() { }; ~WinEDA_NetlistFrame() { };
private: private:
......
...@@ -26,7 +26,7 @@ static wxArrayString s_PowerNameList; ...@@ -26,7 +26,7 @@ static wxArrayString s_PowerNameList;
/* Process the command triggers by the left button of the mouse when a tool /* Process the command triggers by the left button of the mouse when a tool
* is already selected. * is already selected.
*/ */
void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void SCH_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
SCH_ITEM* DrawStruct = GetScreen()->GetCurItem(); SCH_ITEM* DrawStruct = GetScreen()->GetCurItem();
...@@ -51,7 +51,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -51,7 +51,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
return; return;
...@@ -67,7 +67,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -67,7 +67,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
default: default:
{ {
wxString msg; wxString msg;
msg.Printf(wxT( "WinEDA_SchematicFrame::OnLeftClick err: m_Flags != 0, itmetype %d" ), msg.Printf( wxT( "SCH_EDIT_FRAME::OnLeftClick err: m_Flags != 0, itmetype %d" ),
DrawStruct->Type()); DrawStruct->Type());
DisplayError( this, msg ); DisplayError( this, msg );
DrawStruct->m_Flags = 0; DrawStruct->m_Flags = 0;
...@@ -113,7 +113,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -113,7 +113,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
} }
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
...@@ -131,7 +131,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -131,7 +131,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
} }
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
...@@ -150,7 +150,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -150,7 +150,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
} }
...@@ -160,7 +160,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -160,7 +160,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
LocateAndDeleteItem( this, DC ); LocateAndDeleteItem( this, DC );
OnModify( ); OnModify( );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
...@@ -202,7 +202,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -202,7 +202,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
break; break;
...@@ -221,7 +221,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -221,7 +221,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
break; break;
...@@ -236,7 +236,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -236,7 +236,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
break; break;
...@@ -263,7 +263,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -263,7 +263,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
&& (DrawStruct->m_Flags != 0) ) && (DrawStruct->m_Flags != 0) )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
break; break;
...@@ -279,7 +279,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -279,7 +279,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
break; break;
...@@ -295,7 +295,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -295,7 +295,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
DrawPanel->m_AutoPAN_Request = FALSE; DrawPanel->m_AutoPAN_Request = FALSE;
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
break; break;
...@@ -303,7 +303,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -303,7 +303,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
default: default:
{ {
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
wxString msg( wxT( "WinEDA_SchematicFrame::OnLeftClick error state " ) ); wxString msg( wxT( "SCH_EDIT_FRAME::OnLeftClick error state " ) );
msg << m_ID_current_state; msg << m_ID_current_state;
DisplayError( this, msg ); DisplayError( this, msg );
...@@ -321,11 +321,11 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -321,11 +321,11 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
* Id a create command is in progress: * Id a create command is in progress:
* validate and finish the command * validate and finish the command
*/ */
void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void SCH_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
{ {
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); EDA_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxPoint pos = GetPosition(); wxPoint pos = GetPosition();
switch( m_ID_current_state ) switch( m_ID_current_state )
{ {
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
using namespace std; using namespace std;
static void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame ); static void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame );
static void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, WinEDA_SchematicFrame* frame ); static void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame );
static void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, WinEDA_SchematicFrame* frame ); static void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame );
static void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet ); static void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet );
static void AddMenusForPinSheet( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet ); static void AddMenusForPinSheet( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet );
static void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text ); static void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text );
...@@ -37,17 +37,15 @@ static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel ); ...@@ -37,17 +37,15 @@ static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel );
static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel ); static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel );
static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ); static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field ); static void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field );
static void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, static void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, SCH_EDIT_FRAME* frame );
WinEDA_SchematicFrame* frame ); static void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, SCH_EDIT_FRAME* aFrame );
static void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker,
WinEDA_SchematicFrame* aFrame );
/* Prepare context menu when a click on the right mouse button occurs. /* Prepare context menu when a click on the right mouse button occurs.
* *
* This menu is then added to the list of zoom commands. * This menu is then added to the list of zoom commands.
*/ */
bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
{ {
SCH_ITEM* DrawStruct = (SCH_ITEM*) GetScreen()->GetCurItem(); SCH_ITEM* DrawStruct = (SCH_ITEM*) GetScreen()->GetCurItem();
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
...@@ -214,8 +212,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMe ...@@ -214,8 +212,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMe
default: default:
wxString msg; wxString msg;
msg.Printf( wxT( "WinEDA_SchematicFrame::OnRightClick Error: unknown DrawType %d" ), msg.Printf( wxT( "SCH_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
DrawStruct->Type() ); DrawStruct->Type() );
DisplayError( this, msg ); DisplayError( this, msg );
break; break;
} }
...@@ -483,7 +481,7 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text ) ...@@ -483,7 +481,7 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
} }
void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, WinEDA_SchematicFrame* frame ) void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, SCH_EDIT_FRAME* frame )
{ {
bool is_new = (Junction->m_Flags & IS_NEW) ? TRUE : FALSE; bool is_new = (Junction->m_Flags & IS_NEW) ? TRUE : FALSE;
wxString msg; wxString msg;
...@@ -507,7 +505,7 @@ void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, WinEDA_Schema ...@@ -507,7 +505,7 @@ void AddMenusForJunction( wxMenu* PopMenu, SCH_JUNCTION* Junction, WinEDA_Schema
} }
void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, WinEDA_SchematicFrame* frame ) void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
{ {
bool is_new = (Wire->m_Flags & IS_NEW) ? TRUE : FALSE; bool is_new = (Wire->m_Flags & IS_NEW) ? TRUE : FALSE;
wxPoint pos = frame->GetScreen()->m_Curseur; wxPoint pos = frame->GetScreen()->m_Curseur;
...@@ -545,7 +543,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, WinEDA_SchematicFrame* fr ...@@ -545,7 +543,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, WinEDA_SchematicFrame* fr
} }
void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, WinEDA_SchematicFrame* frame ) void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
{ {
bool is_new = (Bus->m_Flags & IS_NEW) ? TRUE : FALSE; bool is_new = (Bus->m_Flags & IS_NEW) ? TRUE : FALSE;
wxPoint pos = frame->GetScreen()->m_Curseur; wxPoint pos = frame->GetScreen()->m_Curseur;
...@@ -632,7 +630,7 @@ void AddMenusForPinSheet( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet ) ...@@ -632,7 +630,7 @@ void AddMenusForPinSheet( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet )
} }
void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame ) void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
{ {
wxString msg; wxString msg;
...@@ -669,7 +667,7 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame ) ...@@ -669,7 +667,7 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame )
} }
void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, WinEDA_SchematicFrame* aFrame ) void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, SCH_EDIT_FRAME* aFrame )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm ); ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
......
...@@ -81,22 +81,22 @@ void MoveItemsInList( PICKED_ITEMS_LIST& aItemsList, const wxPoint aMoveVector ) ...@@ -81,22 +81,22 @@ void MoveItemsInList( PICKED_ITEMS_LIST& aItemsList, const wxPoint aMoveVector )
*/ */
void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList ) void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList )
{ {
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen(); SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->GetParent(); SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) panel->GetParent();
PICKED_ITEMS_LIST itemsList; PICKED_ITEMS_LIST itemsList;
ITEM_PICKER itemWrapper; ITEM_PICKER itemWrapper;
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ ) for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
{ {
SCH_ITEM* item = (SCH_ITEM*) aItemsList.GetPickedItem( ii ); SCH_ITEM* item = (SCH_ITEM*) aItemsList.GetPickedItem( ii );
itemWrapper.m_PickedItem = item; itemWrapper.m_PickedItem = item;
itemWrapper.m_UndoRedoStatus = UR_DELETED; itemWrapper.m_UndoRedoStatus = UR_DELETED;
if( item->Type() == DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE ) if( item->Type() == DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE )
{ {
/* this item is depending on a sheet, and is not in global list */ /* this item is depending on a sheet, and is not in global list */
wxMessageBox( wxT( wxMessageBox( wxT("DeleteItemsInList() err: unexpected \
"DeleteItemsInList() err: unexpected \ DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE" ) );
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE" ) );
} }
else else
{ {
...@@ -118,8 +118,8 @@ DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE" ...@@ -118,8 +118,8 @@ DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE"
*/ */
void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct ) void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct )
{ {
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen(); SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->GetParent(); SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) panel->GetParent();
if( !DrawStruct ) if( !DrawStruct )
return; return;
...@@ -128,11 +128,9 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct ) ...@@ -128,11 +128,9 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct )
{ {
/* This structure is attached to a node, and is not accessible by /* This structure is attached to a node, and is not accessible by
* the global list directly. */ * the global list directly. */
frame->SaveCopyInUndoList( frame->SaveCopyInUndoList( (SCH_ITEM*)( (SCH_SHEET_PIN*) DrawStruct )->GetParent(),
(SCH_ITEM*)( (SCH_SHEET_PIN*) DrawStruct )->GetParent(), UR_CHANGED );
UR_CHANGED ); frame->DeleteSheetLabel( DC ? true : false, (SCH_SHEET_PIN*) DrawStruct );
frame->DeleteSheetLabel( DC ? true : false,
(SCH_SHEET_PIN*) DrawStruct );
return; return;
} }
else else
...@@ -199,8 +197,8 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList, ...@@ -199,8 +197,8 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
} }
SetaParent( newitem, screen ); SetaParent( newitem, screen );
newitem->SetNext( screen->EEDrawList ); newitem->SetNext( screen->GetDrawItems() );
screen->EEDrawList = newitem; screen->SetDrawItems( newitem );
} }
} }
......
...@@ -9,16 +9,15 @@ ...@@ -9,16 +9,15 @@
#include <wx/wx.h> #include <wx/wx.h>
class EDA_BaseStruct; class EDA_ITEM;
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
class WinEDA_DrawFrame; class WinEDA_DrawFrame;
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
class LIB_EDIT_FRAME; class LIB_EDIT_FRAME;
class CMP_LIBRARY; class CMP_LIBRARY;
class LIB_COMPONENT; class LIB_COMPONENT;
class LIB_DRAW_ITEM; class LIB_DRAW_ITEM;
class SCH_COMPONENT; class SCH_COMPONENT;
class BASE_SCREEN;
class SCH_SCREEN; class SCH_SCREEN;
class SCH_ITEM; class SCH_ITEM;
class SCH_SHEET_PIN; class SCH_SHEET_PIN;
...@@ -51,7 +50,7 @@ void IncrementLabelMember( wxString& name ); ...@@ -51,7 +50,7 @@ void IncrementLabelMember( wxString& name );
/****************/ /****************/
/* EDITPART.CPP */ /* EDITPART.CPP */
/****************/ /****************/
void InstallCmpeditFrame( WinEDA_SchematicFrame* 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,
...@@ -118,7 +117,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* DrawStruct, bool aClone = false ); ...@@ -118,7 +117,7 @@ SCH_ITEM* DuplicateStruct( SCH_ITEM* DrawStruct, bool aClone = false );
SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ); SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen );
/* Find the item within block selection. */ /* Find the item within block selection. */
int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* screen ); int PickItemsInBlock( BLOCK_SELECTOR& aBlock, SCH_SCREEN* screen );
/* function PickStruct: /* function PickStruct:
* Search at location pos * Search at location pos
...@@ -150,7 +149,7 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* screen ); ...@@ -150,7 +149,7 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, BASE_SCREEN* screen );
* Pointer to the structure if only 1 item is selected. * Pointer to the structure if only 1 item is selected.
* NULL if no items are selects. * NULL if no items are selects.
*/ */
SCH_ITEM* PickStruct( const wxPoint& refpos, BASE_SCREEN* screen, int SearchMask ); SCH_ITEM* PickStruct( const wxPoint& refpos, SCH_SCREEN* screen, int SearchMask );
SCH_SHEET_PIN* LocateSheetLabel( SCH_SHEET* Sheet, const wxPoint& pos ); SCH_SHEET_PIN* LocateSheetLabel( SCH_SHEET* Sheet, const wxPoint& pos );
...@@ -212,7 +211,7 @@ void PlotDrawlist( PLOTTER* plotter, SCH_ITEM* drawlist ); ...@@ -212,7 +211,7 @@ void PlotDrawlist( PLOTTER* plotter, SCH_ITEM* drawlist );
void DeleteSubHierarchy( SCH_SHEET* Sheet, bool confirm_deletion ); void DeleteSubHierarchy( SCH_SHEET* Sheet, bool confirm_deletion );
bool ClearProjectDrawList( SCH_SCREEN* FirstWindow, bool confirm_deletion ); bool ClearProjectDrawList( SCH_SCREEN* FirstWindow, bool confirm_deletion );
/* free the draw list screen->EEDrawList and the subhierarchies /* free the draw list screen->GetDrawItems() and the subhierarchies
* clear the screen datas (filenames ..) * clear the screen datas (filenames ..)
*/ */
...@@ -220,7 +219,7 @@ bool ClearProjectDrawList( SCH_SCREEN* FirstWindow, bool confirm_deletion ); ...@@ -220,7 +219,7 @@ bool ClearProjectDrawList( SCH_SCREEN* FirstWindow, bool confirm_deletion );
/* DELETE.CPP */ /* DELETE.CPP */
/*************/ /*************/
bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC ); bool LocateAndDeleteItem( SCH_EDIT_FRAME* frame, wxDC* DC );
void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Window ); void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Window );
void DeleteAllMarkers( int type ); void DeleteAllMarkers( int type );
...@@ -301,12 +300,12 @@ void BreakSegment(SCH_SCREEN * aScreen, wxPoint aBreakpoint ); ...@@ -301,12 +300,12 @@ void BreakSegment(SCH_SCREEN * aScreen, wxPoint aBreakpoint );
/* EECLASS.CPP */ /* EECLASS.CPP */
/**************/ /**************/
void SetaParent( EDA_BaseStruct* Struct, BASE_SCREEN* Screen ); void SetaParent( SCH_ITEM* Struct, SCH_SCREEN* Screen );
/***************/ /***************/
/* OPTIONS.CPP */ /* OPTIONS.CPP */
/***************/ /***************/
void DisplayOptionFrame( WinEDA_SchematicFrame* parent, const wxPoint& framepos ); void DisplayOptionFrame( SCH_EDIT_FRAME* parent, const wxPoint& framepos );
/****************/ /****************/
/* CONTROLE.CPP */ /* CONTROLE.CPP */
......
...@@ -635,7 +635,7 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem ) ...@@ -635,7 +635,7 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
} }
void SCH_COMPONENT::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_COMPONENT::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
/* save old text in undo list */ /* save old text in undo list */
if( g_ItemToUndoCopy if( g_ItemToUndoCopy
...@@ -1458,8 +1458,7 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -1458,8 +1458,7 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame )
frame->ClearMsgPanel(); frame->ClearMsgPanel();
frame->AppendMsgPanel( _( "Reference" ), frame->AppendMsgPanel( _( "Reference" ), GetRef( ( (SCH_EDIT_FRAME*) frame )->GetSheet() ),
GetRef( ( (WinEDA_SchematicFrame*) frame )->GetSheet() ),
DARKCYAN ); DARKCYAN );
if( root_component->IsPower() ) if( root_component->IsPower() )
......
...@@ -293,7 +293,7 @@ public: ...@@ -293,7 +293,7 @@ public:
void SwapData( SCH_COMPONENT* copyitem ); void SwapData( SCH_COMPONENT* copyitem );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
// returns a unique ID, in the form of a path. // returns a unique ID, in the form of a path.
wxString GetPath( SCH_SHEET_PATH* sheet ); wxString GetPath( SCH_SHEET_PATH* sheet );
......
...@@ -371,7 +371,7 @@ bool SCH_FIELD::Save( FILE* aFile ) const ...@@ -371,7 +371,7 @@ bool SCH_FIELD::Save( FILE* aFile ) const
} }
void SCH_FIELD::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
int fieldNdx; int fieldNdx;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "general.h" #include "general.h"
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
class SCH_COMPONENT; class SCH_COMPONENT;
class LIB_FIELD; class LIB_FIELD;
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
} }
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
EDA_Rect GetBoundaryBox() const; EDA_Rect GetBoundaryBox() const;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
void SetaParent( EDA_BaseStruct* Struct, BASE_SCREEN* Screen ) void SetaParent( SCH_ITEM* Struct, SCH_SCREEN* Screen )
{ {
switch( Struct->Type() ) switch( Struct->Type() )
{ {
...@@ -85,7 +85,7 @@ SCH_SCREEN::SCH_SCREEN( KICAD_T type ) : BASE_SCREEN( type ) ...@@ -85,7 +85,7 @@ SCH_SCREEN::SCH_SCREEN( KICAD_T type ) : BASE_SCREEN( type )
{ {
size_t i; size_t i;
EEDrawList = NULL; /* Schematic items list */ SetDrawItems( NULL ); /* Schematic items list */
m_Zoom = 32; m_Zoom = 32;
for( i = 0; i < SCHEMATIC_ZOOM_LIST_CNT; i++ ) for( i = 0; i < SCHEMATIC_ZOOM_LIST_CNT; i++ )
...@@ -114,27 +114,30 @@ void SCH_SCREEN::FreeDrawList() ...@@ -114,27 +114,30 @@ void SCH_SCREEN::FreeDrawList()
{ {
SCH_ITEM* DrawStruct; SCH_ITEM* DrawStruct;
while( EEDrawList != NULL ) while( GetDrawItems() != NULL )
{ {
DrawStruct = EEDrawList; DrawStruct = GetDrawItems();
EEDrawList = EEDrawList->Next(); SetDrawItems( GetDrawItems()->Next() );
SAFE_DELETE( DrawStruct ); SAFE_DELETE( DrawStruct );
} }
EEDrawList = NULL; SetDrawItems( NULL );
} }
/* If found in EEDrawList, remove DrawStruct from EEDrawList. /* If found in GetDrawItems(), remove DrawStruct from GetDrawItems().
* DrawStruct is not deleted or modified * DrawStruct is not deleted or modified
*/ */
void SCH_SCREEN::RemoveFromDrawList( SCH_ITEM * DrawStruct ) void SCH_SCREEN::RemoveFromDrawList( SCH_ITEM * DrawStruct )
{ {
if( DrawStruct == EEDrawList ) if( DrawStruct == GetDrawItems() )
EEDrawList = EEDrawList->Next(); {
SetDrawItems( GetDrawItems()->Next() );
}
else else
{ {
EDA_BaseStruct* DrawList = EEDrawList; EDA_ITEM* DrawList = GetDrawItems();
while( DrawList && DrawList->Next() ) while( DrawList && DrawList->Next() )
{ {
if( DrawList->Next() == DrawStruct ) if( DrawList->Next() == DrawStruct )
...@@ -150,7 +153,7 @@ void SCH_SCREEN::RemoveFromDrawList( SCH_ITEM * DrawStruct ) ...@@ -150,7 +153,7 @@ void SCH_SCREEN::RemoveFromDrawList( SCH_ITEM * DrawStruct )
bool SCH_SCREEN::CheckIfOnDrawList( SCH_ITEM* st ) bool SCH_SCREEN::CheckIfOnDrawList( SCH_ITEM* st )
{ {
SCH_ITEM * DrawList = EEDrawList; SCH_ITEM * DrawList = GetDrawItems();
while( DrawList ) while( DrawList )
{ {
...@@ -165,15 +168,15 @@ bool SCH_SCREEN::CheckIfOnDrawList( SCH_ITEM* st ) ...@@ -165,15 +168,15 @@ bool SCH_SCREEN::CheckIfOnDrawList( SCH_ITEM* st )
void SCH_SCREEN::AddToDrawList( SCH_ITEM* st ) void SCH_SCREEN::AddToDrawList( SCH_ITEM* st )
{ {
st->SetNext( EEDrawList ); st->SetNext( GetDrawItems() );
EEDrawList = st; SetDrawItems( st );
} }
/* Extract the old wires, junctions and buses, an if CreateCopy replace them /* Extract the old wires, junctions and buses, an if CreateCopy replace them
* by a copy. Old ones must be put in undo list, and the new ones can be * by a copy. Old ones must be put in undo list, and the new ones can be
* modified by clean up safely. * modified by clean up safely.
* If an abort command is made, old wires must be put in EEDrawList, and * If an abort command is made, old wires must be put in GetDrawItems(), and
* copies must be deleted. This is because previously stored undo commands * copies must be deleted. This is because previously stored undo commands
* can handle pointers on wires or bus, and we do not delete wires or bus, * can handle pointers on wires or bus, and we do not delete wires or bus,
* we must put they in undo list. * we must put they in undo list.
...@@ -185,7 +188,7 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy ) ...@@ -185,7 +188,7 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy )
{ {
SCH_ITEM* item, * next_item, * new_item, * List = NULL; SCH_ITEM* item, * next_item, * new_item, * List = NULL;
for( item = EEDrawList; item != NULL; item = next_item ) for( item = GetDrawItems(); item != NULL; item = next_item )
{ {
next_item = item->Next(); next_item = item->Next();
...@@ -196,14 +199,16 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy ) ...@@ -196,14 +199,16 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy )
RemoveFromDrawList( item ); RemoveFromDrawList( item );
item->SetNext( List ); item->SetNext( List );
List = item; List = item;
if( CreateCopy ) if( CreateCopy )
{ {
if( item->Type() == DRAW_JUNCTION_STRUCT_TYPE ) if( item->Type() == DRAW_JUNCTION_STRUCT_TYPE )
new_item = ( (SCH_JUNCTION*) item )->GenCopy(); new_item = ( (SCH_JUNCTION*) item )->GenCopy();
else else
new_item = ( (SCH_LINE*) item )->GenCopy(); new_item = ( (SCH_LINE*) item )->GenCopy();
new_item->SetNext( EEDrawList );
EEDrawList = new_item; new_item->SetNext( GetDrawItems() );
SetDrawItems( new_item );
} }
break; break;
...@@ -225,12 +230,14 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -225,12 +230,14 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
SCH_ITEM* DrawList, * TstDrawList; SCH_ITEM* DrawList, * TstDrawList;
bool Modify = FALSE; bool Modify = FALSE;
DrawList = EEDrawList; DrawList = GetDrawItems();
for( ; DrawList != NULL; DrawList = DrawList->Next() ) for( ; DrawList != NULL; DrawList = DrawList->Next() )
{ {
if( DrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE ) if( DrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{ {
TstDrawList = DrawList->Next(); TstDrawList = DrawList->Next();
while( TstDrawList ) while( TstDrawList )
{ {
if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE ) if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
...@@ -244,7 +251,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -244,7 +251,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
DrawList->m_Flags |= TstDrawList->m_Flags; DrawList->m_Flags |= TstDrawList->m_Flags;
EraseStruct( TstDrawList, this ); EraseStruct( TstDrawList, this );
SetRefreshReq(); SetRefreshReq();
TstDrawList = EEDrawList; TstDrawList = GetDrawItems();
Modify = TRUE; Modify = TRUE;
} }
else else
...@@ -260,9 +267,9 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC ) ...@@ -260,9 +267,9 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
} }
} }
WinEDA_SchematicFrame* frame; SCH_EDIT_FRAME* frame;
frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow(); frame = (SCH_EDIT_FRAME*) wxGetApp().GetTopWindow();
frame->TestDanglingEnds( EEDrawList, DC ); frame->TestDanglingEnds( GetDrawItems(), DC );
return Modify; return Modify;
} }
...@@ -313,7 +320,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -313,7 +320,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
|| fprintf( aFile, "$EndDescr\n" ) < 0 ) || fprintf( aFile, "$EndDescr\n" ) < 0 )
return FALSE; return FALSE;
for( SCH_ITEM* item = EEDrawList; item; item = item->Next() ) for( SCH_ITEM* item = GetDrawItems(); item; item = item->Next() )
{ {
if( !item->Save( aFile ) ) if( !item->Save( aFile ) )
return FALSE; return FALSE;
...@@ -344,8 +351,10 @@ void SCH_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount ...@@ -344,8 +351,10 @@ void SCH_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount
return; return;
unsigned icnt = aList.m_CommandsList.size(); unsigned icnt = aList.m_CommandsList.size();
if( aItemCount > 0 ) if( aItemCount > 0 )
icnt = aItemCount; icnt = aItemCount;
for( unsigned ii = 0; ii < icnt; ii++ ) for( unsigned ii = 0; ii < icnt; ii++ )
{ {
if( aList.m_CommandsList.size() == 0 ) if( aList.m_CommandsList.size() == 0 )
...@@ -362,7 +371,7 @@ void SCH_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount ...@@ -362,7 +371,7 @@ void SCH_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount
void SCH_SCREEN::ClearDrawingState() void SCH_SCREEN::ClearDrawingState()
{ {
for( SCH_ITEM* item = EEDrawList; item != NULL; item = item->Next() ) for( SCH_ITEM* item = GetDrawItems(); item != NULL; item = item->Next() )
item->m_Flags = 0; item->m_Flags = 0;
} }
...@@ -427,24 +436,27 @@ void SCH_SCREENS::AddScreenToList( SCH_SCREEN* aScreen ) ...@@ -427,24 +436,27 @@ void SCH_SCREENS::AddScreenToList( SCH_SCREEN* aScreen )
} }
void SCH_SCREENS::BuildScreenList( EDA_BaseStruct* aItem ) void SCH_SCREENS::BuildScreenList( EDA_ITEM* aItem )
{ {
if( aItem && aItem->Type() == DRAW_SHEET_STRUCT_TYPE ) if( aItem && aItem->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
SCH_SHEET* ds = (SCH_SHEET*) aItem; SCH_SHEET* ds = (SCH_SHEET*) aItem;
aItem = ds->m_AssociatedScreen; aItem = ds->m_AssociatedScreen;
} }
if( aItem && aItem->Type() == SCREEN_STRUCT_TYPE ) if( aItem && aItem->Type() == SCREEN_STRUCT_TYPE )
{ {
SCH_SCREEN* screen = (SCH_SCREEN*) aItem; SCH_SCREEN* screen = (SCH_SCREEN*) aItem;
AddScreenToList( screen ); AddScreenToList( screen );
EDA_BaseStruct* strct = screen->EEDrawList; EDA_ITEM* strct = screen->GetDrawItems();
while( strct ) while( strct )
{ {
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
BuildScreenList( strct ); BuildScreenList( strct );
} }
strct = strct->Next(); strct = strct->Next();
} }
} }
......
...@@ -111,7 +111,7 @@ bool SCH_SHEET::Load( LINE_READER& aLine, wxString& aErrorMsg ) ...@@ -111,7 +111,7 @@ bool SCH_SHEET::Load( LINE_READER& aLine, wxString& aErrorMsg )
m_TimeStamp = GetTimeStamp(); m_TimeStamp = GetTimeStamp();
// sheets are added to the EEDrawList like other schematic components. // sheets are added to the GetDrawItems() like other schematic components.
// however, in order to preserve the hierarchy (through m_Parent pointers), // however, in order to preserve the hierarchy (through m_Parent pointers),
// a duplicate of the sheet is added to m_SubSheet array. // a duplicate of the sheet is added to m_SubSheet array.
// must be a duplicate, references just work for a two-layer structure. // must be a duplicate, references just work for a two-layer structure.
...@@ -249,7 +249,7 @@ bool SCH_SHEET::Load( LINE_READER& aLine, wxString& aErrorMsg ) ...@@ -249,7 +249,7 @@ bool SCH_SHEET::Load( LINE_READER& aLine, wxString& aErrorMsg )
/* creates a copy of a sheet /* creates a copy of a sheet
* The linked data itself (EEDrawList) is not duplicated * The linked data itself (GetDrawItems()) is not duplicated
*/ */
SCH_SHEET* SCH_SHEET::GenCopy() SCH_SHEET* SCH_SHEET::GenCopy()
{ {
...@@ -372,8 +372,8 @@ bool SCH_SHEET::HasUndefinedLabels() ...@@ -372,8 +372,8 @@ bool SCH_SHEET::HasUndefinedLabels()
BOOST_FOREACH( SCH_SHEET_PIN label, m_labels ) BOOST_FOREACH( SCH_SHEET_PIN label, m_labels )
{ {
/* Search the schematic for a hierarchical label corresponding to this sheet label. */ /* Search the schematic for a hierarchical label corresponding to this sheet label. */
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList; EDA_ITEM* DrawStruct = m_AssociatedScreen->GetDrawItems();
SCH_HIERLABEL* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
{ {
...@@ -396,7 +396,7 @@ bool SCH_SHEET::HasUndefinedLabels() ...@@ -396,7 +396,7 @@ bool SCH_SHEET::HasUndefinedLabels()
} }
void SCH_SHEET::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_SHEET::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
/* Place list structures for new sheet. */ /* Place list structures for new sheet. */
bool isnew = ( m_Flags & IS_NEW ) ? true : false; bool isnew = ( m_Flags & IS_NEW ) ? true : false;
...@@ -430,7 +430,8 @@ void SCH_SHEET::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -430,7 +430,8 @@ void SCH_SHEET::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
} }
} }
SCH_ITEM::Place( frame, DC ); //puts it on the EEDrawList. SCH_ITEM::Place( frame, DC ); //puts it on the GetDrawItems().
if( isnew ) if( isnew )
{ {
frame->SetSheetNumberAndCount(); frame->SetSheetNumberAndCount();
...@@ -448,8 +449,8 @@ void SCH_SHEET::CleanupSheet() ...@@ -448,8 +449,8 @@ void SCH_SHEET::CleanupSheet()
while( i != m_labels.end() ) while( i != m_labels.end() )
{ {
/* Search the schematic for a hierarchical label corresponding to this sheet label. */ /* Search the schematic for a hierarchical label corresponding to this sheet label. */
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList; EDA_ITEM* DrawStruct = m_AssociatedScreen->GetDrawItems();
SCH_HIERLABEL* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
{ {
...@@ -656,12 +657,14 @@ int SCH_SHEET::ComponentCount() ...@@ -656,12 +657,14 @@ int SCH_SHEET::ComponentCount()
if( m_AssociatedScreen ) if( m_AssociatedScreen )
{ {
EDA_BaseStruct* bs; EDA_ITEM* bs;
for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Next() )
for( bs = m_AssociatedScreen->GetDrawItems(); bs != NULL; bs = bs->Next() )
{ {
if( bs->Type() == TYPE_SCH_COMPONENT ) if( bs->Type() == TYPE_SCH_COMPONENT )
{ {
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
if( Cmp->GetField( VALUE )->m_Text.GetChar( 0 ) != '#' ) if( Cmp->GetField( VALUE )->m_Text.GetChar( 0 ) != '#' )
n++; n++;
} }
...@@ -688,7 +691,8 @@ bool SCH_SHEET::SearchHierarchy( wxString aFilename, SCH_SCREEN** aScreen ) ...@@ -688,7 +691,8 @@ bool SCH_SHEET::SearchHierarchy( wxString aFilename, SCH_SCREEN** aScreen )
{ {
if( m_AssociatedScreen ) if( m_AssociatedScreen )
{ {
EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList; EDA_ITEM* strct = m_AssociatedScreen->GetDrawItems();
while( strct ) while( strct )
{ {
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
...@@ -728,17 +732,22 @@ bool SCH_SHEET::LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList ) ...@@ -728,17 +732,22 @@ bool SCH_SHEET::LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList )
if( m_AssociatedScreen ) if( m_AssociatedScreen )
{ {
aList->Push( this ); aList->Push( this );
if( m_AssociatedScreen == aScreen ) if( m_AssociatedScreen == aScreen )
return true; return true;
EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList;
EDA_ITEM* strct = m_AssociatedScreen->GetDrawItems();
while( strct ) while( strct )
{ {
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
SCH_SHEET* ss = (SCH_SHEET*) strct; SCH_SHEET* ss = (SCH_SHEET*) strct;
if( ss->LocatePathOfScreen( aScreen, aList ) ) if( ss->LocatePathOfScreen( aScreen, aList ) )
return true; return true;
} }
strct = strct->Next(); strct = strct->Next();
} }
...@@ -754,10 +763,10 @@ bool SCH_SHEET::LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList ) ...@@ -754,10 +763,10 @@ bool SCH_SHEET::LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList )
* if a screen already exists, the file is already read. * if a screen already exists, the file is already read.
* m_AssociatedScreen point on the screen, and its m_RefCount is incremented * m_AssociatedScreen point on the screen, and its m_RefCount is incremented
* else creates a new associated screen and load the data file. * else creates a new associated screen and load the data file.
* @param aFrame = a WinEDA_SchematicFrame pointer to the maim schematic frame * @param aFrame = a SCH_EDIT_FRAME pointer to the maim schematic frame
* @return true if OK * @return true if OK
*/ */
bool SCH_SHEET::Load( WinEDA_SchematicFrame* aFrame ) bool SCH_SHEET::Load( SCH_EDIT_FRAME* aFrame )
{ {
bool success = true; bool success = true;
...@@ -777,17 +786,21 @@ bool SCH_SHEET::Load( WinEDA_SchematicFrame* aFrame ) ...@@ -777,17 +786,21 @@ bool SCH_SHEET::Load( WinEDA_SchematicFrame* aFrame )
m_AssociatedScreen = new SCH_SCREEN(); m_AssociatedScreen = new SCH_SCREEN();
m_AssociatedScreen->m_RefCount++; m_AssociatedScreen->m_RefCount++;
success = aFrame->LoadOneEEFile( m_AssociatedScreen, m_FileName ); success = aFrame->LoadOneEEFile( m_AssociatedScreen, m_FileName );
if( success ) if( success )
{ {
EDA_BaseStruct* bs = m_AssociatedScreen->EEDrawList; EDA_ITEM* bs = m_AssociatedScreen->GetDrawItems();
while( bs ) while( bs )
{ {
if( bs->Type() == DRAW_SHEET_STRUCT_TYPE ) if( bs->Type() == DRAW_SHEET_STRUCT_TYPE )
{ {
SCH_SHEET* sheetstruct = (SCH_SHEET*) bs; SCH_SHEET* sheetstruct = (SCH_SHEET*) bs;
if( !sheetstruct->Load( aFrame ) ) if( !sheetstruct->Load( aFrame ) )
success = false; success = false;
} }
bs = bs->Next(); bs = bs->Next();
} }
} }
...@@ -810,7 +823,8 @@ int SCH_SHEET::CountSheets() ...@@ -810,7 +823,8 @@ int SCH_SHEET::CountSheets()
if( m_AssociatedScreen ) if( m_AssociatedScreen )
{ {
EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList; EDA_ITEM* strct = m_AssociatedScreen->GetDrawItems();
for( ; strct; strct = strct->Next() ) for( ; strct; strct = strct->Next() )
{ {
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
...@@ -841,8 +855,7 @@ wxString SCH_SHEET::GetFileName( void ) ...@@ -841,8 +855,7 @@ wxString SCH_SHEET::GetFileName( void )
* @param aFileName = the new filename * @param aFileName = the new filename
* @param aFrame = the schematic frame * @param aFrame = the schematic frame
*/ */
bool SCH_SHEET::ChangeFileName( WinEDA_SchematicFrame* aFrame, bool SCH_SHEET::ChangeFileName( SCH_EDIT_FRAME* aFrame, const wxString& aFileName )
const wxString& aFileName )
{ {
if( ( GetFileName() == aFileName ) && m_AssociatedScreen ) if( ( GetFileName() == aFileName ) && m_AssociatedScreen )
return true; return true;
......
...@@ -16,7 +16,7 @@ class SCH_SHEET; ...@@ -16,7 +16,7 @@ class SCH_SHEET;
class SCH_SHEET_PIN; class SCH_SHEET_PIN;
class SCH_SHEET_PATH; class SCH_SHEET_PATH;
class DANGLING_END_ITEM; class DANGLING_END_ITEM;
class WinEDA_SchematicFrame; class SCH_EDIT_FRAME;
/** /**
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
*/ */
SCH_SHEET* GetParent() const { return (SCH_SHEET*) m_Parent; } SCH_SHEET* GetParent() const { return (SCH_SHEET*) m_Parent; }
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
/*the functions Draw, CreateGraphicShape and Plot are no removed as /*the functions Draw, CreateGraphicShape and Plot are no removed as
* as this shape is already handled as HIERLABEL ... * as this shape is already handled as HIERLABEL ...
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
*/ */
virtual bool Load( LINE_READER& aLine, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLine, wxString& aErrorMsg );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
SCH_SHEET* GenCopy(); SCH_SHEET* GenCopy();
void DisplayInfo( WinEDA_DrawFrame* frame ); void DisplayInfo( WinEDA_DrawFrame* frame );
...@@ -379,11 +379,11 @@ public: ...@@ -379,11 +379,11 @@ public:
* m_AssociatedScreen point on the screen, and its m_RefCount is * m_AssociatedScreen point on the screen, and its m_RefCount is
* incremented * incremented
* else creates a new associated screen and load the data file. * else creates a new associated screen and load the data file.
* @param aFrame = a WinEDA_SchematicFrame pointer to the maim schematic * @param aFrame = a SCH_EDIT_FRAME pointer to the maim schematic
* frame * frame
* @return true if OK * @return true if OK
*/ */
bool Load( WinEDA_SchematicFrame* aFrame ); bool Load( SCH_EDIT_FRAME* aFrame );
/** /**
* Function SearchHierarchy * Function SearchHierarchy
...@@ -442,8 +442,7 @@ public: ...@@ -442,8 +442,7 @@ public:
* @param aFileName = the new filename * @param aFileName = the new filename
* @param aFrame = the schematic frame * @param aFrame = the schematic frame
*/ */
bool ChangeFileName( WinEDA_SchematicFrame* aFrame, bool ChangeFileName( SCH_EDIT_FRAME* aFrame, const wxString& aFileName );
const wxString& aFileName );
//void RemoveSheet(SCH_SHEET* sheet); //void RemoveSheet(SCH_SHEET* sheet);
//to remove a sheet, just delete it //to remove a sheet, just delete it
......
...@@ -136,8 +136,10 @@ SCH_SCREEN* SCH_SHEET_PATH::LastScreen() ...@@ -136,8 +136,10 @@ SCH_SCREEN* SCH_SHEET_PATH::LastScreen()
SCH_ITEM* SCH_SHEET_PATH::LastDrawList() SCH_ITEM* SCH_SHEET_PATH::LastDrawList()
{ {
SCH_SHEET* lastSheet = Last(); SCH_SHEET* lastSheet = Last();
if( lastSheet && lastSheet->m_AssociatedScreen ) if( lastSheet && lastSheet->m_AssociatedScreen )
return lastSheet->m_AssociatedScreen->EEDrawList; return lastSheet->m_AssociatedScreen->GetDrawItems();
return NULL; return NULL;
} }
...@@ -147,10 +149,10 @@ SCH_ITEM* SCH_SHEET_PATH::FirstDrawList() ...@@ -147,10 +149,10 @@ SCH_ITEM* SCH_SHEET_PATH::FirstDrawList()
SCH_ITEM* item = NULL; SCH_ITEM* item = NULL;
if( m_numSheets && m_sheets[0]->m_AssociatedScreen ) if( m_numSheets && m_sheets[0]->m_AssociatedScreen )
item = m_sheets[0]->m_AssociatedScreen->EEDrawList; item = m_sheets[0]->m_AssociatedScreen->GetDrawItems();
/* @fixme - These lists really should be one of the boost pointer containers. This /* @fixme - These lists really should be one of the boost pointer containers. This
* is a brain dead hack to allow reverse iteration of EDA_BaseStruct linked * is a brain dead hack to allow reverse iteration of EDA_ITEM linked
* list. * list.
*/ */
SCH_ITEM* lastItem = NULL; SCH_ITEM* lastItem = NULL;
...@@ -253,7 +255,7 @@ wxString SCH_SHEET_PATH::PathHumanReadable() const ...@@ -253,7 +255,7 @@ wxString SCH_SHEET_PATH::PathHumanReadable() const
void SCH_SHEET_PATH::UpdateAllScreenReferences() void SCH_SHEET_PATH::UpdateAllScreenReferences()
{ {
EDA_BaseStruct* t = LastDrawList(); EDA_ITEM* t = LastDrawList();
while( t ) while( t )
{ {
...@@ -530,7 +532,8 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet ) ...@@ -530,7 +532,8 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
if( aSheet->m_AssociatedScreen != NULL ) if( aSheet->m_AssociatedScreen != NULL )
{ {
EDA_BaseStruct* strct = m_currList.LastDrawList(); EDA_ITEM* strct = m_currList.LastDrawList();
while( strct ) while( strct )
{ {
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
......
...@@ -378,7 +378,7 @@ void SCH_TEXT::SwapData( SCH_TEXT* copyitem ) ...@@ -378,7 +378,7 @@ void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
} }
void SCH_TEXT::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_TEXT::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
/* save old text in undo list */ /* save old text in undo list */
if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) ) if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) )
......
...@@ -114,7 +114,7 @@ public: ...@@ -114,7 +114,7 @@ public:
} }
void SwapData( SCH_TEXT* copyitem ); void SwapData( SCH_TEXT* copyitem );
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
/** /**
* Function HitTest * Function HitTest
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
* *
* Redo command * Redo command
* - delete item(s) old command: * - delete item(s) old command:
* => deleted items are moved in EEDrawList list, and in * => deleted items are moved in GetDrawItems() list, and in
* *
* - change item(s) command * - change item(s) command
* => the copy of item(s) is moved in Undo list * => the copy of item(s) is moved in Undo list
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
* swap data between Item and its copy, pointed by its .m_Image member * swap data between Item and its copy, pointed by its .m_Image member
* swapped data is data modified by edition, so not all values are swapped * swapped data is data modified by edition, so not all values are swapped
*/ */
void SwapData( EDA_BaseStruct* aItem, EDA_BaseStruct* aImage ) void SwapData( EDA_ITEM* aItem, EDA_ITEM* aImage )
{ {
if( aItem == NULL || aImage == NULL ) if( aItem == NULL || aImage == NULL )
{ {
...@@ -195,8 +195,8 @@ void SwapData( EDA_BaseStruct* aItem, EDA_BaseStruct* aImage ) ...@@ -195,8 +195,8 @@ void SwapData( EDA_BaseStruct* aItem, EDA_BaseStruct* aImage )
* UR_MOVED * UR_MOVED
* *
* If it is a delete command, items are put on list with the .Flags member * If it is a delete command, items are put on list with the .Flags member
* set to UR_DELETED. When it will be really deleted, the EEDrawList and the * set to UR_DELETED. When it will be really deleted, the GetDrawItems() and the
* sub-hierarchy will be deleted. If it is only a copy, the EEDrawList and the * sub-hierarchy will be deleted. If it is only a copy, the GetDrawItems() and the
* sub-hierarchy must NOT be deleted. * sub-hierarchy must NOT be deleted.
* *
* Note: * Note:
...@@ -207,9 +207,9 @@ void SwapData( EDA_BaseStruct* aItem, EDA_BaseStruct* aImage ) ...@@ -207,9 +207,9 @@ void SwapData( EDA_BaseStruct* aItem, EDA_BaseStruct* aImage )
* wires saved in Undo List (for Undo or Redo commands, saved wires will be * wires saved in Undo List (for Undo or Redo commands, saved wires will be
* exchanged with current wire list * exchanged with current wire list
*/ */
void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem, void SCH_EDIT_FRAME::SaveCopyInUndoList( SCH_ITEM* aItem,
UndoRedoOpType aCommandType, UndoRedoOpType aCommandType,
const wxPoint& aTransformPoint ) const wxPoint& aTransformPoint )
{ {
/* Does not save a null item. /* Does not save a null item.
* but if aCommandType == UR_WIRE_IMAGE, we must save null item. * but if aCommandType == UR_WIRE_IMAGE, we must save null item.
...@@ -225,6 +225,7 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem, ...@@ -225,6 +225,7 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem,
commandToUndo->m_TransformPoint = aTransformPoint; commandToUndo->m_TransformPoint = aTransformPoint;
ITEM_PICKER itemWrapper( aItem, aCommandType ); ITEM_PICKER itemWrapper( aItem, aCommandType );
if( aItem ) if( aItem )
{ {
itemWrapper.m_PickedItemType = aItem->Type(); itemWrapper.m_PickedItemType = aItem->Type();
...@@ -275,9 +276,9 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem, ...@@ -275,9 +276,9 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( SCH_ITEM* aItem,
* @param aItemsList = a PICKED_ITEMS_LIST of items to save * @param aItemsList = a PICKED_ITEMS_LIST of items to save
* @param aTypeCommand = type of command ( UR_CHANGED, UR_NEW, UR_DELETED ... * @param aTypeCommand = type of command ( UR_CHANGED, UR_NEW, UR_DELETED ...
*/ */
void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, void SCH_EDIT_FRAME::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
UndoRedoOpType aTypeCommand, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint ) const wxPoint& aTransformPoint )
{ {
PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST(); PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
...@@ -323,8 +324,7 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, ...@@ -323,8 +324,7 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
default: default:
{ {
wxString msg; wxString msg;
msg.Printf( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), msg.Printf( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command );
command );
wxMessageBox( msg ); wxMessageBox( msg );
} }
break; break;
...@@ -352,8 +352,7 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, ...@@ -352,8 +352,7 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo * @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo * @param aRedoCommand = a bool: true for redo, false for undo
*/ */
void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand )
bool aRedoCommand )
{ {
SCH_ITEM* item; SCH_ITEM* item;
SCH_ITEM* alt_item; SCH_ITEM* alt_item;
...@@ -381,8 +380,8 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, ...@@ -381,8 +380,8 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
case UR_DELETED: /* deleted items are put in EEdrawList, as new items */ case UR_DELETED: /* deleted items are put in EEdrawList, as new items */
aList->SetPickedItemStatus( UR_NEW, ii ); aList->SetPickedItemStatus( UR_NEW, ii );
item->SetNext( GetScreen()->EEDrawList ); item->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->EEDrawList = item; GetScreen()->SetDrawItems( item );
break; break;
case UR_MOVED: case UR_MOVED:
...@@ -422,8 +421,8 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, ...@@ -422,8 +421,8 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
while( item ) while( item )
{ {
SCH_ITEM* nextitem = item->Next(); SCH_ITEM* nextitem = item->Next();
item->SetNext( GetScreen()->EEDrawList ); item->SetNext( GetScreen()->GetDrawItems() );
GetScreen()->EEDrawList = item; GetScreen()->SetDrawItems( item );
item->m_Flags = 0; item->m_Flags = 0;
item = nextitem; item = nextitem;
} }
...@@ -450,7 +449,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, ...@@ -450,7 +449,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
* - Get the previous version of the schematic from undo list * - Get the previous version of the schematic from undo list
* @return none * @return none
*/ */
void WinEDA_SchematicFrame::GetSchematicFromUndoList( wxCommandEvent& event ) void SCH_EDIT_FRAME::GetSchematicFromUndoList( wxCommandEvent& event )
{ {
if( GetScreen()->GetUndoCommandCount() <= 0 ) if( GetScreen()->GetUndoCommandCount() <= 0 )
return; return;
...@@ -471,7 +470,7 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList( wxCommandEvent& event ) ...@@ -471,7 +470,7 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList( wxCommandEvent& event )
ReCreateHToolbar(); ReCreateHToolbar();
SetToolbars(); SetToolbars();
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh(); DrawPanel->Refresh();
} }
...@@ -483,7 +482,7 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList( wxCommandEvent& event ) ...@@ -483,7 +482,7 @@ void WinEDA_SchematicFrame::GetSchematicFromUndoList( wxCommandEvent& event )
* - Get the previous version from Redo list * - Get the previous version from Redo list
* @return none * @return none
*/ */
void WinEDA_SchematicFrame::GetSchematicFromRedoList( wxCommandEvent& event ) void SCH_EDIT_FRAME::GetSchematicFromRedoList( wxCommandEvent& event )
{ {
if( GetScreen()->GetRedoCommandCount() == 0 ) if( GetScreen()->GetRedoCommandCount() == 0 )
return; return;
...@@ -505,6 +504,6 @@ void WinEDA_SchematicFrame::GetSchematicFromRedoList( wxCommandEvent& event ) ...@@ -505,6 +504,6 @@ void WinEDA_SchematicFrame::GetSchematicFromRedoList( wxCommandEvent& event )
ReCreateHToolbar(); ReCreateHToolbar();
SetToolbars(); SetToolbars();
TestDanglingEnds( GetScreen()->EEDrawList, NULL ); TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
DrawPanel->Refresh(); DrawPanel->Refresh();
} }
This diff is collapsed.
...@@ -34,7 +34,7 @@ static wxPoint s_OldPos; /* Former position for cancellation or move ReSize */ ...@@ -34,7 +34,7 @@ static wxPoint s_OldPos; /* Former position for cancellation or move ReSize */
/* Routine to edit the SheetName and the FileName for the sheet "Sheet" */ /* Routine to edit the SheetName and the FileName for the sheet "Sheet" */
bool WinEDA_SchematicFrame::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
{ {
bool edit = true; bool edit = true;
...@@ -211,7 +211,7 @@ static void ExitSheet( WinEDA_DrawPanel* aPanel, wxDC* aDC ) ...@@ -211,7 +211,7 @@ static void ExitSheet( WinEDA_DrawPanel* aPanel, wxDC* aDC )
/* Create hierarchy sheet. */ /* Create hierarchy sheet. */
SCH_SHEET* WinEDA_SchematicFrame::CreateSheet( wxDC* aDC ) SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
{ {
g_ItemToRepeat = NULL; g_ItemToRepeat = NULL;
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
...@@ -225,7 +225,7 @@ SCH_SHEET* WinEDA_SchematicFrame::CreateSheet( wxDC* aDC ) ...@@ -225,7 +225,7 @@ SCH_SHEET* WinEDA_SchematicFrame::CreateSheet( wxDC* aDC )
s_PreviousSheetWidth = SHEET_MIN_WIDTH; s_PreviousSheetWidth = SHEET_MIN_WIDTH;
s_PreviousSheetHeight = SHEET_MIN_HEIGHT; s_PreviousSheetHeight = SHEET_MIN_HEIGHT;
// need to check if this is being added to the EEDrawList. // need to check if this is being added to the GetDrawItems().
// also need to update the hierarchy, if we are adding // also need to update the hierarchy, if we are adding
// a sheet to a screen that already has multiple instances (!) // a sheet to a screen that already has multiple instances (!)
GetScreen()->SetCurItem( sheet ); GetScreen()->SetCurItem( sheet );
...@@ -239,15 +239,14 @@ SCH_SHEET* WinEDA_SchematicFrame::CreateSheet( wxDC* aDC ) ...@@ -239,15 +239,14 @@ SCH_SHEET* WinEDA_SchematicFrame::CreateSheet( wxDC* aDC )
} }
void WinEDA_SchematicFrame::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC ) void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
{ {
if( aSheet == NULL || aSheet->m_Flags & IS_NEW ) if( aSheet == NULL || aSheet->m_Flags & IS_NEW )
return; return;
if( aSheet->Type() != DRAW_SHEET_STRUCT_TYPE ) if( aSheet->Type() != DRAW_SHEET_STRUCT_TYPE )
{ {
DisplayError( this, DisplayError( this, wxT( "SCH_EDIT_FRAME::ReSizeSheet: Bad SructType" ) );
wxT( "WinEDA_SchematicFrame::ReSizeSheet: Bad SructType" ) );
return; return;
} }
...@@ -279,7 +278,7 @@ void WinEDA_SchematicFrame::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC ) ...@@ -279,7 +278,7 @@ void WinEDA_SchematicFrame::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
} }
void WinEDA_SchematicFrame::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC ) void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC )
{ {
if( ( aSheet == NULL ) || ( aSheet->Type() != DRAW_SHEET_STRUCT_TYPE ) ) if( ( aSheet == NULL ) || ( aSheet->Type() != DRAW_SHEET_STRUCT_TYPE ) )
return; return;
......
...@@ -61,7 +61,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -61,7 +61,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
} }
void SCH_SHEET_PIN::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) void SCH_SHEET_PIN::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
{ {
SCH_SHEET* Sheet = (SCH_SHEET*) GetParent(); SCH_SHEET* Sheet = (SCH_SHEET*) GetParent();
...@@ -93,7 +93,7 @@ void SCH_SHEET_PIN::Place( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -93,7 +93,7 @@ void SCH_SHEET_PIN::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
} }
void WinEDA_SchematicFrame::StartMove_PinSheet( SCH_SHEET_PIN* SheetLabel, wxDC* DC ) void SCH_EDIT_FRAME::StartMove_PinSheet( SCH_SHEET_PIN* SheetLabel, wxDC* DC )
{ {
NetSheetTextSize = SheetLabel->m_Size; NetSheetTextSize = SheetLabel->m_Size;
s_CurrentTypeLabel = SheetLabel->m_Shape; s_CurrentTypeLabel = SheetLabel->m_Shape;
...@@ -123,7 +123,7 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -123,7 +123,7 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
int WinEDA_SchematicFrame::Edit_PinSheet( SCH_SHEET_PIN* aLabel, wxDC* aDC ) int SCH_EDIT_FRAME::Edit_PinSheet( SCH_SHEET_PIN* aLabel, wxDC* aDC )
{ {
if( aLabel == NULL ) if( aLabel == NULL )
return wxID_CANCEL; return wxID_CANCEL;
...@@ -166,7 +166,7 @@ int WinEDA_SchematicFrame::Edit_PinSheet( SCH_SHEET_PIN* aLabel, wxDC* aDC ) ...@@ -166,7 +166,7 @@ int WinEDA_SchematicFrame::Edit_PinSheet( SCH_SHEET_PIN* aLabel, wxDC* aDC )
/* Add a new sheet pin to the sheet at the current cursor position. /* Add a new sheet pin to the sheet at the current cursor position.
*/ */
SCH_SHEET_PIN* WinEDA_SchematicFrame::Create_PinSheet( SCH_SHEET* Sheet, wxDC* DC ) SCH_SHEET_PIN* SCH_EDIT_FRAME::Create_PinSheet( SCH_SHEET* Sheet, wxDC* DC )
{ {
wxString Line, Text; wxString Line, Text;
SCH_SHEET_PIN* NewSheetLabel; SCH_SHEET_PIN* NewSheetLabel;
...@@ -199,16 +199,16 @@ SCH_SHEET_PIN* WinEDA_SchematicFrame::Create_PinSheet( SCH_SHEET* Sheet, wxDC* D ...@@ -199,16 +199,16 @@ SCH_SHEET_PIN* WinEDA_SchematicFrame::Create_PinSheet( SCH_SHEET* Sheet, wxDC* D
/* Automatically create a sheet labels from global labels for each node in /* Automatically create a sheet labels from global labels for each node in
* the corresponding hierarchy. * the corresponding hierarchy.
*/ */
SCH_SHEET_PIN* WinEDA_SchematicFrame::Import_PinSheet( SCH_SHEET* Sheet, wxDC* DC ) SCH_SHEET_PIN* SCH_EDIT_FRAME::Import_PinSheet( SCH_SHEET* Sheet, wxDC* DC )
{ {
EDA_BaseStruct* DrawStruct; EDA_ITEM* DrawStruct;
SCH_SHEET_PIN* NewSheetLabel; SCH_SHEET_PIN* NewSheetLabel;
SCH_HIERLABEL* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
if( !Sheet->m_AssociatedScreen ) if( !Sheet->m_AssociatedScreen )
return NULL; return NULL;
DrawStruct = Sheet->m_AssociatedScreen->EEDrawList; DrawStruct = Sheet->m_AssociatedScreen->GetDrawItems();
HLabel = NULL; HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
...@@ -255,7 +255,7 @@ SCH_SHEET_PIN* WinEDA_SchematicFrame::Import_PinSheet( SCH_SHEET* Sheet, wxDC* D ...@@ -255,7 +255,7 @@ SCH_SHEET_PIN* WinEDA_SchematicFrame::Import_PinSheet( SCH_SHEET* Sheet, wxDC* D
* This sheet label can not be put in a pile "undelete" because it would not * This sheet label can not be put in a pile "undelete" because it would not
* Possible to link it back it's 'SCH_SHEET' parent. * Possible to link it back it's 'SCH_SHEET' parent.
*/ */
void WinEDA_SchematicFrame::DeleteSheetLabel( bool aRedraw, SCH_SHEET_PIN* aSheetLabelToDel ) void SCH_EDIT_FRAME::DeleteSheetLabel( bool aRedraw, SCH_SHEET_PIN* aSheetLabelToDel )
{ {
SCH_SHEET* parent = (SCH_SHEET*) aSheetLabelToDel->GetParent(); SCH_SHEET* parent = (SCH_SHEET*) aSheetLabelToDel->GetParent();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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