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