Minor fixes and lots of coding policy changes.
This commit is contained in:
parent
e6b2f3929f
commit
c79077c9a2
|
@ -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() )
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/****************************************/
|
||||
/* 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,
|
||||
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,7 +93,7 @@ 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,
|
||||
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,7 +270,7 @@ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly,
|
|||
* stamps are used to handle annotation mainly in complex
|
||||
* hierarchies.
|
||||
*/
|
||||
void AnnotateComponents( WinEDA_SchematicFrame* parent,
|
||||
void AnnotateComponents( SCH_EDIT_FRAME* parent,
|
||||
bool annotateSchematic,
|
||||
int sortOption,
|
||||
bool resetAnnotation,
|
||||
|
@ -359,7 +362,7 @@ int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList,
|
|||
SCH_SHEET_PATH* aSheet )
|
||||
{
|
||||
int NbrCmp = 0;
|
||||
EDA_BaseStruct* DrawList = aSheet->LastDrawList();
|
||||
EDA_ITEM* DrawList = aSheet->LastDrawList();
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
LIB_COMPONENT* Entry;
|
||||
|
||||
|
@ -368,8 +371,8 @@ int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList,
|
|||
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,8 +32,7 @@
|
|||
* the search is not stopped when a reference is found (all instances must be
|
||||
* found).
|
||||
*/
|
||||
bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
|
||||
const wxString& aReference,
|
||||
bool SCH_EDIT_FRAME::FillFootprintFieldForAllInstancesofComponent( const wxString& aReference,
|
||||
const wxString& aFootPrint,
|
||||
bool aSetVisible )
|
||||
{
|
||||
|
@ -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;
|
||||
|
|
|
@ -24,24 +24,23 @@
|
|||
static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel,
|
||||
wxDC* DC,
|
||||
bool erase );
|
||||
static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
||||
static void AbortCreateNewLine( WinEDA_DrawPanel* Panel, wxDC* DC );
|
||||
static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer );
|
||||
static bool IsJunctionNeeded( WinEDA_SchematicFrame* frame, wxPoint& pos );
|
||||
static bool IsJunctionNeeded( SCH_EDIT_FRAME* frame, wxPoint& pos );
|
||||
static void ComputeBreakPoint( SCH_LINE* segment, const wxPoint& new_pos );
|
||||
|
||||
SCH_ITEM* s_OldWiresList;
|
||||
wxPoint s_ConnexionStartPoint;
|
||||
|
||||
|
||||
/* Replace the wires in screen->EEDrawList by s_OldWiresList wires.
|
||||
/* Replace the wires in screen->GetDrawItems() by s_OldWiresList wires.
|
||||
*/
|
||||
static void RestoreOldWires( SCH_SCREEN* screen )
|
||||
{
|
||||
SCH_ITEM* item;
|
||||
SCH_ITEM* next_item;
|
||||
|
||||
for( item = screen->EEDrawList; item != NULL; item = next_item )
|
||||
for( item = screen->GetDrawItems(); item != NULL; item = next_item )
|
||||
{
|
||||
next_item = item->Next();
|
||||
|
||||
|
@ -62,13 +61,59 @@ static void RestoreOldWires( SCH_SCREEN* screen )
|
|||
{
|
||||
next_item = s_OldWiresList->Next();
|
||||
|
||||
s_OldWiresList->SetNext( screen->EEDrawList );
|
||||
screen->EEDrawList = s_OldWiresList;
|
||||
s_OldWiresList->SetNext( screen->GetDrawItems() );
|
||||
screen->SetDrawItems( s_OldWiresList );
|
||||
s_OldWiresList = next_item;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mouse capture callback for drawing line segments.
|
||||
*/
|
||||
static void DrawSegment( WinEDA_DrawPanel* aPanel, wxDC* aDC, bool aErase )
|
||||
{
|
||||
SCH_LINE* CurrentLine = (SCH_LINE*) aPanel->GetScreen()->GetCurItem();
|
||||
SCH_LINE* segment;
|
||||
int color;
|
||||
|
||||
if( CurrentLine == NULL )
|
||||
return;
|
||||
|
||||
color = ReturnLayerColor( CurrentLine->GetLayer() ) ^ HIGHLIGHT_FLAG;
|
||||
|
||||
if( aErase )
|
||||
{
|
||||
segment = CurrentLine;
|
||||
|
||||
while( segment )
|
||||
{
|
||||
if( !segment->IsNull() ) // Redraw if segment length != 0
|
||||
RedrawOneStruct( aPanel, aDC, segment, g_XorMode, color );
|
||||
|
||||
segment = segment->Next();
|
||||
}
|
||||
}
|
||||
|
||||
wxPoint endpos = aPanel->GetScreen()->m_Curseur;
|
||||
|
||||
if( g_HVLines ) /* Coerce the line to vertical or horizontal one: */
|
||||
ComputeBreakPoint( CurrentLine, endpos );
|
||||
else
|
||||
CurrentLine->m_End = endpos;
|
||||
|
||||
segment = CurrentLine;
|
||||
|
||||
while( segment )
|
||||
{
|
||||
if( !segment->IsNull() ) // Redraw if segment length != 0
|
||||
RedrawOneStruct( aPanel, aDC, segment, g_XorMode, color );
|
||||
|
||||
segment = segment->Next();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Creates a new segment ( WIRE, BUS ),
|
||||
* or terminates the current segment
|
||||
* If the end of the current segment is on an other segment, place a junction
|
||||
|
@ -76,7 +121,7 @@ static void RestoreOldWires( SCH_SCREEN* screen )
|
|||
* If the end of the current segment is on a pin, terminates the command
|
||||
* In others cases starts a new segment
|
||||
*/
|
||||
void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
|
||||
void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
|
||||
{
|
||||
SCH_LINE* oldsegment, * newsegment, * nextsegment;
|
||||
wxPoint cursorpos = GetScreen()->m_Curseur;
|
||||
|
@ -124,26 +169,27 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
|
|||
}
|
||||
|
||||
newsegment->m_Flags = IS_NEW;
|
||||
if( g_HVLines ) // We need 2 segments to go from a given start pin to
|
||||
// an end point
|
||||
|
||||
if( g_HVLines ) // We need 2 segments to go from a given start pin to an end point
|
||||
{
|
||||
nextsegment = newsegment->GenCopy();
|
||||
nextsegment->m_Flags = IS_NEW;
|
||||
newsegment->SetNext( nextsegment );
|
||||
nextsegment->SetBack( newsegment );
|
||||
}
|
||||
|
||||
GetScreen()->SetCurItem( newsegment );
|
||||
DrawPanel->ManageCurseur = Segment_in_Ghost;
|
||||
DrawPanel->ManageCurseur = DrawSegment;
|
||||
DrawPanel->ForceCloseManageCurseur = AbortCreateNewLine;
|
||||
g_ItemToRepeat = NULL;
|
||||
}
|
||||
else /* A segment is in progress: terminates the current segment and add
|
||||
* a new segment */
|
||||
else // A segment is in progress: terminates the current segment and add a new segment.
|
||||
{
|
||||
nextsegment = oldsegment->Next();
|
||||
if( !g_HVLines ) /* if only one segment is needed and the current is
|
||||
* has len = 0, do not create a new one */
|
||||
|
||||
if( !g_HVLines )
|
||||
{
|
||||
// if only one segment is needed and it has length = 0, do not create a new one.
|
||||
if( oldsegment->IsNull() )
|
||||
return;
|
||||
}
|
||||
|
@ -161,11 +207,12 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
|
|||
* if the end point is on a pin, junction or an other wire or bus */
|
||||
if( IsTerminalPoint( GetScreen(), cursorpos, oldsegment->GetLayer() ) )
|
||||
{
|
||||
EndSegment( DC ); return;
|
||||
EndSegment( DC );
|
||||
return;
|
||||
}
|
||||
|
||||
oldsegment->SetNext( GetScreen()->EEDrawList );
|
||||
GetScreen()->EEDrawList = oldsegment;
|
||||
oldsegment->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( oldsegment );
|
||||
DrawPanel->CursorOff( DC ); // Erase schematic cursor
|
||||
RedrawOneStruct( DrawPanel, DC, oldsegment, GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CursorOn( DC ); // Display schematic cursor
|
||||
|
@ -185,6 +232,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
|
|||
newsegment = oldsegment->GenCopy();
|
||||
newsegment->m_Start = oldsegment->m_End;
|
||||
}
|
||||
|
||||
newsegment->m_End = cursorpos;
|
||||
oldsegment->m_Flags = SELECTED;
|
||||
newsegment->m_Flags = IS_NEW;
|
||||
|
@ -206,7 +254,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
|
|||
|
||||
/* Called to terminate a bus, wire, or line creation
|
||||
*/
|
||||
void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
|
||||
void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
|
||||
{
|
||||
SCH_LINE* firstsegment = (SCH_LINE*) GetScreen()->GetCurItem();
|
||||
SCH_LINE* lastsegment = firstsegment;
|
||||
|
@ -214,36 +262,45 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
|
|||
|
||||
if( firstsegment == NULL )
|
||||
return;
|
||||
|
||||
if( ( firstsegment->m_Flags & IS_NEW ) == 0 )
|
||||
return;
|
||||
|
||||
/* Delete Null segments and Put line it in Drawlist */
|
||||
lastsegment = firstsegment;
|
||||
|
||||
while( lastsegment )
|
||||
{
|
||||
SCH_LINE* nextsegment = lastsegment->Next();
|
||||
|
||||
if( lastsegment->IsNull() )
|
||||
{
|
||||
SCH_LINE* previous_segment = lastsegment->Back();
|
||||
|
||||
if( firstsegment == lastsegment )
|
||||
firstsegment = nextsegment;
|
||||
|
||||
if( nextsegment )
|
||||
nextsegment->SetBack( NULL );
|
||||
|
||||
if( previous_segment )
|
||||
previous_segment->SetNext( nextsegment );
|
||||
|
||||
delete lastsegment;
|
||||
}
|
||||
|
||||
lastsegment = nextsegment;
|
||||
}
|
||||
|
||||
/* put the segment list to the main linked list */
|
||||
segment = lastsegment = firstsegment;
|
||||
|
||||
while( segment )
|
||||
{
|
||||
lastsegment = segment;
|
||||
segment = segment->Next();
|
||||
lastsegment->SetNext( GetScreen()->EEDrawList );
|
||||
GetScreen()->EEDrawList = lastsegment;
|
||||
lastsegment->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( lastsegment );
|
||||
}
|
||||
|
||||
DrawPanel->ManageCurseur = NULL;
|
||||
|
@ -266,7 +323,8 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
|
|||
( (SCH_SCREEN*) GetScreen() )->SchematicCleanUp( NULL );
|
||||
|
||||
/* clear flags and find last segment entered, for repeat function */
|
||||
segment = (SCH_LINE*) GetScreen()->EEDrawList;
|
||||
segment = (SCH_LINE*) GetScreen()->GetDrawItems();
|
||||
|
||||
while( segment )
|
||||
{
|
||||
if( segment->m_Flags )
|
||||
|
@ -283,7 +341,6 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
|
|||
{
|
||||
if( IsJunctionNeeded( this, end_point ) )
|
||||
CreateNewJunctionStruct( DC, end_point );
|
||||
|
||||
else if( IsJunctionNeeded( this, alt_end_point ) )
|
||||
CreateNewJunctionStruct( DC, alt_end_point );
|
||||
}
|
||||
|
@ -293,12 +350,12 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
|
|||
if( IsJunctionNeeded( this, s_ConnexionStartPoint ) )
|
||||
CreateNewJunctionStruct( DC, s_ConnexionStartPoint );
|
||||
|
||||
TestDanglingEnds( GetScreen()->EEDrawList, DC );
|
||||
|
||||
TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
|
||||
|
||||
/* Redraw wires and junctions which can be changed by TestDanglingEnds() */
|
||||
DrawPanel->CursorOff( DC ); // Erase schematic cursor
|
||||
EDA_BaseStruct* item = GetScreen()->EEDrawList;
|
||||
EDA_ITEM* item = GetScreen()->GetDrawItems();
|
||||
|
||||
while( item )
|
||||
{
|
||||
switch( item->Type() )
|
||||
|
@ -325,50 +382,6 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
|
|||
}
|
||||
|
||||
|
||||
/* Redraw the segment (g_HVLines == FALSE ) or the two segments (g_HVLines ==
|
||||
* TRUE )
|
||||
* from the start point to the cursor, when moving the mouse
|
||||
*/
|
||||
static void Segment_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
||||
{
|
||||
SCH_LINE* CurrentLine = (SCH_LINE*) panel->GetScreen()->GetCurItem();
|
||||
SCH_LINE* segment;
|
||||
int color;
|
||||
|
||||
if( CurrentLine == NULL )
|
||||
return;
|
||||
|
||||
color = ReturnLayerColor( CurrentLine->GetLayer() ) ^ HIGHT_LIGHT_FLAG;
|
||||
|
||||
if( erase )
|
||||
{
|
||||
segment = CurrentLine;
|
||||
while( segment )
|
||||
{
|
||||
if( !segment->IsNull() ) // Redraw if segment length != 0
|
||||
RedrawOneStruct( panel, DC, segment, g_XorMode, color );
|
||||
segment = segment->Next();
|
||||
}
|
||||
}
|
||||
|
||||
wxPoint endpos = panel->GetScreen()->m_Curseur;
|
||||
if( g_HVLines ) /* Coerce the line to vertical or horizontal one: */
|
||||
{
|
||||
ComputeBreakPoint( CurrentLine, endpos );
|
||||
}
|
||||
else
|
||||
CurrentLine->m_End = endpos;
|
||||
|
||||
segment = CurrentLine;
|
||||
while( segment )
|
||||
{
|
||||
if( !segment->IsNull() ) // Redraw if segment length != 0
|
||||
RedrawOneStruct( panel, DC, segment, g_XorMode, color );
|
||||
segment = segment->Next();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* compute the middle coordinate for 2 segments, from the start point to
|
||||
* new_pos
|
||||
* with the 2 segments kept H or V only
|
||||
|
@ -389,13 +402,12 @@ static void ComputeBreakPoint( SCH_LINE* segment, const wxPoint& new_pos )
|
|||
#else
|
||||
int iDx = segment->m_End.x - segment->m_Start.x;
|
||||
int iDy = segment->m_End.y - segment->m_Start.y;
|
||||
if( iDy != 0 ) // keep the first segment orientation (currently
|
||||
// horizontal)
|
||||
|
||||
if( iDy != 0 ) // keep the first segment orientation (currently horizontal)
|
||||
{
|
||||
middle_position.x = segment->m_Start.x;
|
||||
}
|
||||
else if( iDx != 0 ) // keep the first segment orientation (currently
|
||||
// vertical)
|
||||
else if( iDx != 0 ) // keep the first segment orientation (currently vertical)
|
||||
{
|
||||
middle_position.y = segment->m_Start.y;
|
||||
}
|
||||
|
@ -418,9 +430,7 @@ static void ComputeBreakPoint( SCH_LINE* segment, const wxPoint& new_pos )
|
|||
|
||||
/* Drawing Polyline phantom at the displacement of the cursor
|
||||
*/
|
||||
static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel,
|
||||
wxDC* DC,
|
||||
bool erase )
|
||||
static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
||||
{
|
||||
SCH_POLYLINE* NewPoly = (SCH_POLYLINE*) panel->GetScreen()->GetCurItem();
|
||||
int color;
|
||||
|
@ -453,7 +463,7 @@ static void Show_Polyline_in_Ghost( WinEDA_DrawPanel* panel,
|
|||
/*
|
||||
* Erase the last trace or the element at the current mouse position.
|
||||
*/
|
||||
void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC )
|
||||
void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
|
||||
{
|
||||
g_ItemToRepeat = NULL;
|
||||
|
||||
|
@ -470,11 +480,10 @@ void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC )
|
|||
}
|
||||
else
|
||||
{
|
||||
Segment_in_Ghost( DrawPanel, DC, FALSE );
|
||||
DrawSegment( DrawPanel, DC, FALSE );
|
||||
}
|
||||
|
||||
EraseStruct( (SCH_ITEM*) GetScreen()->GetCurItem(),
|
||||
(SCH_SCREEN*) GetScreen() );
|
||||
EraseStruct( (SCH_ITEM*) GetScreen()->GetCurItem(), (SCH_SCREEN*) GetScreen() );
|
||||
DrawPanel->ManageCurseur = NULL;
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
}
|
||||
|
@ -482,8 +491,9 @@ void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC )
|
|||
|
||||
/* Routine to create new connection struct.
|
||||
*/
|
||||
SCH_JUNCTION* WinEDA_SchematicFrame::CreateNewJunctionStruct(
|
||||
wxDC* DC, const wxPoint& pos, bool PutInUndoList )
|
||||
SCH_JUNCTION* SCH_EDIT_FRAME::CreateNewJunctionStruct( wxDC* DC,
|
||||
const wxPoint& pos,
|
||||
bool PutInUndoList )
|
||||
{
|
||||
SCH_JUNCTION* NewJunction;
|
||||
|
||||
|
@ -495,17 +505,19 @@ SCH_JUNCTION* WinEDA_SchematicFrame::CreateNewJunctionStruct(
|
|||
RedrawOneStruct( DrawPanel, DC, NewJunction, GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CursorOn( DC ); // Display schematic cursor
|
||||
|
||||
NewJunction->SetNext( GetScreen()->EEDrawList );
|
||||
GetScreen()->EEDrawList = NewJunction;
|
||||
OnModify( );
|
||||
NewJunction->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( NewJunction );
|
||||
OnModify();
|
||||
|
||||
if( PutInUndoList )
|
||||
SaveCopyInUndoList( NewJunction, UR_NEW );
|
||||
|
||||
return NewJunction;
|
||||
}
|
||||
|
||||
|
||||
/* Routine to create new NoConnect struct. */
|
||||
SCH_NO_CONNECT* WinEDA_SchematicFrame::CreateNewNoConnectStruct( wxDC* DC )
|
||||
SCH_NO_CONNECT* SCH_EDIT_FRAME::CreateNewNoConnectStruct( wxDC* DC )
|
||||
{
|
||||
SCH_NO_CONNECT* NewNoConnect;
|
||||
|
||||
|
@ -516,9 +528,9 @@ SCH_NO_CONNECT* WinEDA_SchematicFrame::CreateNewNoConnectStruct( wxDC* DC )
|
|||
RedrawOneStruct( DrawPanel, DC, NewNoConnect, GR_DEFAULT_DRAWMODE );
|
||||
DrawPanel->CursorOn( DC ); // Display schematic cursor
|
||||
|
||||
NewNoConnect->SetNext( GetScreen()->EEDrawList );
|
||||
GetScreen()->EEDrawList = NewNoConnect;
|
||||
OnModify( );
|
||||
NewNoConnect->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( NewNoConnect );
|
||||
OnModify();
|
||||
SaveCopyInUndoList( NewNoConnect, UR_NEW );
|
||||
return NewNoConnect;
|
||||
}
|
||||
|
@ -543,7 +555,8 @@ static void AbortCreateNewLine( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
g_ItemToRepeat = NULL;
|
||||
|
||||
/* Clear m_Flags which is used in edit functions: */
|
||||
SCH_ITEM* item = Screen->EEDrawList;
|
||||
SCH_ITEM* item = Screen->GetDrawItems();
|
||||
|
||||
while( item )
|
||||
{
|
||||
item->m_Flags = 0;
|
||||
|
@ -556,7 +569,7 @@ static void AbortCreateNewLine( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
* Bus lines, text, labels
|
||||
* Labels that end with a number will be incremented.
|
||||
*/
|
||||
void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
||||
void SCH_EDIT_FRAME::RepeatDrawItem( wxDC* DC )
|
||||
{
|
||||
wxPoint new_pos;
|
||||
|
||||
|
@ -667,9 +680,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
|
||||
if( g_ItemToRepeat )
|
||||
{
|
||||
g_ItemToRepeat->SetNext( GetScreen()->EEDrawList );
|
||||
GetScreen()->EEDrawList = g_ItemToRepeat;
|
||||
TestDanglingEnds( GetScreen()->EEDrawList, NULL );
|
||||
g_ItemToRepeat->SetNext( GetScreen()->GetDrawItems() );
|
||||
GetScreen()->SetDrawItems( g_ItemToRepeat );
|
||||
TestDanglingEnds( GetScreen()->GetDrawItems(), NULL );
|
||||
RedrawOneStruct( DrawPanel, DC, g_ItemToRepeat, GR_DEFAULT_DRAWMODE );
|
||||
SaveCopyInUndoList( g_ItemToRepeat, UR_NEW );
|
||||
g_ItemToRepeat->m_Flags = 0;
|
||||
|
@ -719,7 +732,7 @@ void IncrementLabelMember( wxString& name )
|
|||
*/
|
||||
static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
||||
{
|
||||
EDA_BaseStruct* item;
|
||||
EDA_ITEM* item;
|
||||
LIB_PIN* pin;
|
||||
SCH_COMPONENT* LibItem = NULL;
|
||||
SCH_SHEET_PIN* pinsheet;
|
||||
|
@ -729,12 +742,16 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
{
|
||||
case LAYER_BUS:
|
||||
item = PickStruct( pos, screen, BUSITEM );
|
||||
|
||||
if( item )
|
||||
return TRUE;
|
||||
pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList );
|
||||
|
||||
pinsheet = LocateAnyPinSheet( pos, screen->GetDrawItems() );
|
||||
|
||||
if( pinsheet && IsBusLabel( pinsheet->m_Text ) )
|
||||
{
|
||||
itempos = pinsheet->m_Pos;
|
||||
|
||||
if( (itempos.x == pos.x) && (itempos.y == pos.y) )
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -748,10 +765,12 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
|
||||
case LAYER_WIRE:
|
||||
item = PickStruct( pos, screen, RACCORDITEM | JUNCTIONITEM );
|
||||
|
||||
if( item )
|
||||
return TRUE;
|
||||
|
||||
pin = LocateAnyPin( screen->EEDrawList, pos, &LibItem );
|
||||
pin = LocateAnyPin( screen->GetDrawItems(), pos, &LibItem );
|
||||
|
||||
if( pin && LibItem )
|
||||
{
|
||||
// Calculate the exact position of the connection point of the pin,
|
||||
|
@ -773,10 +792,12 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
|
||||
return TRUE;
|
||||
|
||||
pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList );
|
||||
pinsheet = LocateAnyPinSheet( pos, screen->GetDrawItems() );
|
||||
|
||||
if( pinsheet && !IsBusLabel( pinsheet->m_Text ) )
|
||||
{
|
||||
itempos = pinsheet->m_Pos;
|
||||
|
||||
if( ( itempos.x == pos.x ) && ( itempos.y == pos.y ) )
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -799,18 +820,17 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
* or
|
||||
* - a pin is on location pos
|
||||
*/
|
||||
bool IsJunctionNeeded( WinEDA_SchematicFrame* frame, wxPoint& pos )
|
||||
bool IsJunctionNeeded( SCH_EDIT_FRAME* frame, wxPoint& pos )
|
||||
{
|
||||
if( PickStruct( pos, frame->GetScreen(), JUNCTIONITEM ) )
|
||||
return FALSE;
|
||||
|
||||
if( PickStruct( pos, frame->GetScreen(), WIREITEM |
|
||||
EXCLUDE_WIRE_BUS_ENDPOINTS ) )
|
||||
if( PickStruct( pos, frame->GetScreen(), WIREITEM | EXCLUDE_WIRE_BUS_ENDPOINTS ) )
|
||||
{
|
||||
if( PickStruct( pos, frame->GetScreen(), WIREITEM |
|
||||
WIRE_BUS_ENDPOINTS_ONLY ) )
|
||||
if( PickStruct( pos, frame->GetScreen(), WIREITEM | WIRE_BUS_ENDPOINTS_ONLY ) )
|
||||
return TRUE;
|
||||
if( frame->LocatePinEnd( frame->GetScreen()->EEDrawList, pos ) )
|
||||
|
||||
if( frame->LocatePinEnd( frame->GetScreen()->GetDrawItems(), pos ) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,13 +111,13 @@ 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,
|
||||
SCH_ITEM* SCH_EDIT_FRAME::SchematicGeneralLocateAndDisplay( const wxPoint& refpoint,
|
||||
bool IncludePin )
|
||||
{
|
||||
SCH_ITEM* DrawStruct;
|
||||
|
@ -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;
|
||||
|
|
|
@ -25,10 +25,9 @@ void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList
|
|||
* pins, end wire or bus, and junctions if TstJunction == TRUE
|
||||
* Return this count
|
||||
*
|
||||
* Used by WinEDA_SchematicFrame::DeleteConnection()
|
||||
* Used by SCH_EDIT_FRAME::DeleteConnection()
|
||||
*/
|
||||
static int CountConnectedItems( WinEDA_SchematicFrame* frame,
|
||||
SCH_ITEM* ListStruct, wxPoint pos,
|
||||
static int CountConnectedItems( SCH_EDIT_FRAME* frame, SCH_ITEM* ListStruct, wxPoint pos,
|
||||
bool TstJunction )
|
||||
{
|
||||
SCH_ITEM* Struct;
|
||||
|
@ -72,12 +71,11 @@ static int CountConnectedItems( WinEDA_SchematicFrame* frame,
|
|||
* "ListStruct"
|
||||
* Search wire stop at an any pin
|
||||
*
|
||||
* Used by WinEDA_SchematicFrame::DeleteConnection()
|
||||
* Used by SCH_EDIT_FRAME::DeleteConnection()
|
||||
*/
|
||||
static bool MarkConnected( WinEDA_SchematicFrame* frame, SCH_ITEM* ListStruct,
|
||||
SCH_LINE* segment )
|
||||
static bool MarkConnected( SCH_EDIT_FRAME* frame, SCH_ITEM* ListStruct, SCH_LINE* segment )
|
||||
{
|
||||
EDA_BaseStruct* Struct;
|
||||
EDA_ITEM* Struct;
|
||||
|
||||
for( Struct = ListStruct; Struct != NULL; Struct = Struct->Next() )
|
||||
{
|
||||
|
@ -123,15 +121,14 @@ static bool MarkConnected( WinEDA_SchematicFrame* frame, SCH_ITEM* ListStruct,
|
|||
* Delete a connection, i.e wires or bus connected
|
||||
* stop on a node (more than 2 wires (bus) connected)
|
||||
*/
|
||||
void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
||||
void SCH_EDIT_FRAME::DeleteConnection( bool DeleteFullConnection )
|
||||
{
|
||||
wxPoint refpos = GetScreen()->m_Curseur;
|
||||
SCH_ITEM* DelStruct;
|
||||
PICKED_ITEMS_LIST pickList;
|
||||
|
||||
/* Clear .m_Flags member for all items */
|
||||
for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL;
|
||||
DelStruct = DelStruct->Next() )
|
||||
for( DelStruct = GetScreen()->GetDrawItems(); DelStruct != NULL; DelStruct = DelStruct->Next() )
|
||||
DelStruct->m_Flags = 0;
|
||||
|
||||
BreakSegmentOnJunction( (SCH_SCREEN*) GetScreen() );
|
||||
|
@ -142,8 +139,9 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
ITEM_PICKER picker(NULL, UR_DELETED);
|
||||
SCH_SCREEN* screen = (SCH_SCREEN*) GetScreen();
|
||||
// Save the list entry point of this screen
|
||||
SCH_ITEM* savedEEDrawList = screen->EEDrawList;
|
||||
DelStruct = GetScreen()->EEDrawList;
|
||||
SCH_ITEM* savedItems = screen->GetDrawItems();
|
||||
DelStruct = GetScreen()->GetDrawItems();
|
||||
|
||||
while( DelStruct
|
||||
&& ( DelStruct = PickStruct( screen->m_Curseur, screen,
|
||||
JUNCTIONITEM | WIREITEM | BUSITEM ) ) != NULL )
|
||||
|
@ -156,31 +154,32 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
pickList.PushItem(picker);
|
||||
|
||||
DelStruct = DelStruct->Next();
|
||||
screen->EEDrawList = DelStruct;
|
||||
screen->SetDrawItems( DelStruct );
|
||||
}
|
||||
|
||||
GetScreen()->EEDrawList = savedEEDrawList;
|
||||
GetScreen()->SetDrawItems( savedItems );
|
||||
|
||||
/* Mark all wires, junctions, .. connected to one of the item to delete
|
||||
*/
|
||||
if( DeleteFullConnection )
|
||||
{
|
||||
for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL;
|
||||
for( DelStruct = GetScreen()->GetDrawItems(); DelStruct != NULL;
|
||||
DelStruct = DelStruct->Next() )
|
||||
{
|
||||
if( !(DelStruct->m_Flags & SELECTEDNODE) )
|
||||
continue;
|
||||
|
||||
#define SEGM ( (SCH_LINE*) DelStruct )
|
||||
|
||||
if( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE )
|
||||
continue;
|
||||
|
||||
MarkConnected( this, GetScreen()->EEDrawList, SEGM );
|
||||
MarkConnected( this, GetScreen()->GetDrawItems(), SEGM );
|
||||
#undef SEGM
|
||||
}
|
||||
|
||||
// Search all removable wires (i.e wire with one new dangling end )
|
||||
for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL;
|
||||
for( DelStruct = GetScreen()->GetDrawItems(); DelStruct != NULL;
|
||||
DelStruct = DelStruct->Next() )
|
||||
{
|
||||
bool noconnect = FALSE;
|
||||
|
@ -200,8 +199,8 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
/* Test the SEGM->m_Start point: if this point was connected to
|
||||
* an STRUCT_DELETED wire, and now is not connected, the wire can
|
||||
* be deleted */
|
||||
EDA_BaseStruct* removed_struct;
|
||||
for( removed_struct = GetScreen()->EEDrawList;
|
||||
EDA_ITEM* removed_struct;
|
||||
for( removed_struct = GetScreen()->GetDrawItems();
|
||||
removed_struct != NULL;
|
||||
removed_struct = removed_struct->Next() )
|
||||
{
|
||||
|
@ -216,14 +215,14 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
break;
|
||||
}
|
||||
|
||||
if( WIRE && !CountConnectedItems( this, GetScreen()->EEDrawList,
|
||||
if( WIRE && !CountConnectedItems( this, GetScreen()->GetDrawItems(),
|
||||
SEGM->m_Start, TRUE ) )
|
||||
noconnect = TRUE;
|
||||
|
||||
/* Test the SEGM->m_End point: if this point was connected to
|
||||
* an STRUCT_DELETED wire, and now is not connected, the wire
|
||||
* can be deleted */
|
||||
for( removed_struct = GetScreen()->EEDrawList;
|
||||
for( removed_struct = GetScreen()->GetDrawItems();
|
||||
removed_struct != NULL;
|
||||
removed_struct = removed_struct->Next() )
|
||||
{
|
||||
|
@ -236,8 +235,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
}
|
||||
|
||||
if( removed_struct &&
|
||||
!CountConnectedItems( this, GetScreen()->EEDrawList,
|
||||
SEGM->m_End, TRUE ) )
|
||||
!CountConnectedItems( this, GetScreen()->GetDrawItems(), SEGM->m_End, TRUE ) )
|
||||
noconnect = TRUE;
|
||||
|
||||
DelStruct->m_Flags &= ~SKIP_STRUCT;
|
||||
|
@ -250,14 +248,14 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
picker.m_PickedItemType = DelStruct->Type();
|
||||
pickList.PushItem(picker);
|
||||
|
||||
DelStruct = GetScreen()->EEDrawList;
|
||||
DelStruct = GetScreen()->GetDrawItems();
|
||||
}
|
||||
#undef SEGM
|
||||
}
|
||||
|
||||
// Delete redundant junctions (junctions which connect < 3 end wires
|
||||
// and no pin are removed)
|
||||
for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL;
|
||||
for( DelStruct = GetScreen()->GetDrawItems(); DelStruct != NULL;
|
||||
DelStruct = DelStruct->Next() )
|
||||
{
|
||||
int count;
|
||||
|
@ -270,7 +268,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
if( DelStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE )
|
||||
{
|
||||
#define JUNCTION ( (SCH_JUNCTION*) DelStruct )
|
||||
count = CountConnectedItems( this, GetScreen()->EEDrawList,
|
||||
count = CountConnectedItems( this, GetScreen()->GetDrawItems(),
|
||||
JUNCTION->m_Pos, FALSE );
|
||||
if( count <= 2 )
|
||||
{
|
||||
|
@ -287,7 +285,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
|
||||
// Delete labels attached to wires
|
||||
wxPoint pos = GetScreen()->m_Curseur;
|
||||
for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL;
|
||||
for( DelStruct = GetScreen()->GetDrawItems(); DelStruct != NULL;
|
||||
DelStruct = DelStruct->Next() )
|
||||
{
|
||||
if( DelStruct->m_Flags & STRUCT_DELETED )
|
||||
|
@ -297,8 +295,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
continue;
|
||||
|
||||
GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos;
|
||||
EDA_BaseStruct* TstStruct =
|
||||
PickStruct( GetScreen()->m_Curseur, GetScreen(),
|
||||
EDA_ITEM* TstStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(),
|
||||
WIREITEM | BUSITEM );
|
||||
|
||||
if( TstStruct && TstStruct->m_Flags & STRUCT_DELETED )
|
||||
|
@ -315,7 +312,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
GetScreen()->m_Curseur = pos;
|
||||
}
|
||||
|
||||
for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL;
|
||||
for( DelStruct = GetScreen()->GetDrawItems(); DelStruct != NULL;
|
||||
DelStruct = DelStruct->Next() )
|
||||
DelStruct->m_Flags = 0;
|
||||
|
||||
|
@ -341,7 +338,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
|
|||
*
|
||||
* return TRUE if an item was deleted
|
||||
*/
|
||||
bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC )
|
||||
bool LocateAndDeleteItem( SCH_EDIT_FRAME* frame, wxDC* DC )
|
||||
{
|
||||
SCH_ITEM* DelStruct;
|
||||
SCH_SCREEN* screen = (SCH_SCREEN*) ( frame->GetScreen() );
|
||||
|
@ -370,7 +367,7 @@ bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC )
|
|||
{
|
||||
g_ItemToRepeat = NULL;
|
||||
DeleteStruct( frame->DrawPanel, DC, DelStruct );
|
||||
frame->TestDanglingEnds( frame->GetScreen()->EEDrawList, DC );
|
||||
frame->TestDanglingEnds( frame->GetScreen()->GetDrawItems(), DC );
|
||||
frame->OnModify( );
|
||||
item_deleted = TRUE;
|
||||
}
|
||||
|
@ -392,7 +389,7 @@ bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC )
|
|||
*/
|
||||
void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
|
||||
{
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_ITEM* DrawList;
|
||||
|
||||
if( DrawStruct == NULL )
|
||||
return;
|
||||
|
@ -414,14 +411,15 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
|
|||
}
|
||||
else
|
||||
{
|
||||
if( DrawStruct == Screen->EEDrawList )
|
||||
if( DrawStruct == Screen->GetDrawItems() )
|
||||
{
|
||||
Screen->EEDrawList = DrawStruct->Next();
|
||||
Screen->SetDrawItems( DrawStruct->Next() );
|
||||
SAFE_DELETE( DrawStruct );
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawList = Screen->EEDrawList;
|
||||
DrawList = Screen->GetDrawItems();
|
||||
|
||||
while( DrawList && DrawList->Next() )
|
||||
{
|
||||
if( DrawList->Next() == DrawStruct )
|
||||
|
@ -444,17 +442,17 @@ void DeleteAllMarkers( int type )
|
|||
SCH_MARKER* Marker;
|
||||
SCH_SCREENS ScreenList;
|
||||
|
||||
for( screen = ScreenList.GetFirst(); screen != NULL;
|
||||
screen = ScreenList.GetNext() )
|
||||
for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
|
||||
{
|
||||
for( DrawStruct = screen->EEDrawList; DrawStruct != NULL;
|
||||
DrawStruct = NextStruct )
|
||||
for( DrawStruct = screen->GetDrawItems(); DrawStruct != NULL; DrawStruct = NextStruct )
|
||||
{
|
||||
NextStruct = DrawStruct->Next();
|
||||
|
||||
if( DrawStruct->Type() != TYPE_SCH_MARKER )
|
||||
continue;
|
||||
|
||||
Marker = (SCH_MARKER*) DrawStruct;
|
||||
|
||||
if( Marker->GetMarkerType() != type )
|
||||
continue;
|
||||
|
||||
|
|
|
@ -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;
|
||||
EDA_ITEM* DrawStruct;
|
||||
EDA_ITEM* EEDrawList;
|
||||
wxString msg;
|
||||
WinEDA_SchematicFrame* frame;
|
||||
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,7 +107,7 @@ 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_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
|
||||
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
|
||||
SCH_SCREEN* schscreen = schframe->GetScreen();
|
||||
oldscreen = schscreen;
|
||||
|
|
|
@ -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,7 +861,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal(
|
|||
std::vector <OBJ_CMP_TO_LIST>& aList,
|
||||
bool aIncludeSubComponents )
|
||||
{
|
||||
EDA_BaseStruct* schItem;
|
||||
EDA_ITEM* schItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
LIB_COMPONENT* entry;
|
||||
std::string CmpName;
|
||||
|
|
|
@ -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,11 +16,11 @@
|
|||
*/
|
||||
class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP
|
||||
{
|
||||
friend void InstallCmpeditFrame( WinEDA_SchematicFrame* parent,
|
||||
friend void InstallCmpeditFrame( SCH_EDIT_FRAME* parent,
|
||||
wxPoint& pos,
|
||||
SCH_COMPONENT* aComponent );
|
||||
|
||||
WinEDA_SchematicFrame* m_Parent;
|
||||
SCH_EDIT_FRAME* m_Parent;
|
||||
SCH_COMPONENT* m_Cmp;
|
||||
LIB_COMPONENT* m_LibEntry;
|
||||
bool m_skipCopyFromPanel;
|
||||
|
|
|
@ -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_EDIT_FRAME* m_Parent;
|
||||
SCH_TEXT* m_CurrentText;
|
||||
wxTextCtrl * m_textLabel;
|
||||
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,7 +25,7 @@
|
|||
#include "dialog_eeschema_config.h"
|
||||
|
||||
|
||||
DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* aSchFrame,
|
||||
DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( SCH_EDIT_FRAME* aSchFrame,
|
||||
WinEDA_DrawFrame* aParent )
|
||||
: DIALOG_EESCHEMA_CONFIG_FBP( aParent )
|
||||
{
|
||||
|
|
|
@ -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,7 +32,7 @@ class DIALOG_ERC : public DIALOG_ERC_BASE
|
|||
DECLARE_EVENT_TABLE()
|
||||
|
||||
private:
|
||||
WinEDA_SchematicFrame* m_Parent;
|
||||
SCH_EDIT_FRAME* m_Parent;
|
||||
wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX];
|
||||
bool m_Initialized;
|
||||
static bool m_writeErcFile;
|
||||
|
@ -40,7 +40,7 @@ private:
|
|||
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,7 +143,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::initOptVars()
|
|||
|
||||
void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
|
||||
{
|
||||
WinEDA_SchematicFrame* schframe = (WinEDA_SchematicFrame*) m_Parent;
|
||||
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
|
||||
SCH_SCREEN* screen = schframe->GetScreen();
|
||||
SCH_SCREEN* oldscreen = screen;
|
||||
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
|
||||
|
@ -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,7 +189,7 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
wxPoint pos;
|
||||
int fieldNdx;
|
||||
|
||||
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->GetParent();
|
||||
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) panel->GetParent();
|
||||
SCH_FIELD* currentField = frame->GetCurrentField();
|
||||
|
||||
if( currentField == NULL )
|
||||
|
@ -220,7 +220,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
Panel->ForceCloseManageCurseur = NULL;
|
||||
Panel->ManageCurseur = NULL;
|
||||
|
||||
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) Panel->GetParent();
|
||||
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) Panel->GetParent();
|
||||
SCH_FIELD* currentField = frame->GetCurrentField();
|
||||
|
||||
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 );
|
||||
|
|
|
@ -106,7 +106,7 @@ IMPLEMENT_APP( WinEDA_App )
|
|||
void WinEDA_App::MacOpenFile( const wxString &fileName )
|
||||
{
|
||||
wxFileName filename = fileName;
|
||||
WinEDA_SchematicFrame * frame = ((WinEDA_SchematicFrame*) GetTopWindow());
|
||||
SCH_EDIT_FRAME* frame = ((SCH_EDIT_FRAME*) GetTopWindow());
|
||||
|
||||
if( !frame )
|
||||
return;
|
||||
|
@ -128,7 +128,7 @@ bool WinEDA_App::OnInit()
|
|||
#endif /* __WXMAC__ */
|
||||
|
||||
wxFileName filename;
|
||||
WinEDA_SchematicFrame* frame = NULL;
|
||||
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,21 +166,20 @@ 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;
|
||||
|
||||
GetBaseScreen()->GetGrids( grid_list );
|
||||
|
||||
DIALOG_EESCHEMA_OPTIONS dlg( this );
|
||||
|
||||
wxLogDebug( wxT( "Current grid array index %d." ),
|
||||
grid_list.Index( GetBaseScreen()->GetGrid() ) );
|
||||
|
||||
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,7 +99,7 @@ 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,
|
||||
SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_reference,
|
||||
bool Find_in_hierarchy,
|
||||
int SearchType,
|
||||
const wxString& text_to_find,
|
||||
|
@ -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,7 +61,7 @@ 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,
|
||||
SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
|
||||
const wxString& libname,
|
||||
wxArrayString& HistoryList,
|
||||
bool UseLibBrowser )
|
||||
|
@ -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,7 +79,7 @@ WinEDA_Tree::WinEDA_Tree( WinEDA_HierFrame* parent ) :
|
|||
class WinEDA_HierFrame : public wxDialog
|
||||
{
|
||||
public:
|
||||
WinEDA_SchematicFrame* m_Parent;
|
||||
SCH_EDIT_FRAME* m_Parent;
|
||||
WinEDA_Tree* m_Tree;
|
||||
int m_nbsheets;
|
||||
wxDC* m_DC;
|
||||
|
@ -89,7 +89,7 @@ private:
|
|||
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,7 +355,7 @@ 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 SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileName,
|
||||
bool aUse_netnames )
|
||||
{
|
||||
bool ret = true;
|
||||
|
@ -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,7 +525,7 @@ 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 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;
|
||||
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,10 +321,10 @@ 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();
|
||||
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,7 +212,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMe
|
|||
|
||||
default:
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "WinEDA_SchematicFrame::OnRightClick Error: unknown DrawType %d" ),
|
||||
msg.Printf( wxT( "SCH_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
|
||||
DrawStruct->Type() );
|
||||
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 );
|
||||
|
|
|
@ -82,7 +82,7 @@ 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();
|
||||
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) panel->GetParent();
|
||||
PICKED_ITEMS_LIST itemsList;
|
||||
ITEM_PICKER itemWrapper;
|
||||
|
||||
|
@ -91,11 +91,11 @@ void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList )
|
|||
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 \
|
||||
wxMessageBox( wxT("DeleteItemsInList() err: unexpected \
|
||||
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE" ) );
|
||||
}
|
||||
else
|
||||
|
@ -119,7 +119,7 @@ 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_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(),
|
||||
frame->SaveCopyInUndoList( (SCH_ITEM*)( (SCH_SHEET_PIN*) DrawStruct )->GetParent(),
|
||||
UR_CHANGED );
|
||||
frame->DeleteSheetLabel( DC ? true : false,
|
||||
(SCH_SHEET_PIN*) DrawStruct );
|
||||
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,7 +372,7 @@ 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;
|
||||
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,7 +449,7 @@ 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;
|
||||
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
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "sch_sheet.h"
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||
{
|
||||
int id = event.GetId();
|
||||
wxPoint pos;
|
||||
|
@ -125,8 +125,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
||||
if( screen->m_BlockLocate.m_Command != BLOCK_IDLE )
|
||||
DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
|
||||
DrawPanel->
|
||||
m_PanelDefaultCursor ) );
|
||||
DrawPanel->m_PanelDefaultCursor ) );
|
||||
|
||||
// Stop the current command (if any) but keep the current tool
|
||||
DrawPanel->UnManageCursor();
|
||||
|
@ -150,8 +149,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
default:
|
||||
|
||||
// Stop the current command and deselect the current tool
|
||||
DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor =
|
||||
wxCURSOR_ARROW;
|
||||
DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor = wxCURSOR_ARROW;
|
||||
DrawPanel->UnManageCursor( 0, DrawPanel->m_PanelCursor );
|
||||
break;
|
||||
}
|
||||
|
@ -279,26 +277,22 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
||||
&dc, TYPE_SCH_LABEL );
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(), &dc, TYPE_SCH_LABEL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
||||
&dc, TYPE_SCH_GLOBALLABEL );
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(), &dc, TYPE_SCH_GLOBALLABEL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
||||
&dc, TYPE_SCH_HIERLABEL );
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(), &dc, TYPE_SCH_HIERLABEL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
||||
&dc, TYPE_SCH_TEXT );
|
||||
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(), &dc, TYPE_SCH_TEXT );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_SET_SHAPE_TEXT:
|
||||
|
@ -321,7 +315,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
DeleteConnection( id == ID_POPUP_SCH_DELETE_CONNECTION ? TRUE : FALSE );
|
||||
screen->SetCurItem( NULL );
|
||||
g_ItemToRepeat = NULL;
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
TestDanglingEnds( screen->GetDrawItems(), &dc );
|
||||
DrawPanel->Refresh();
|
||||
break;
|
||||
|
||||
|
@ -330,9 +324,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
DrawPanel->MouseToCursorSchema();
|
||||
SCH_ITEM* oldWiresList = screen->ExtractWires( true );
|
||||
BreakSegment( screen, screen->m_Curseur );
|
||||
|
||||
if( oldWiresList )
|
||||
SaveCopyInUndoList( oldWiresList, UR_WIRE_IMAGE );
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
|
||||
TestDanglingEnds( screen->GetDrawItems(), &dc );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -348,13 +344,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_SCH_DELETE:
|
||||
{
|
||||
SCH_ITEM* item = screen->GetCurItem();
|
||||
|
||||
if( item == NULL )
|
||||
break;
|
||||
|
||||
DeleteStruct( DrawPanel, &dc, item );
|
||||
screen->SetCurItem( NULL );
|
||||
g_ItemToRepeat = NULL;
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
TestDanglingEnds( screen->GetDrawItems(), &dc );
|
||||
SetSheetNumberAndCount();
|
||||
OnModify();
|
||||
}
|
||||
|
@ -372,7 +369,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_SCH_RESIZE_SHEET:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ReSizeSheet( (SCH_SHEET*) screen->GetCurItem(), &dc );
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
TestDanglingEnds( screen->GetDrawItems(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_EDIT_SHEET:
|
||||
|
@ -429,20 +426,21 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
&& (screen->GetCurItem()->Type() != TYPE_SCH_HIERLABEL)
|
||||
&& (screen->GetCurItem()->Type() != DRAW_SHEET_STRUCT_TYPE) )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
// fall through
|
||||
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
|
||||
if( id == ID_POPUP_SCH_DRAG_CMP_REQUEST )
|
||||
{
|
||||
// The easiest way to handle a drag component or sheet command
|
||||
// is to simulate a block drag command
|
||||
if( screen->m_BlockLocate.m_State == STATE_NO_BLOCK )
|
||||
{
|
||||
if( !HandleBlockBegin( &dc, BLOCK_DRAG,
|
||||
screen->m_Curseur ) )
|
||||
if( !HandleBlockBegin( &dc, BLOCK_DRAG, screen->m_Curseur ) )
|
||||
break;
|
||||
|
||||
// Give a non null size to the search block:
|
||||
|
@ -461,8 +459,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// block drag command
|
||||
if( screen->m_BlockLocate.m_State == STATE_NO_BLOCK )
|
||||
{
|
||||
if( !HandleBlockBegin( &dc, BLOCK_DRAG,
|
||||
screen->m_Curseur ) )
|
||||
if( !HandleBlockBegin( &dc, BLOCK_DRAG, screen->m_Curseur ) )
|
||||
break;
|
||||
|
||||
// Ensure the block selection contains the segment, or one end of
|
||||
|
@ -474,12 +471,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// only if they do not cross a component
|
||||
// TODO: a better way to drag only wires
|
||||
SCH_LINE* segm = (SCH_LINE*) screen->GetCurItem();
|
||||
|
||||
if( !screen->m_BlockLocate.Inside( segm->m_Start )
|
||||
&& !screen->m_BlockLocate.Inside( segm->m_End ) )
|
||||
{
|
||||
screen->m_BlockLocate.SetOrigin( segm->m_Start );
|
||||
screen->m_BlockLocate.SetEnd( segm->m_End );
|
||||
}
|
||||
|
||||
HandleBlockEnd( &dc );
|
||||
}
|
||||
break;
|
||||
|
@ -490,10 +489,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
InstallCmpeditFrame( this, pos,
|
||||
(SCH_COMPONENT*) screen->GetCurItem() );
|
||||
|
||||
InstallCmpeditFrame( this, pos, (SCH_COMPONENT*) screen->GetCurItem() );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_MIROR_X_CMP:
|
||||
|
@ -506,6 +506,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
{
|
||||
|
@ -531,12 +532,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
if( screen->GetCurItem()->m_Flags == 0 )
|
||||
SaveCopyInUndoList( (SCH_ITEM*) screen->GetCurItem(),
|
||||
UR_CHANGED );
|
||||
|
||||
CmpRotationMiroir( (SCH_COMPONENT*) screen->GetCurItem(),
|
||||
&dc, option );
|
||||
if( screen->GetCurItem()->m_Flags == 0 )
|
||||
SaveCopyInUndoList( (SCH_ITEM*) screen->GetCurItem(), UR_CHANGED );
|
||||
|
||||
CmpRotationMiroir( (SCH_COMPONENT*) screen->GetCurItem(), &dc, option );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -550,11 +550,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
EditComponentValue(
|
||||
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
||||
EditComponentValue( (SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_EDIT_REF_CMP:
|
||||
|
@ -563,6 +563,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
|
@ -575,8 +576,10 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
EditComponentFootprint( (SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
|
@ -587,12 +590,12 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertPart(
|
||||
(SCH_COMPONENT*) screen->GetCurItem(),
|
||||
&dc );
|
||||
ConvertPart( (SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_SELECT_UNIT1:
|
||||
|
@ -626,8 +629,10 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
SelPartUnit( (SCH_COMPONENT*) screen->GetCurItem(),
|
||||
id + 1 - ID_POPUP_SCH_SELECT_UNIT1, &dc );
|
||||
|
@ -639,6 +644,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
// component, like Field, text..)
|
||||
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
||||
|
||||
if( screen->GetCurItem() == NULL )
|
||||
break;
|
||||
{
|
||||
|
@ -656,7 +662,8 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
case ID_POPUP_SCH_ENTER_SHEET:
|
||||
{
|
||||
EDA_BaseStruct* DrawStruct = screen->GetCurItem();
|
||||
EDA_ITEM* DrawStruct = screen->GetCurItem();
|
||||
|
||||
if( DrawStruct && (DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE) )
|
||||
{
|
||||
InstallNextScreen( (SCH_SHEET*) DrawStruct );
|
||||
|
@ -719,35 +726,31 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
case ID_POPUP_SCH_ADD_JUNCTION:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
screen->SetCurItem( CreateNewJunctionStruct( &dc, screen->m_Curseur,
|
||||
true ) );
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
screen->SetCurItem( CreateNewJunctionStruct( &dc, screen->m_Curseur, true ) );
|
||||
TestDanglingEnds( screen->GetDrawItems(), &dc );
|
||||
screen->SetCurItem( NULL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_ADD_LABEL:
|
||||
case ID_POPUP_SCH_ADD_GLABEL:
|
||||
screen->SetCurItem(
|
||||
CreateNewText( &dc,
|
||||
id == ID_POPUP_SCH_ADD_LABEL ?
|
||||
screen->SetCurItem( CreateNewText( &dc, id == ID_POPUP_SCH_ADD_LABEL ?
|
||||
LAYER_LOCLABEL : LAYER_GLOBLABEL ) );
|
||||
if( screen->GetCurItem() )
|
||||
{
|
||||
( (SCH_ITEM*) screen->GetCurItem() )->Place( this, &dc );
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
TestDanglingEnds( screen->GetDrawItems(), &dc );
|
||||
screen->SetCurItem( NULL );
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_GETINFO_MARKER:
|
||||
if( screen->GetCurItem()
|
||||
&& screen->GetCurItem()->Type() == TYPE_SCH_MARKER )
|
||||
if( screen->GetCurItem() && screen->GetCurItem()->Type() == TYPE_SCH_MARKER )
|
||||
( (SCH_MARKER*) screen->GetCurItem() )->DisplayMarkerInfo( this );
|
||||
|
||||
break;
|
||||
|
||||
default: // Log error:
|
||||
DisplayError( this,
|
||||
wxT( "WinEDA_SchematicFrame::Process_Special_Functions error" ) );
|
||||
DisplayError( this, wxT( "SCH_EDIT_FRAME::Process_Special_Functions error" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -755,11 +758,12 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
if( m_ID_current_state == 0 )
|
||||
g_ItemToRepeat = NULL;
|
||||
|
||||
SetToolbars();
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
|
||||
void SCH_EDIT_FRAME::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
|
||||
{
|
||||
if( DrawStruct == NULL )
|
||||
return;
|
||||
|
@ -804,8 +808,7 @@ void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
|
|||
case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
|
||||
default:
|
||||
wxString msg;
|
||||
msg.Printf(
|
||||
wxT( "WinEDA_SchematicFrame::Move_Item Error: Bad DrawType %d" ),
|
||||
msg.Printf( wxT( "SCH_EDIT_FRAME::Move_Item Error: Bad DrawType %d" ),
|
||||
DrawStruct->Type() );
|
||||
DisplayError( this, msg );
|
||||
break;
|
||||
|
|
|
@ -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,7 +207,7 @@ 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,
|
||||
void SCH_EDIT_FRAME::SaveCopyInUndoList( SCH_ITEM* aItem,
|
||||
UndoRedoOpType aCommandType,
|
||||
const wxPoint& aTransformPoint )
|
||||
{
|
||||
|
@ -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,7 +276,7 @@ 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,
|
||||
void SCH_EDIT_FRAME::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
||||
UndoRedoOpType aTypeCommand,
|
||||
const wxPoint& aTransformPoint )
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -38,115 +38,114 @@
|
|||
#include "dialogs/dialog_SVG_print.h"
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
|
||||
BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, WinEDA_DrawFrame )
|
||||
EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, WinEDA_DrawFrame::OnSockRequestServer )
|
||||
EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_DrawFrame::OnSockRequest )
|
||||
|
||||
EVT_CLOSE( WinEDA_SchematicFrame::OnCloseWindow )
|
||||
EVT_SIZE( WinEDA_SchematicFrame::OnSize )
|
||||
EVT_CLOSE( SCH_EDIT_FRAME::OnCloseWindow )
|
||||
EVT_SIZE( SCH_EDIT_FRAME::OnSize )
|
||||
|
||||
EVT_MENU( ID_NEW_PROJECT, WinEDA_SchematicFrame::OnNewProject )
|
||||
EVT_MENU( ID_LOAD_PROJECT, WinEDA_SchematicFrame::OnLoadProject )
|
||||
EVT_MENU( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject )
|
||||
EVT_MENU( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject )
|
||||
|
||||
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_SchematicFrame::OnLoadFile )
|
||||
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile )
|
||||
|
||||
EVT_TOOL( ID_NEW_PROJECT, WinEDA_SchematicFrame::OnNewProject )
|
||||
EVT_TOOL( ID_LOAD_PROJECT, WinEDA_SchematicFrame::OnLoadProject )
|
||||
EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject )
|
||||
EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject )
|
||||
|
||||
EVT_MENU( ID_SAVE_PROJECT, WinEDA_SchematicFrame::Save_File )
|
||||
EVT_MENU( ID_SAVE_ONE_SHEET, WinEDA_SchematicFrame::Save_File )
|
||||
EVT_MENU( ID_SAVE_ONE_SHEET_AS, WinEDA_SchematicFrame::Save_File )
|
||||
EVT_TOOL( ID_SAVE_PROJECT, WinEDA_SchematicFrame::Save_File )
|
||||
EVT_MENU( wxID_PRINT, WinEDA_SchematicFrame::OnPrint )
|
||||
EVT_MENU( ID_GEN_PLOT_PS, WinEDA_SchematicFrame::ToPlot_PS )
|
||||
EVT_MENU( ID_GEN_PLOT_HPGL, WinEDA_SchematicFrame::ToPlot_HPGL )
|
||||
EVT_MENU( ID_GEN_PLOT_SVG, WinEDA_SchematicFrame::SVG_Print )
|
||||
EVT_MENU( ID_GEN_PLOT_DXF, WinEDA_SchematicFrame::ToPlot_DXF )
|
||||
EVT_MENU( ID_SAVE_PROJECT, SCH_EDIT_FRAME::Save_File )
|
||||
EVT_MENU( ID_SAVE_ONE_SHEET, SCH_EDIT_FRAME::Save_File )
|
||||
EVT_MENU( ID_SAVE_ONE_SHEET_AS, SCH_EDIT_FRAME::Save_File )
|
||||
EVT_TOOL( ID_SAVE_PROJECT, SCH_EDIT_FRAME::Save_File )
|
||||
EVT_MENU( wxID_PRINT, SCH_EDIT_FRAME::OnPrint )
|
||||
EVT_MENU( ID_GEN_PLOT_PS, SCH_EDIT_FRAME::ToPlot_PS )
|
||||
EVT_MENU( ID_GEN_PLOT_HPGL, SCH_EDIT_FRAME::ToPlot_HPGL )
|
||||
EVT_MENU( ID_GEN_PLOT_SVG, SCH_EDIT_FRAME::SVG_Print )
|
||||
EVT_MENU( ID_GEN_PLOT_DXF, SCH_EDIT_FRAME::ToPlot_DXF )
|
||||
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
||||
EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
||||
EVT_MENU( wxID_EXIT, WinEDA_SchematicFrame::OnExit )
|
||||
EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
|
||||
|
||||
EVT_MENU( ID_POPUP_SCH_COPY_ITEM, WinEDA_SchematicFrame::OnCopySchematicItemRequest )
|
||||
EVT_MENU( ID_POPUP_SCH_COPY_ITEM, SCH_EDIT_FRAME::OnCopySchematicItemRequest )
|
||||
|
||||
EVT_MENU( ID_CONFIG_REQ, WinEDA_SchematicFrame::InstallConfigFrame )
|
||||
EVT_MENU( ID_CONFIG_SAVE, WinEDA_SchematicFrame::Process_Config )
|
||||
EVT_MENU( ID_CONFIG_READ, WinEDA_SchematicFrame::Process_Config )
|
||||
EVT_MENU( ID_CONFIG_REQ, SCH_EDIT_FRAME::InstallConfigFrame )
|
||||
EVT_MENU( ID_CONFIG_SAVE, SCH_EDIT_FRAME::Process_Config )
|
||||
EVT_MENU( ID_CONFIG_READ, SCH_EDIT_FRAME::Process_Config )
|
||||
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START,
|
||||
ID_PREFERENCES_HOTKEY_END,
|
||||
WinEDA_SchematicFrame::Process_Config )
|
||||
SCH_EDIT_FRAME::Process_Config )
|
||||
|
||||
EVT_MENU( ID_COLORS_SETUP, WinEDA_SchematicFrame::OnColorConfig )
|
||||
EVT_TOOL( ID_OPTIONS_SETUP, WinEDA_SchematicFrame::OnSetOptions )
|
||||
EVT_MENU( ID_COLORS_SETUP, SCH_EDIT_FRAME::OnColorConfig )
|
||||
EVT_TOOL( ID_OPTIONS_SETUP, SCH_EDIT_FRAME::OnSetOptions )
|
||||
|
||||
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
|
||||
WinEDA_SchematicFrame::SetLanguage )
|
||||
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, SCH_EDIT_FRAME::SetLanguage )
|
||||
|
||||
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_SchematicFrame::OnZoom )
|
||||
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, SCH_EDIT_FRAME::OnZoom )
|
||||
|
||||
EVT_TOOL( ID_TO_LIBRARY, WinEDA_SchematicFrame::OnOpenLibraryEditor )
|
||||
EVT_TOOL( ID_TO_LIBVIEW, WinEDA_SchematicFrame::OnOpenLibraryViewer )
|
||||
EVT_TOOL( ID_TO_LIBRARY, SCH_EDIT_FRAME::OnOpenLibraryEditor )
|
||||
EVT_TOOL( ID_TO_LIBVIEW, SCH_EDIT_FRAME::OnOpenLibraryViewer )
|
||||
|
||||
EVT_TOOL( ID_TO_PCB, WinEDA_SchematicFrame::OnOpenPcbnew )
|
||||
EVT_TOOL( ID_TO_CVPCB, WinEDA_SchematicFrame::OnOpenCvpcb )
|
||||
EVT_TOOL( ID_TO_PCB, SCH_EDIT_FRAME::OnOpenPcbnew )
|
||||
EVT_TOOL( ID_TO_CVPCB, SCH_EDIT_FRAME::OnOpenCvpcb )
|
||||
|
||||
EVT_TOOL( ID_SHEET_SET, WinEDA_DrawFrame::Process_PageSettings )
|
||||
EVT_TOOL( ID_HIERARCHY, WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_CUT, WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_COPY, WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_PASTE, WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_UNDO, WinEDA_SchematicFrame::GetSchematicFromUndoList )
|
||||
EVT_TOOL( wxID_REDO, WinEDA_SchematicFrame::GetSchematicFromRedoList )
|
||||
EVT_TOOL( ID_GET_ANNOTATE, WinEDA_SchematicFrame::OnAnnotate )
|
||||
EVT_TOOL( wxID_PRINT, WinEDA_SchematicFrame::OnPrint )
|
||||
EVT_TOOL( ID_GET_ERC, WinEDA_SchematicFrame::OnErc )
|
||||
EVT_TOOL( ID_GET_NETLIST, WinEDA_SchematicFrame::OnCreateNetlist )
|
||||
EVT_TOOL( ID_GET_TOOLS, WinEDA_SchematicFrame::OnCreateBillOfMaterials )
|
||||
EVT_TOOL( ID_FIND_ITEMS, WinEDA_SchematicFrame::OnFindItems )
|
||||
EVT_TOOL( ID_BACKANNO_ITEMS, WinEDA_SchematicFrame::OnLoadStuffFile )
|
||||
EVT_TOOL( ID_COMPONENT_BUTT, WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
EVT_TOOL( ID_HIERARCHY, SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_CUT, SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_COPY, SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_PASTE, SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( wxID_UNDO, SCH_EDIT_FRAME::GetSchematicFromUndoList )
|
||||
EVT_TOOL( wxID_REDO, SCH_EDIT_FRAME::GetSchematicFromRedoList )
|
||||
EVT_TOOL( ID_GET_ANNOTATE, SCH_EDIT_FRAME::OnAnnotate )
|
||||
EVT_TOOL( wxID_PRINT, SCH_EDIT_FRAME::OnPrint )
|
||||
EVT_TOOL( ID_GET_ERC, SCH_EDIT_FRAME::OnErc )
|
||||
EVT_TOOL( ID_GET_NETLIST, SCH_EDIT_FRAME::OnCreateNetlist )
|
||||
EVT_TOOL( ID_GET_TOOLS, SCH_EDIT_FRAME::OnCreateBillOfMaterials )
|
||||
EVT_TOOL( ID_FIND_ITEMS, SCH_EDIT_FRAME::OnFindItems )
|
||||
EVT_TOOL( ID_BACKANNO_ITEMS, SCH_EDIT_FRAME::OnLoadStuffFile )
|
||||
EVT_TOOL( ID_COMPONENT_BUTT, SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp )
|
||||
EVT_MENU( ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout )
|
||||
|
||||
// Tools and buttons for vertical toolbar.
|
||||
EVT_TOOL( ID_NO_SELECT_BUTT, WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
EVT_TOOL( ID_NO_SELECT_BUTT, SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL_RANGE( ID_SCHEMATIC_VERTICAL_TOOLBAR_START,
|
||||
ID_SCHEMATIC_VERTICAL_TOOLBAR_END,
|
||||
WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
|
||||
WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
// Tools and buttons options toolbar
|
||||
EVT_TOOL_RANGE( ID_TB_OPTIONS_START, ID_TB_OPTIONS_END,
|
||||
WinEDA_SchematicFrame::OnSelectOptionToolbar )
|
||||
SCH_EDIT_FRAME::OnSelectOptionToolbar )
|
||||
|
||||
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
|
||||
WinEDA_SchematicFrame::Process_Special_Functions )
|
||||
SCH_EDIT_FRAME::Process_Special_Functions )
|
||||
|
||||
/* Handle user interface update events. */
|
||||
EVT_UPDATE_UI( wxID_CUT, WinEDA_SchematicFrame::OnUpdateBlockSelected )
|
||||
EVT_UPDATE_UI( wxID_COPY, WinEDA_SchematicFrame::OnUpdateBlockSelected )
|
||||
EVT_UPDATE_UI( wxID_PASTE, WinEDA_SchematicFrame::OnUpdatePaste )
|
||||
EVT_UPDATE_UI( wxID_UNDO, WinEDA_SchematicFrame::OnUpdateSchematicUndo )
|
||||
EVT_UPDATE_UI( wxID_REDO, WinEDA_SchematicFrame::OnUpdateSchematicRedo )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_GRID, WinEDA_SchematicFrame::OnUpdateGrid )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_SELECT_CURSOR, WinEDA_SchematicFrame::OnUpdateSelectCursor )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_HIDDEN_PINS, WinEDA_SchematicFrame::OnUpdateHiddenPins )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_BUS_WIRES_ORIENT, WinEDA_SchematicFrame::OnUpdateBusOrientation )
|
||||
EVT_UPDATE_UI( wxID_CUT, SCH_EDIT_FRAME::OnUpdateBlockSelected )
|
||||
EVT_UPDATE_UI( wxID_COPY, SCH_EDIT_FRAME::OnUpdateBlockSelected )
|
||||
EVT_UPDATE_UI( wxID_PASTE, SCH_EDIT_FRAME::OnUpdatePaste )
|
||||
EVT_UPDATE_UI( wxID_UNDO, SCH_EDIT_FRAME::OnUpdateSchematicUndo )
|
||||
EVT_UPDATE_UI( wxID_REDO, SCH_EDIT_FRAME::OnUpdateSchematicRedo )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_GRID, SCH_EDIT_FRAME::OnUpdateGrid )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_SELECT_CURSOR, SCH_EDIT_FRAME::OnUpdateSelectCursor )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_HIDDEN_PINS, SCH_EDIT_FRAME::OnUpdateHiddenPins )
|
||||
EVT_UPDATE_UI( ID_TB_OPTIONS_BUS_WIRES_ORIENT, SCH_EDIT_FRAME::OnUpdateBusOrientation )
|
||||
EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SELECT_UNIT_MM,
|
||||
ID_TB_OPTIONS_SELECT_UNIT_INCH,
|
||||
WinEDA_SchematicFrame::OnUpdateUnits )
|
||||
SCH_EDIT_FRAME::OnUpdateUnits )
|
||||
|
||||
/* Search dialog events. */
|
||||
EVT_FIND_CLOSE( wxID_ANY, WinEDA_SchematicFrame::OnFindDialogClose )
|
||||
EVT_FIND_DRC_MARKER( wxID_ANY, WinEDA_SchematicFrame::OnFindDrcMarker )
|
||||
EVT_FIND( wxID_ANY, WinEDA_SchematicFrame::OnFindSchematicItem )
|
||||
EVT_FIND_CLOSE( wxID_ANY, SCH_EDIT_FRAME::OnFindDialogClose )
|
||||
EVT_FIND_DRC_MARKER( wxID_ANY, SCH_EDIT_FRAME::OnFindDrcMarker )
|
||||
EVT_FIND( wxID_ANY, SCH_EDIT_FRAME::OnFindSchematicItem )
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
|
||||
SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
|
@ -242,7 +241,7 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
|
|||
}
|
||||
|
||||
|
||||
WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
|
||||
SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
|
||||
{
|
||||
SAFE_DELETE( g_RootSheet );
|
||||
SAFE_DELETE( m_CurrentSheet ); // a SCH_SHEET_PATH, on the heap.
|
||||
|
@ -251,13 +250,13 @@ WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
|
|||
}
|
||||
|
||||
|
||||
BASE_SCREEN* WinEDA_SchematicFrame::GetBaseScreen() const
|
||||
BASE_SCREEN* SCH_EDIT_FRAME::GetBaseScreen() const
|
||||
{
|
||||
return GetScreen();
|
||||
}
|
||||
|
||||
|
||||
SCH_SHEET_PATH* WinEDA_SchematicFrame::GetSheet()
|
||||
SCH_SHEET_PATH* SCH_EDIT_FRAME::GetSheet()
|
||||
{
|
||||
return m_CurrentSheet;
|
||||
}
|
||||
|
@ -269,7 +268,7 @@ SCH_SHEET_PATH* WinEDA_SchematicFrame::GetSheet()
|
|||
* must be called after a delete or add sheet command, and when entering a
|
||||
* sheet
|
||||
*/
|
||||
void WinEDA_SchematicFrame::SetSheetNumberAndCount()
|
||||
void SCH_EDIT_FRAME::SetSheetNumberAndCount()
|
||||
{
|
||||
SCH_SCREEN* screen = GetScreen();
|
||||
SCH_SCREENS s_list;
|
||||
|
@ -304,13 +303,13 @@ void WinEDA_SchematicFrame::SetSheetNumberAndCount()
|
|||
}
|
||||
|
||||
|
||||
SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
|
||||
SCH_SCREEN* SCH_EDIT_FRAME::GetScreen() const
|
||||
{
|
||||
return m_CurrentSheet->LastScreen();
|
||||
}
|
||||
|
||||
|
||||
wxString WinEDA_SchematicFrame::GetScreenDesc()
|
||||
wxString SCH_EDIT_FRAME::GetScreenDesc()
|
||||
{
|
||||
wxString s = m_CurrentSheet->PathHumanReadable();
|
||||
|
||||
|
@ -318,7 +317,7 @@ wxString WinEDA_SchematicFrame::GetScreenDesc()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::CreateScreens()
|
||||
void SCH_EDIT_FRAME::CreateScreens()
|
||||
{
|
||||
if( g_RootSheet == NULL )
|
||||
{
|
||||
|
@ -341,7 +340,7 @@ void WinEDA_SchematicFrame::CreateScreens()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||
void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
SCH_SHEET_PATH* sheet;
|
||||
|
||||
|
@ -393,7 +392,7 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
|
|||
}
|
||||
|
||||
if( !g_RootSheet->m_AssociatedScreen->m_FileName.IsEmpty()
|
||||
&& (g_RootSheet->m_AssociatedScreen->EEDrawList != NULL) )
|
||||
&& (g_RootSheet->m_AssociatedScreen->GetDrawItems() != NULL) )
|
||||
SetLastProject( g_RootSheet->m_AssociatedScreen->m_FileName );
|
||||
|
||||
ClearProjectDrawList( g_RootSheet->m_AssociatedScreen, TRUE );
|
||||
|
@ -405,7 +404,7 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
|
|||
}
|
||||
|
||||
|
||||
int WinEDA_SchematicFrame::BestZoom()
|
||||
int SCH_EDIT_FRAME::BestZoom()
|
||||
{
|
||||
int dx, dy;
|
||||
wxSize size;
|
||||
|
@ -437,7 +436,7 @@ int WinEDA_SchematicFrame::BestZoom()
|
|||
* and has no extension.
|
||||
* However if filename is too long name is <sheet filename>-<sheet number>
|
||||
*/
|
||||
wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet()
|
||||
wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet()
|
||||
{
|
||||
wxFileName fn = g_RootSheet->GetFileName();
|
||||
|
||||
|
@ -472,7 +471,7 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet()
|
|||
* in order to set the "modify" flag of the current screen
|
||||
* and update the date in frame reference
|
||||
*/
|
||||
void WinEDA_SchematicFrame::OnModify( )
|
||||
void SCH_EDIT_FRAME::OnModify( )
|
||||
{
|
||||
GetScreen()->SetModify();
|
||||
|
||||
|
@ -494,7 +493,7 @@ void WinEDA_SchematicFrame::OnModify( )
|
|||
* conditions.
|
||||
*****************************************************************************/
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateBlockSelected( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateBlockSelected( wxUpdateUIEvent& event )
|
||||
{
|
||||
bool enable = ( GetScreen() && GetScreen()->m_BlockLocate.m_Command == BLOCK_MOVE );
|
||||
|
||||
|
@ -504,28 +503,28 @@ void WinEDA_SchematicFrame::OnUpdateBlockSelected( wxUpdateUIEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdatePaste( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdatePaste( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( g_BlockSaveDataList.GetCount() > 0 );
|
||||
m_HToolBar->EnableTool( wxID_PASTE, g_BlockSaveDataList.GetCount() > 0 );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateSchematicUndo( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateSchematicUndo( wxUpdateUIEvent& event )
|
||||
{
|
||||
if( GetScreen() )
|
||||
event.Enable( GetScreen()->GetUndoCommandCount() > 0 );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateSchematicRedo( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateSchematicRedo( wxUpdateUIEvent& event )
|
||||
{
|
||||
if( GetScreen() )
|
||||
event.Enable( GetScreen()->GetRedoCommandCount() > 0 );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateBusOrientation( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateBusOrientation( wxUpdateUIEvent& event )
|
||||
{
|
||||
wxString tool_tip = g_HVLines ?
|
||||
_( "Draw wires and buses in any direction" ) :
|
||||
|
@ -536,7 +535,7 @@ void WinEDA_SchematicFrame::OnUpdateBusOrientation( wxUpdateUIEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateHiddenPins( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& event )
|
||||
{
|
||||
wxString tool_tip = m_ShowAllPins ? _( "Do not show hidden pins" ) :
|
||||
_( "Show hidden pins" );
|
||||
|
@ -546,13 +545,13 @@ void WinEDA_SchematicFrame::OnUpdateHiddenPins( wxUpdateUIEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateSelectCursor( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateSelectCursor( wxUpdateUIEvent& event )
|
||||
{
|
||||
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR, m_CursorShape );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateUnits( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateUnits( wxUpdateUIEvent& event )
|
||||
{
|
||||
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_MM, g_UserUnit == MILLIMETRES );
|
||||
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, g_UserUnit == INCHES );
|
||||
|
@ -560,7 +559,7 @@ void WinEDA_SchematicFrame::OnUpdateUnits( wxUpdateUIEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnUpdateGrid( wxUpdateUIEvent& event )
|
||||
void SCH_EDIT_FRAME::OnUpdateGrid( wxUpdateUIEvent& event )
|
||||
{
|
||||
wxString tool_tip = IsGridVisible() ? _( "Hide grid" ) : _( "Show grid" );
|
||||
|
||||
|
@ -569,7 +568,7 @@ void WinEDA_SchematicFrame::OnUpdateGrid( wxUpdateUIEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnAnnotate( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnAnnotate( wxCommandEvent& event )
|
||||
{
|
||||
DIALOG_ANNOTATE* dlg = new DIALOG_ANNOTATE( this );
|
||||
|
||||
|
@ -578,7 +577,7 @@ void WinEDA_SchematicFrame::OnAnnotate( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnErc( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event )
|
||||
{
|
||||
DIALOG_ERC* dlg = new DIALOG_ERC( this );
|
||||
|
||||
|
@ -587,7 +586,7 @@ void WinEDA_SchematicFrame::OnErc( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnCreateNetlist( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -605,7 +604,7 @@ void WinEDA_SchematicFrame::OnCreateNetlist( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnCreateBillOfMaterials( wxCommandEvent& )
|
||||
void SCH_EDIT_FRAME::OnCreateBillOfMaterials( wxCommandEvent& )
|
||||
{
|
||||
DIALOG_BUILD_BOM* dlg = new DIALOG_BUILD_BOM( this );
|
||||
|
||||
|
@ -614,7 +613,7 @@ void WinEDA_SchematicFrame::OnCreateBillOfMaterials( wxCommandEvent& )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnFindItems( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnFindItems( wxCommandEvent& event )
|
||||
{
|
||||
wxASSERT_MSG( m_findReplaceData != NULL,
|
||||
wxT( "Forgot to create find/replace data. Bad Programmer!" ) );
|
||||
|
@ -636,7 +635,7 @@ void WinEDA_SchematicFrame::OnFindItems( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnFindDialogClose( wxFindDialogEvent& event )
|
||||
void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event )
|
||||
{
|
||||
if( m_dlgFindReplace )
|
||||
{
|
||||
|
@ -652,7 +651,7 @@ void WinEDA_SchematicFrame::OnFindDialogClose( wxFindDialogEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnLoadFile( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event )
|
||||
{
|
||||
wxString fn;
|
||||
|
||||
|
@ -666,26 +665,26 @@ void WinEDA_SchematicFrame::OnLoadFile( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnLoadStuffFile( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnLoadStuffFile( wxCommandEvent& event )
|
||||
{
|
||||
ReadInputStuffFile();
|
||||
DrawPanel->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnNewProject( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event )
|
||||
{
|
||||
LoadOneEEProject( wxEmptyString, true );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnLoadProject( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnLoadProject( wxCommandEvent& event )
|
||||
{
|
||||
LoadOneEEProject( wxEmptyString, false );
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnOpenPcbnew( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnOpenPcbnew( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn = g_RootSheet->m_AssociatedScreen->m_FileName;
|
||||
|
||||
|
@ -702,7 +701,7 @@ void WinEDA_SchematicFrame::OnOpenPcbnew( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnOpenCvpcb( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn = g_RootSheet->m_AssociatedScreen->m_FileName;
|
||||
|
||||
|
@ -717,7 +716,7 @@ void WinEDA_SchematicFrame::OnOpenCvpcb( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnOpenLibraryViewer( wxCommandEvent& event )
|
||||
{
|
||||
if( m_ViewlibFrame )
|
||||
{
|
||||
|
@ -731,7 +730,7 @@ void WinEDA_SchematicFrame::OnOpenLibraryViewer( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnOpenLibraryEditor( wxCommandEvent& event )
|
||||
{
|
||||
if( m_LibeditFrame )
|
||||
{
|
||||
|
@ -749,7 +748,7 @@ void WinEDA_SchematicFrame::OnOpenLibraryEditor( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnExit( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnExit( wxCommandEvent& event )
|
||||
{
|
||||
Close( true );
|
||||
}
|
||||
|
@ -758,7 +757,7 @@ void WinEDA_SchematicFrame::OnExit( wxCommandEvent& event )
|
|||
* Function SetLanguage
|
||||
* called on a language menu selection
|
||||
*/
|
||||
void WinEDA_SchematicFrame::SetLanguage( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::SetLanguage( wxCommandEvent& event )
|
||||
{
|
||||
WinEDA_BasicFrame::SetLanguage( event );
|
||||
|
||||
|
@ -767,7 +766,7 @@ void WinEDA_SchematicFrame::SetLanguage( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn;
|
||||
DIALOG_PRINT_USING_PRINTER dlg( this );
|
||||
|
@ -788,7 +787,7 @@ void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event )
|
|||
|
||||
/* Creates the SVG print file for the current edited component.
|
||||
*/
|
||||
void WinEDA_SchematicFrame::SVG_Print( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
|
||||
{
|
||||
DIALOG_SVG_PRINT frame( this );
|
||||
|
||||
|
|
|
@ -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;
|
||||
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();
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
/* Create the main Horizontal Toolbar for the schematic editor
|
||||
*/
|
||||
void WinEDA_SchematicFrame::ReCreateHToolbar()
|
||||
void SCH_EDIT_FRAME::ReCreateHToolbar()
|
||||
{
|
||||
if( m_HToolBar != NULL )
|
||||
return;
|
||||
|
@ -141,7 +141,7 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
|
|||
|
||||
/* Create Vertical Right Toolbar
|
||||
*/
|
||||
void WinEDA_SchematicFrame::ReCreateVToolbar()
|
||||
void SCH_EDIT_FRAME::ReCreateVToolbar()
|
||||
{
|
||||
if( m_VToolBar )
|
||||
return;
|
||||
|
@ -238,7 +238,7 @@ void WinEDA_SchematicFrame::ReCreateVToolbar()
|
|||
|
||||
/* Create Vertical Left Toolbar (Option Toolbar)
|
||||
*/
|
||||
void WinEDA_SchematicFrame::ReCreateOptToolbar()
|
||||
void SCH_EDIT_FRAME::ReCreateOptToolbar()
|
||||
{
|
||||
if( m_OptionsToolBar )
|
||||
return;
|
||||
|
@ -279,7 +279,7 @@ void WinEDA_SchematicFrame::ReCreateOptToolbar()
|
|||
}
|
||||
|
||||
|
||||
void WinEDA_SchematicFrame::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||
void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||
{
|
||||
if( DrawPanel == NULL )
|
||||
return;
|
||||
|
|
|
@ -240,7 +240,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
|
|||
|
||||
LIB_VIEW_FRAME::~LIB_VIEW_FRAME()
|
||||
{
|
||||
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) wxGetApp().GetTopWindow();
|
||||
SCH_EDIT_FRAME* frame = (SCH_EDIT_FRAME*) wxGetApp().GetTopWindow();
|
||||
frame->m_ViewlibFrame = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -336,11 +336,11 @@ void GERBER_DRAW_ITEM::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode,
|
|||
if( aDrawMode & GR_SURBRILL )
|
||||
{
|
||||
if( aDrawMode & GR_AND )
|
||||
color &= ~HIGHT_LIGHT_FLAG;
|
||||
color &= ~HIGHLIGHT_FLAG;
|
||||
else
|
||||
color |= HIGHT_LIGHT_FLAG;
|
||||
color |= HIGHLIGHT_FLAG;
|
||||
}
|
||||
if( color & HIGHT_LIGHT_FLAG )
|
||||
if( color & HIGHLIGHT_FLAG )
|
||||
color = ColorRefs[color & MASKCOLOR].m_LightColor;
|
||||
|
||||
alt_color = g_DrawBgColor;
|
||||
|
|
|
@ -54,8 +54,8 @@ class GERBER_DRAW_ITEM : public BOARD_ITEM
|
|||
// make SetNext() and SetBack() private so that they may not be called from anywhere.
|
||||
// list management is done on GERBER_DRAW_ITEMs using DLIST<GERBER_DRAW_ITEM> only.
|
||||
private:
|
||||
void SetNext( EDA_BaseStruct* aNext ) { Pnext = aNext; }
|
||||
void SetBack( EDA_BaseStruct* aBack ) { Pback = aBack; }
|
||||
void SetNext( EDA_ITEM* aNext ) { Pnext = aNext; }
|
||||
void SetBack( EDA_ITEM* aBack ) { Pback = aBack; }
|
||||
|
||||
|
||||
public:
|
||||
|
@ -218,7 +218,7 @@ public:
|
|||
* Function DisplayInfo
|
||||
* has knowledge about the frame and how and where to put status information
|
||||
* about this object into the frame's message panel.
|
||||
* Is virtual from EDA_BaseStruct.
|
||||
* Is virtual from EDA_ITEM.
|
||||
* Display info about this GERBER item
|
||||
* @param frame A WinEDA_DrawFrame in which to print status information.
|
||||
*/
|
||||
|
|
|
@ -158,8 +158,10 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
|
|||
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
||||
int pointSize = font.GetPointSize();
|
||||
int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
|
||||
|
||||
if( screenHeight <= 900 )
|
||||
pointSize = (pointSize * 8) / 10;
|
||||
|
||||
m_LayersManager = new GERBER_LAYER_WIDGET( this, DrawPanel, pointSize );
|
||||
|
||||
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
||||
|
@ -202,7 +204,8 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
|
|||
m_auimgr.AddPane( m_VToolBar,
|
||||
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right().Row( 1 ) );
|
||||
|
||||
m_auimgr.AddPane( m_LayersManager, lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Row( 0 ) );
|
||||
m_auimgr.AddPane( m_LayersManager,
|
||||
lyrs.Name( wxT( "m_LayersManagerToolBar" ) ).Right().Row( 0 ) );
|
||||
|
||||
if( m_OptionsToolBar )
|
||||
m_auimgr.AddPane( m_OptionsToolBar,
|
||||
|
@ -249,12 +252,15 @@ int WinEDA_GerberFrame::BestZoom()
|
|||
EDA_Rect bbox;
|
||||
|
||||
BOARD_ITEM* item = GetBoard()->m_Drawings;
|
||||
|
||||
for( ; item; item = item->Next() )
|
||||
{
|
||||
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
|
||||
bbox.Merge( gerb_item->GetBoundingBox() );
|
||||
}
|
||||
bbox.Inflate( GetScreen()->GetGridSize().x * 2, GetScreen()->GetGridSize().y * 2);
|
||||
|
||||
bbox.Inflate( wxRound( GetScreen()->GetGridSize().x * 2 ),
|
||||
wxRound( GetScreen()->GetGridSize().y * 2 ) );
|
||||
wxSize size = DrawPanel->GetClientSize();
|
||||
x = bbox.GetWidth() / (double) size.x;
|
||||
y = bbox.GetHeight() / (double) size.y;
|
||||
|
@ -264,9 +270,8 @@ int WinEDA_GerberFrame::BestZoom()
|
|||
return best_zoom;
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
|
||||
void WinEDA_GerberFrame::LoadSettings()
|
||||
/**************************************/
|
||||
{
|
||||
wxConfig* config = wxGetApp().m_EDA_Config;
|
||||
|
||||
|
@ -277,10 +282,14 @@ void WinEDA_GerberFrame::LoadSettings()
|
|||
long pageSize_opt;
|
||||
config->Read( GerbviewShowPageSizeOption, &pageSize_opt, 0l );
|
||||
int imax = 0;
|
||||
|
||||
for( ; g_GerberPageSizeList[imax] != NULL; imax++ );
|
||||
|
||||
if( pageSize_opt < 0 || pageSize_opt >= imax )
|
||||
pageSize_opt = 0;
|
||||
|
||||
GetScreen()->m_CurrentSheetDesc = g_GerberPageSizeList[pageSize_opt];
|
||||
|
||||
if ( pageSize_opt > 0 )
|
||||
{
|
||||
m_Draw_Sheet_Ref = true;
|
||||
|
@ -291,9 +300,8 @@ void WinEDA_GerberFrame::LoadSettings()
|
|||
SetElementVisibility( DCODES_VISIBLE, tmp );
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
|
||||
void WinEDA_GerberFrame::SaveSettings()
|
||||
/**************************************/
|
||||
{
|
||||
wxConfig* config = wxGetApp().m_EDA_Config;
|
||||
|
||||
|
@ -305,6 +313,7 @@ void WinEDA_GerberFrame::SaveSettings()
|
|||
wxRealPoint GridSize = GetScreen()->GetGridSize();
|
||||
|
||||
long pageSize_opt = 0;
|
||||
|
||||
if( m_Draw_Sheet_Ref )
|
||||
{
|
||||
for( int ii = 1; g_GerberPageSizeList[ii] != NULL; ii++ )
|
||||
|
@ -341,6 +350,7 @@ void WinEDA_GerberFrame::ReFillLayerWidget()
|
|||
syncLayerWidget();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function IsGridVisible() , virtual
|
||||
* @return true if the grid must be shown
|
||||
|
@ -350,17 +360,19 @@ bool WinEDA_GerberFrame::IsGridVisible()
|
|||
return IsElementVisible( GERBER_GRID_VISIBLE );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function SetGridVisibility() , virtual
|
||||
* It may be overloaded by derived classes
|
||||
* if you want to store/retrieve the grid visiblity in configuration.
|
||||
* @param aVisible = true if the grid must be shown
|
||||
*/
|
||||
void WinEDA_GerberFrame::SetGridVisibility(bool aVisible)
|
||||
void WinEDA_GerberFrame::SetGridVisibility( bool aVisible )
|
||||
{
|
||||
SetElementVisibility(GERBER_GRID_VISIBLE, aVisible);
|
||||
SetElementVisibility( GERBER_GRID_VISIBLE, aVisible );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
|
@ -370,6 +382,7 @@ int WinEDA_GerberFrame::GetGridColor()
|
|||
return GetBoard()->GetVisibleElementColor( GERBER_GRID_VISIBLE );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function SetGridColor() , virtual
|
||||
* @param aColor = the new color of the grid
|
||||
|
@ -412,6 +425,7 @@ void WinEDA_GerberFrame::syncLayerBox()
|
|||
UpdateTitleAndInfo();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function SetLanguage
|
||||
* called on a language menu selection
|
||||
|
@ -443,6 +457,7 @@ void WinEDA_GerberFrame::Liste_D_Codes( )
|
|||
for( int layer = 0; layer < 32; layer++ )
|
||||
{
|
||||
GERBER_IMAGE* gerber = g_GERBER_List[layer];
|
||||
|
||||
if( gerber == NULL )
|
||||
continue;
|
||||
|
||||
|
@ -453,19 +468,20 @@ void WinEDA_GerberFrame::Liste_D_Codes( )
|
|||
Line.Printf( wxT( "*** Active layer (%2.2d) ***" ), layer + 1 );
|
||||
else
|
||||
Line.Printf( wxT( "*** layer %2.2d ***" ), layer + 1 );
|
||||
|
||||
List->Append( Line );
|
||||
|
||||
for( ii = 0, jj = 1; ii < TOOLS_MAX_COUNT; ii++ )
|
||||
{
|
||||
pt_D_code = gerber->GetDCODE( ii + FIRST_DCODE, false );
|
||||
|
||||
if( pt_D_code == NULL )
|
||||
continue;
|
||||
|
||||
if( !pt_D_code->m_InUse && !pt_D_code->m_Defined )
|
||||
continue;
|
||||
|
||||
Line.Printf( wxT(
|
||||
"tool %2.2d: D%2.2d V %2.4f H %2.4f %s" ),
|
||||
Line.Printf( wxT( "tool %2.2d: D%2.2d V %2.4f H %2.4f %s" ),
|
||||
jj,
|
||||
pt_D_code->m_Num_Dcode,
|
||||
(float) pt_D_code->m_Size.y / scale,
|
||||
|
@ -486,10 +502,12 @@ void WinEDA_GerberFrame::Liste_D_Codes( )
|
|||
|
||||
ii = List->ShowModal();
|
||||
List->Destroy();
|
||||
|
||||
if( ii < 0 )
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function UpdateTitleAndInfo
|
||||
* displays the short filename (if exists) of the selected layer
|
||||
|
@ -501,8 +519,9 @@ void WinEDA_GerberFrame::Liste_D_Codes( )
|
|||
*/
|
||||
void WinEDA_GerberFrame::UpdateTitleAndInfo()
|
||||
{
|
||||
GERBER_IMAGE* gerber = g_GERBER_List[GetScreen()->m_Active_Layer];
|
||||
GERBER_IMAGE* gerber = g_GERBER_List[ GetScreen()->m_Active_Layer ];
|
||||
wxString text;
|
||||
|
||||
// Display the gerber filename
|
||||
if( gerber == NULL )
|
||||
{
|
||||
|
@ -518,19 +537,20 @@ void WinEDA_GerberFrame::UpdateTitleAndInfo()
|
|||
text << wxT( " " ) << gerber->m_FileName;
|
||||
SetTitle( text );
|
||||
|
||||
gerber->DisplayImageInfo( );
|
||||
gerber->DisplayImageInfo();
|
||||
|
||||
// Display Image Name and Layer Name (from the current gerber data):
|
||||
text.Printf( _("Image name: \"%s\" Layer name: \"%s\""),
|
||||
GetChars(gerber->m_ImageName), GetChars(gerber->GetLayerParams( ).m_LayerName) );
|
||||
text.Printf( _( "Image name: \"%s\" Layer name: \"%s\"" ),
|
||||
GetChars( gerber->m_ImageName ),
|
||||
GetChars( gerber->GetLayerParams().m_LayerName ) );
|
||||
SetStatusText( text, 0 );
|
||||
|
||||
// Display data format like fmt in X3.4Y3.4 no LZ or fmt mm X2.3 Y3.5 no TZ in main toolbar
|
||||
text.Printf(wxT("fmt: %s X%d.%d Y%d.%d no %cZ"),
|
||||
gerber->m_GerbMetric ? wxT("mm") : wxT("in"),
|
||||
text.Printf( wxT("fmt: %s X%d.%d Y%d.%d no %cZ"),
|
||||
gerber->m_GerbMetric ? wxT( "mm" ) : wxT( "in" ),
|
||||
gerber->m_FmtLen.x - gerber->m_FmtScale.x, gerber->m_FmtScale.x,
|
||||
gerber->m_FmtLen.y - gerber->m_FmtScale.y, gerber->m_FmtScale.y,
|
||||
gerber->m_NoTrailingZeros ? 'T' : 'L');
|
||||
gerber->m_NoTrailingZeros ? 'T' : 'L' );
|
||||
|
||||
m_TextInfo->SetValue( text );
|
||||
}
|
||||
|
|
|
@ -69,15 +69,14 @@ struct Ki_HotkeyInfoSectionDescriptor s_Gerbview_Hokeys_Descr[] =
|
|||
|
||||
|
||||
/***********************************************************/
|
||||
void WinEDA_GerberFrame::OnHotKey( wxDC* DC, int hotkey,
|
||||
EDA_BaseStruct* DrawStruct )
|
||||
void WinEDA_GerberFrame::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
|
||||
/***********************************************************/
|
||||
|
||||
/* Hot keys. Some commands are relatives to the item under the mouse cursor
|
||||
* Commands are case insensitive
|
||||
* @param DC = current device context
|
||||
* @param hotkey = hotkey code (ascii or wxWidget code for special keys)
|
||||
* @param DrawStruct = NULL or pointer on a EDA_BaseStruct under the mouse cursor
|
||||
* @param DrawStruct = NULL or pointer on a EDA_ITEM under the mouse cursor
|
||||
*/
|
||||
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue