Commit c406eed1 authored by dickelbeck's avatar dickelbeck

class name changes, XOR artifacts

parent bd77c9f2
...@@ -5,6 +5,27 @@ Started 2007-June-11 ...@@ -5,6 +5,27 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Mar-19 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+eeschema
Renamed some classes and their corresponding KICAD_T types so they are both
simpler, shorter and more closely match each other: the type and the classname.
Wedged a class SCH_ITEM underneath most eeschema drawable items, and this
class came from DrawPartStruct which was largely disfunctional. Eeschema
now more closely matches what we have in pcbnew with the BOARD_ITEM base class.
The corresponding class in eeschema is now SCH_ITEM. Put in some of Jonas'
patch for the dragging of a block. Needs testing, especially dragging
text since there is no GetBoundingBox() for that yet. As an interrim solution
we could make SCH_ITEM::GetBoundingBox() return a HUGE rectangle so that any class
not implementing GetBoundingBox() in eeschema will get properly re-drawn,
in theory.
We are currently using XORing for dragging a single object and using full
redraws for dragging a block. I suppose this can be an experiment for a
week or so. I would not expect that dragging a block of labels with no
other object to work currently.
2008-Mar-19 UPDATE Igor Plyatov <plyatov@mail.ru> 2008-Mar-19 UPDATE Igor Plyatov <plyatov@mail.ru>
================================================================================ ================================================================================
* Support for Gnome/KDE menu added. * Support for Gnome/KDE menu added.
......
...@@ -805,8 +805,9 @@ EDA_Rect& EDA_Rect::Inflate( wxCoord dx, wxCoord dy ) ...@@ -805,8 +805,9 @@ EDA_Rect& EDA_Rect::Inflate( wxCoord dx, wxCoord dy )
} }
/** Function Merge /**
* Modify Position and Size of this in order to contain the given rect * Function Merge
* modifies Position and Size of this in order to contain the given rect
* mainly used to calculate bounding boxes * mainly used to calculate bounding boxes
* @param aRect = given rect to merge with this * @param aRect = given rect to merge with this
*/ */
...@@ -840,7 +841,7 @@ void EDA_Rect::Merge( const EDA_Rect& aRect ) ...@@ -840,7 +841,7 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
/*******************************************************************/ /*******************************************************************/
DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) : DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) :
EDA_BaseStruct( DRAW_PICK_ITEM_STRUCT_TYPE ) SCH_ITEM( NULL, DRAW_PICK_ITEM_STRUCT_TYPE )
/*******************************************************************/ /*******************************************************************/
{ {
m_PickedStruct = pickedstruct; m_PickedStruct = pickedstruct;
...@@ -851,6 +852,41 @@ DrawPickedStruct::~DrawPickedStruct() ...@@ -851,6 +852,41 @@ DrawPickedStruct::~DrawPickedStruct()
{ {
} }
#if defined(DEBUG)
void DrawPickedStruct::Show( int nestLevel, std::ostream& os )
{
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << "/>\n";
}
#endif
EDA_Rect DrawPickedStruct::GetBoundingBox()
{
if( m_PickedStruct )
return m_PickedStruct->GetBoundingBox();
else
{
return EDA_Rect(); // empty rectangle
}
}
EDA_Rect DrawPickedStruct::GetBoundingBoxUnion()
{
EDA_Rect ret;
DrawPickedStruct* cur = this;
EDA_BaseStruct* item;
while( cur && (item = cur->m_PickedStruct) != NULL )
{
ret.Merge( item->GetBoundingBox() );
cur = cur->Next();
}
return ret;
}
/*********************************************/ /*********************************************/
void DrawPickedStruct::DeleteWrapperList() void DrawPickedStruct::DeleteWrapperList()
......
...@@ -27,7 +27,7 @@ void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -27,7 +27,7 @@ void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame )
/***************************************************************/ /***************************************************************/
void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame ) void SCH_COMPONENT::Display_Infos( WinEDA_DrawFrame* frame )
/***************************************************************/ /***************************************************************/
{ {
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );; EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
...@@ -37,7 +37,7 @@ void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -37,7 +37,7 @@ void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre( frame, 1, _( "Ref" ), Affiche_1_Parametre( frame, 1, _( "Ref" ),
GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()), DARKCYAN ); GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()), DARKCYAN );
if( Entry && Entry->m_Options == ENTRY_POWER ) if( Entry && Entry->m_Options == ENTRY_POWER )
msg = _( "Pwr Symb" ); msg = _( "Pwr Symb" );
......
...@@ -90,10 +90,10 @@ void ReAnnotatePowerSymbolsOnly( void ) ...@@ -90,10 +90,10 @@ void ReAnnotatePowerSymbolsOnly( void )
EDA_BaseStruct* DrawList = sheet->LastDrawList(); EDA_BaseStruct* DrawList = sheet->LastDrawList();
for( ; DrawList != NULL; DrawList = DrawList->Pnext ) for( ; DrawList != NULL; DrawList = DrawList->Pnext )
{ {
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
EDA_SchComponentStruct* DrawLibItem = SCH_COMPONENT* DrawLibItem =
(EDA_SchComponentStruct*) DrawList; (SCH_COMPONENT*) DrawList;
EDA_LibComponentStruct* Entry = EDA_LibComponentStruct* Entry =
FindLibPart( FindLibPart(
DrawLibItem->m_ChipName.GetData(), wxEmptyString, DrawLibItem->m_ChipName.GetData(), wxEmptyString,
...@@ -303,14 +303,14 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet ) ...@@ -303,14 +303,14 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet )
{ {
int NbrCmp = 0; int NbrCmp = 0;
EDA_BaseStruct* DrawList = sheet->LastDrawList(); EDA_BaseStruct* DrawList = sheet->LastDrawList();
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
for( ; DrawList; DrawList = DrawList->Pnext ) for( ; DrawList; DrawList = DrawList->Pnext )
{ {
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(), Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(),
wxEmptyString, wxEmptyString,
FIND_ROOT ); FIND_ROOT );
...@@ -361,7 +361,7 @@ static void ReAnnotateComponents( CmpListStruct* BaseListeCmp, int NbOfCmp ) ...@@ -361,7 +361,7 @@ static void ReAnnotateComponents( CmpListStruct* BaseListeCmp, int NbOfCmp )
{ {
int ii; int ii;
char* Text; char* Text;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
/* Reattribution des numeros */ /* Reattribution des numeros */
for( ii = 0; ii < NbOfCmp; ii++ ) for( ii = 0; ii < NbOfCmp; ii++ )
......
This diff is collapsed.
...@@ -36,7 +36,7 @@ EDA_BaseStruct* SCH_SCREEN::ExtractWires( bool CreateCopy ) ...@@ -36,7 +36,7 @@ EDA_BaseStruct* SCH_SCREEN::ExtractWires( bool CreateCopy )
* If an abord command is made, old wires must be put in EEDrawList, and copies must be deleted * If an abord command is made, old wires must be put in EEDrawList, and copies must be deleted
* This is because previously stored undo commands can handle pointers on wires or bus, * 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. * and we do not delete wires or bus, we must put they in undo list.
* *
* Because cleanup delete and/or modify bus and wires, the more easy is to put all wires in undo list * Because cleanup delete and/or modify bus and wires, the more easy is to put all wires in undo list
* and use a new copy of wires for cleanup * and use a new copy of wires for cleanup
*/ */
...@@ -142,8 +142,8 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type ) ...@@ -142,8 +142,8 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
if( !newsegment ) /* first point : Create first wire ou bus */ if( !newsegment ) /* first point : Create first wire ou bus */
{ {
s_ConnexionStartPoint = cursorpos; s_ConnexionStartPoint = cursorpos;
s_OldWiresList = ((SCH_SCREEN*)GetScreen())->ExtractWires( TRUE ); s_OldWiresList = ((SCH_SCREEN*)GetScreen())->ExtractWires( TRUE );
((SCH_SCREEN*)GetScreen())->SchematicCleanUp( NULL ); ((SCH_SCREEN*)GetScreen())->SchematicCleanUp( NULL );
switch( type ) switch( type )
{ {
...@@ -194,7 +194,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type ) ...@@ -194,7 +194,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Creation du segment suivant ou fin de trac� si point sur pin, jonction ...*/ /* Creation du segment suivant ou fin de trac� si point sur pin, jonction ...*/
if( IsTerminalPoint( (SCH_SCREEN*)GetScreen(), cursorpos, oldsegment->m_Layer ) ) if( IsTerminalPoint( (SCH_SCREEN*)GetScreen(), cursorpos, oldsegment->m_Layer ) )
{ {
EndSegment( DC ); return; EndSegment( DC ); return;
} }
...@@ -301,7 +301,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC ) ...@@ -301,7 +301,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
alt_end_point = lastsegment->m_Start; alt_end_point = lastsegment->m_Start;
} }
((SCH_SCREEN*)GetScreen())->SchematicCleanUp( NULL ); ((SCH_SCREEN*)GetScreen())->SchematicCleanUp( NULL );
/* clear flags and find last segment entered, for repeat function */ /* clear flags and find last segment entered, for repeat function */
segment = (EDA_DrawLineStruct*) GetScreen()->EEDrawList; segment = (EDA_DrawLineStruct*) GetScreen()->EEDrawList;
...@@ -521,7 +521,7 @@ void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC ) ...@@ -521,7 +521,7 @@ void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC )
Segment_in_Ghost( DrawPanel, DC, FALSE ); /* Effacement du trace en cours */ Segment_in_Ghost( DrawPanel, DC, FALSE ); /* Effacement du trace en cours */
} }
EraseStruct( GetScreen()->GetCurItem(), (SCH_SCREEN*)GetScreen() ); EraseStruct( GetScreen()->GetCurItem(), (SCH_SCREEN*)GetScreen() );
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
} }
...@@ -642,9 +642,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -642,9 +642,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -653,9 +653,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -653,9 +653,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -664,19 +664,19 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -664,19 +664,19 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawHierLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_HIERLABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
/*** Increment du numero de label ***/ /*** Increment du numero de label ***/
IncrementLabelMember( STRUCT->m_Text ); IncrementLabelMember( STRUCT->m_Text );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawGlobalLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_GLOBALLABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep; STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
...@@ -701,17 +701,17 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -701,17 +701,17 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
new_pos = STRUCT->m_Pos; new_pos = STRUCT->m_Pos;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: // In repeat command the new component is put in move mode case TYPE_SCH_COMPONENT: // In repeat command the new component is put in move mode
#undef STRUCT #undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_COMPONENT*) g_ItemToRepeat )
// Create the duplicate component, position = mouse cursor // Create the duplicate component, position = mouse cursor
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
new_pos.x = GetScreen()->m_Curseur.x - STRUCT->m_Pos.x; new_pos.x = GetScreen()->m_Curseur.x - STRUCT->m_Pos.x;
new_pos.y = GetScreen()->m_Curseur.y - STRUCT->m_Pos.y; new_pos.y = GetScreen()->m_Curseur.y - STRUCT->m_Pos.y;
STRUCT->m_Pos = GetScreen()->m_Curseur; STRUCT->m_Pos = GetScreen()->m_Curseur;
STRUCT->m_Flags = IS_NEW; STRUCT->m_Flags = IS_NEW;
STRUCT->m_TimeStamp = GetTimeStamp(); STRUCT->m_TimeStamp = GetTimeStamp();
for( int ii = 0; ii < NUMBER_OF_FIELDS; ii++ ) for( int ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
{ {
STRUCT->m_Field[ii].m_Pos += new_pos; STRUCT->m_Field[ii].m_Pos += new_pos;
...@@ -783,14 +783,14 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -783,14 +783,14 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
* - une jonction * - une jonction
* - ou une pin * - ou une pin
* - ou une extr�mit� unique de fil * - ou une extr�mit� unique de fil
* *
* - type BUS, si il y a * - type BUS, si il y a
* - ou une extr�mit� unique de BUS * - ou une extr�mit� unique de BUS
*/ */
{ {
EDA_BaseStruct* item; EDA_BaseStruct* item;
LibDrawPin* pin; LibDrawPin* pin;
EDA_SchComponentStruct* LibItem = NULL; SCH_COMPONENT* LibItem = NULL;
DrawSheetLabelStruct* pinsheet; DrawSheetLabelStruct* pinsheet;
wxPoint itempos; wxPoint itempos;
...@@ -837,9 +837,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -837,9 +837,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE; return TRUE;
item = PickStruct( pos, screen, LABELITEM ); item = PickStruct( pos, screen, LABELITEM );
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE) if( item && (item->Type() != TYPE_SCH_TEXT)
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
return TRUE; return TRUE;
pinsheet = LocateAnyPinSheet( pos, screen ); pinsheet = LocateAnyPinSheet( pos, screen );
......
...@@ -184,12 +184,12 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC ) ...@@ -184,12 +184,12 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
/* Search Hlabel corresponding to this Pinsheet */ /* Search Hlabel corresponding to this Pinsheet */
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList; EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList;
DrawHierLabelStruct* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{ {
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE ) if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
continue; continue;
HLabel = (DrawHierLabelStruct*) DrawStruct; HLabel = (SCH_HIERLABEL*) DrawStruct;
if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 ) if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
break; // Found! break; // Found!
HLabel = NULL; HLabel = NULL;
...@@ -282,9 +282,9 @@ void DrawSheetStruct::DeleteAnnotation( bool recurse ) ...@@ -282,9 +282,9 @@ void DrawSheetStruct::DeleteAnnotation( bool recurse )
EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList; EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList;
for( ; comp; comp = comp->Pnext ) for( ; comp; comp = comp->Pnext )
{ {
if( comp->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( comp->Type() == TYPE_SCH_COMPONENT )
{ {
( (EDA_SchComponentStruct*) comp )->ClearAnnotation(); ( (SCH_COMPONENT*) comp )->ClearAnnotation();
} }
} }
} }
...@@ -305,9 +305,9 @@ int DrawSheetStruct::ComponentCount() ...@@ -305,9 +305,9 @@ int DrawSheetStruct::ComponentCount()
EDA_BaseStruct* bs; EDA_BaseStruct* bs;
for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Pnext ) for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Pnext )
{ {
if( bs->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( bs->Type() == TYPE_SCH_COMPONENT )
{ {
DrawPartStruct* Cmp = (DrawPartStruct*) bs; SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' ) if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' )
n++; n++;
} }
...@@ -475,84 +475,84 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt ...@@ -475,84 +475,84 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
if( (GetFileName() == aFileName) && m_AssociatedScreen ) if( (GetFileName() == aFileName) && m_AssociatedScreen )
return true; return true;
SCH_SCREEN* Screen_to_use = NULL; SCH_SCREEN* Screen_to_use = NULL;
wxString msg; wxString msg;
bool LoadFromFile = false; bool LoadFromFile = false;
if( g_RootSheet->SearchHierarchy( aFileName, &Screen_to_use ) ) //do we reload the data from the existing hierarchy if( g_RootSheet->SearchHierarchy( aFileName, &Screen_to_use ) ) //do we reload the data from the existing hierarchy
{ {
msg.Printf( _( msg.Printf( _(
"A Sub Hierarchy named %s exists, Use it (The data in this sheet will be replaced)?" ), "A Sub Hierarchy named %s exists, Use it (The data in this sheet will be replaced)?" ),
aFileName.GetData() ); aFileName.GetData() );
if( ! IsOK( NULL, msg ) ) if( ! IsOK( NULL, msg ) )
{ {
DisplayInfo(NULL, _("Sheet Filename Renaming Aborted")); DisplayInfo(NULL, _("Sheet Filename Renaming Aborted"));
return false; return false;
} }
} }
else if( wxFileExists( aFileName ) ) //do we reload the data from an existing file else if( wxFileExists( aFileName ) ) //do we reload the data from an existing file
{ {
msg.Printf( _( msg.Printf( _(
"A file named %s exists, load it (otherwise keep current sheet data if possible)?" ), "A file named %s exists, load it (otherwise keep current sheet data if possible)?" ),
aFileName.GetData() ); aFileName.GetData() );
if( IsOK( NULL, msg ) ) if( IsOK( NULL, msg ) )
{ {
LoadFromFile = true; LoadFromFile = true;
m_AssociatedScreen->m_RefCount--; //be careful with these m_AssociatedScreen->m_RefCount--; //be careful with these
if( m_AssociatedScreen->m_RefCount == 0 ) if( m_AssociatedScreen->m_RefCount == 0 )
SAFE_DELETE( m_AssociatedScreen ); SAFE_DELETE( m_AssociatedScreen );
m_AssociatedScreen = NULL; //will be created later m_AssociatedScreen = NULL; //will be created later
} }
} }
// if an associated screen exists, shared between this sheet and others sheets, what we do ? // if an associated screen exists, shared between this sheet and others sheets, what we do ?
if( m_AssociatedScreen && ( m_AssociatedScreen->m_RefCount > 1 )) if( m_AssociatedScreen && ( m_AssociatedScreen->m_RefCount > 1 ))
{ {
msg = _("This sheet uses shared data in a complex hierarchy" ) ; msg = _("This sheet uses shared data in a complex hierarchy" ) ;
msg << wxT("\n"); msg << wxT("\n");
msg << _("Do we convert it in a simple hierarchical sheet (otherwise delete current sheet data)"); msg << _("Do we convert it in a simple hierarchical sheet (otherwise delete current sheet data)");
if( IsOK( NULL, msg ) ) if( IsOK( NULL, msg ) )
{ {
LoadFromFile = true; LoadFromFile = true;
wxString oldfilename = m_AssociatedScreen->m_FileName; wxString oldfilename = m_AssociatedScreen->m_FileName;
m_AssociatedScreen->m_FileName = aFileName; m_AssociatedScreen->m_FileName = aFileName;
aFrame->SaveEEFile( m_AssociatedScreen, FILE_SAVE_AS ); aFrame->SaveEEFile( m_AssociatedScreen, FILE_SAVE_AS );
m_AssociatedScreen->m_FileName = oldfilename; m_AssociatedScreen->m_FileName = oldfilename;
} }
m_AssociatedScreen->m_RefCount--; //be careful with these m_AssociatedScreen->m_RefCount--; //be careful with these
m_AssociatedScreen = NULL; //will be created later m_AssociatedScreen = NULL; //will be created later
} }
SetFileName( aFileName ); SetFileName( aFileName );
// if we use new data (from file or from internal hierarchy), delete the current sheet data // if we use new data (from file or from internal hierarchy), delete the current sheet data
if( m_AssociatedScreen && (LoadFromFile || Screen_to_use) ) if( m_AssociatedScreen && (LoadFromFile || Screen_to_use) )
{ {
m_AssociatedScreen->m_RefCount--; m_AssociatedScreen->m_RefCount--;
if( m_AssociatedScreen->m_RefCount == 0 ) if( m_AssociatedScreen->m_RefCount == 0 )
SAFE_DELETE( m_AssociatedScreen ); SAFE_DELETE( m_AssociatedScreen );
m_AssociatedScreen = NULL; //so that we reload.. m_AssociatedScreen = NULL; //so that we reload..
} }
if ( LoadFromFile ) if ( LoadFromFile )
Load( aFrame ); Load( aFrame );
else if ( Screen_to_use ) else if ( Screen_to_use )
{ {
m_AssociatedScreen = Screen_to_use; m_AssociatedScreen = Screen_to_use;
m_AssociatedScreen->m_RefCount++; m_AssociatedScreen->m_RefCount++;
} }
//just make a new screen if needed. //just make a new screen if needed.
if( !m_AssociatedScreen ) if( !m_AssociatedScreen )
{ {
m_AssociatedScreen = new SCH_SCREEN( SCHEMATIC_FRAME ); m_AssociatedScreen = new SCH_SCREEN( SCHEMATIC_FRAME );
m_AssociatedScreen->m_RefCount++; //be careful with these m_AssociatedScreen->m_RefCount++; //be careful with these
} }
m_AssociatedScreen->m_FileName = aFileName; m_AssociatedScreen->m_FileName = aFileName;
return true; return true;
} }
...@@ -803,9 +803,9 @@ void DrawSheetPath::UpdateAllScreenReferences() ...@@ -803,9 +803,9 @@ void DrawSheetPath::UpdateAllScreenReferences()
while( t ) while( t )
{ {
if( t->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( t->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* d = (EDA_SchComponentStruct*) t; SCH_COMPONENT* d = (SCH_COMPONENT*) t;
d->m_Field[REFERENCE].m_Text = d->GetRef( this ); d->m_Field[REFERENCE].m_Text = d->GetRef( this );
} }
t = t->Pnext; t = t->Pnext;
......
...@@ -19,11 +19,11 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen ) ...@@ -19,11 +19,11 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
{ {
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
......
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
/************************/ /************************/
/* class DrawTextStruct */ /* class SCH_TEXT */
/* class DrawLabelStruct */ /* class SCH_LABEL */
/* class DrawGlobalLabelStruct */ /* class SCH_GLOBALLABEL */
/* class DrawHierLabelStruct */ /* class SCH_HIERLABEL */
/************************/ /************************/
/**************************************************************************/ /**************************************************************************/
DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_T aType ) : SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
EDA_BaseStruct( aType ) SCH_ITEM( NULL, aType )
, EDA_TextStruct( text ) , EDA_TextStruct( text )
/**************************************************************************/ /**************************************************************************/
{ {
...@@ -38,28 +38,28 @@ DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_ ...@@ -38,28 +38,28 @@ DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_
/*********************************************/ /*********************************************/
DrawTextStruct* DrawTextStruct::GenCopy() SCH_TEXT* SCH_TEXT::GenCopy()
/*********************************************/ /*********************************************/
{ {
DrawTextStruct* newitem; SCH_TEXT* newitem;
switch( Type() ) switch( Type() )
{ {
default: default:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
newitem = new DrawTextStruct( m_Pos, m_Text ); newitem = new SCH_TEXT( m_Pos, m_Text );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
newitem = new DrawGlobalLabelStruct( m_Pos, m_Text ); newitem = new SCH_GLOBALLABEL( m_Pos, m_Text );
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
newitem = new DrawHierLabelStruct( m_Pos, m_Text ); newitem = new SCH_HIERLABEL( m_Pos, m_Text );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
newitem = new DrawLabelStruct( m_Pos, m_Text ); newitem = new SCH_LABEL( m_Pos, m_Text );
break; break;
} }
...@@ -77,7 +77,7 @@ DrawTextStruct* DrawTextStruct::GenCopy() ...@@ -77,7 +77,7 @@ DrawTextStruct* DrawTextStruct::GenCopy()
/********************************************************/ /********************************************************/
void DrawTextStruct::SwapData( DrawTextStruct* copyitem ) void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
/********************************************************/ /********************************************************/
{ {
EXCHG( m_Text, copyitem->m_Text ); EXCHG( m_Text, copyitem->m_Text );
...@@ -95,20 +95,20 @@ void DrawTextStruct::SwapData( DrawTextStruct* copyitem ) ...@@ -95,20 +95,20 @@ void DrawTextStruct::SwapData( DrawTextStruct* copyitem )
/***************************************************************/ /***************************************************************/
void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***************************************************************/ /***************************************************************/
{ {
/* save old text in undo list */ /* save old text in undo list */
if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) ) if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) )
{ {
/* restore old values and save new ones */ /* restore old values and save new ones */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy ); SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
/* save in undo list */ /* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED ); ( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */ /* restore new values */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy ); SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
} }
...@@ -118,8 +118,8 @@ void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -118,8 +118,8 @@ void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/****************************************************************************/ /****************************************************************************/
DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) : SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_LABEL_STRUCT_TYPE ) SCH_TEXT( pos, text, TYPE_SCH_LABEL )
/****************************************************************************/ /****************************************************************************/
{ {
m_Layer = LAYER_LOCLABEL; m_Layer = LAYER_LOCLABEL;
...@@ -129,8 +129,8 @@ DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) : ...@@ -129,8 +129,8 @@ DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
/***********************************************************************************/ /***********************************************************************************/
DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString& text ) : SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_GLOBAL_LABEL_STRUCT_TYPE ) SCH_TEXT( pos, text, TYPE_SCH_GLOBALLABEL )
/***********************************************************************************/ /***********************************************************************************/
{ {
m_Layer = LAYER_GLOBLABEL; m_Layer = LAYER_GLOBLABEL;
...@@ -140,8 +140,8 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString ...@@ -140,8 +140,8 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString
/***********************************************************************************/ /***********************************************************************************/
DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& text ) : SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_HIER_LABEL_STRUCT_TYPE ) SCH_TEXT( pos, text, TYPE_SCH_HIERLABEL )
/***********************************************************************************/ /***********************************************************************************/
{ {
m_Layer = LAYER_HIERLABEL; m_Layer = LAYER_HIERLABEL;
...@@ -151,7 +151,7 @@ DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& te ...@@ -151,7 +151,7 @@ DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& te
/*******************************************************************************************/ /*******************************************************************************************/
void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color ) int DrawMode, int Color )
/*******************************************************************************************/ /*******************************************************************************************/
...@@ -211,16 +211,16 @@ void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off ...@@ -211,16 +211,16 @@ void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off
/*********************************************************************************************/ /*********************************************************************************************/
void DrawLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void SCH_LABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color ) int DrawMode, int Color )
/*********************************************************************************************/ /*********************************************************************************************/
{ {
DrawTextStruct::Draw( panel, DC, offset, DrawMode, Color ); SCH_TEXT::Draw( panel, DC, offset, DrawMode, Color );
} }
/*******************************************************************************************/ /*******************************************************************************************/
void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color ) int DrawMode, int Color )
/******************************************************************************************/ /******************************************************************************************/
...@@ -288,7 +288,7 @@ void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint ...@@ -288,7 +288,7 @@ void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint
* format list is * format list is
* corner_count, x0, y0, ... xn, yn * corner_count, x0, y0, ... xn, yn
*/ */
void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& Pos ) void SCH_HIERLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
{ {
int* Template = TemplateShape[m_Shape][m_Orient]; int* Template = TemplateShape[m_Shape][m_Orient];
int HalfSize = m_Size.x / 2; int HalfSize = m_Size.x / 2;
...@@ -307,7 +307,7 @@ void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& P ...@@ -307,7 +307,7 @@ void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& P
/*******************************************************************************************/ /*******************************************************************************************/
void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& draw_offset, void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& draw_offset,
int DrawMode, int Color ) int DrawMode, int Color )
/******************************************************************************************/ /******************************************************************************************/
...@@ -338,9 +338,9 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi ...@@ -338,9 +338,9 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi
offset += HalfSize; offset += HalfSize;
break; break;
case NET_OUTPUT: case NET_OUTPUT:
offset += TXTMARGE; offset += TXTMARGE;
break; break;
default: default:
break; break;
...@@ -392,7 +392,7 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi ...@@ -392,7 +392,7 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi
* format list is * format list is
* <corner_count>, x0, y0, ... xn, yn * <corner_count>, x0, y0, ... xn, yn
*/ */
void DrawGlobalLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& Pos ) void SCH_GLOBALLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
{ {
int HalfSize = m_Size.x / 2; int HalfSize = m_Size.x / 2;
int width = MAX( m_Width, g_DrawMinimunLineWidth ); int width = MAX( m_Width, g_DrawMinimunLineWidth );
......
...@@ -76,7 +76,7 @@ int* TemplateShape[5][4] = ...@@ -76,7 +76,7 @@ int* TemplateShape[5][4] =
extern int* TemplateShape[5][4]; extern int* TemplateShape[5][4];
#endif #endif
class DrawTextStruct : public EDA_BaseStruct class SCH_TEXT : public SCH_ITEM
, public EDA_TextStruct , public EDA_TextStruct
{ {
public: public:
...@@ -85,31 +85,31 @@ public: ...@@ -85,31 +85,31 @@ public:
bool m_IsDangling; // TRUE si non connect� bool m_IsDangling; // TRUE si non connect�
public: public:
DrawTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
KICAD_T aType = DRAW_TEXT_STRUCT_TYPE ); KICAD_T aType = TYPE_SCH_TEXT );
~DrawTextStruct() { } ~SCH_TEXT() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "DrawText" ); return wxT( "SCH_TEXT" );
} }
DrawTextStruct* GenCopy(); SCH_TEXT* GenCopy();
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
void SwapData( DrawTextStruct* copyitem ); void SwapData( SCH_TEXT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
}; };
class DrawLabelStruct : public DrawTextStruct class SCH_LABEL : public SCH_TEXT
{ {
public: public:
DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString ); SCH_LABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawLabelStruct() { } ~SCH_LABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
...@@ -120,12 +120,12 @@ public: ...@@ -120,12 +120,12 @@ public:
}; };
class DrawGlobalLabelStruct : public DrawTextStruct class SCH_GLOBALLABEL : public SCH_TEXT
{ {
public: public:
DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), SCH_GLOBALLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString ); const wxString& text = wxEmptyString );
~DrawGlobalLabelStruct() { } ~SCH_GLOBALLABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
...@@ -138,21 +138,21 @@ public: ...@@ -138,21 +138,21 @@ public:
/** function CreateGraphicShape /** function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text * Calculates the graphic shape (a polygon) associated to the text
* @param corner_list = coordinates list fill with polygon corners ooordinates (size > 20) * @param corner_list = coordinates list fill with polygon corners ooordinates (size > 20)
* @param Pos = Postion of the shape * @param Pos = Postion of the shape
* format list is * format list is
* <corner_count>, x0, y0, ... xn, yn * <corner_count>, x0, y0, ... xn, yn
*/ */
void CreateGraphicShape( int* corner_list, const wxPoint & Pos ); void CreateGraphicShape( int* corner_list, const wxPoint & Pos );
}; };
class DrawHierLabelStruct : public DrawTextStruct class SCH_HIERLABEL : public SCH_TEXT
{ {
public: public:
DrawHierLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), SCH_HIERLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString ); const wxString& text = wxEmptyString );
~DrawHierLabelStruct() { } ~SCH_HIERLABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 ); int Color = -1 );
...@@ -165,9 +165,9 @@ public: ...@@ -165,9 +165,9 @@ public:
/** function CreateGraphicShape /** function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text * Calculates the graphic shape (a polygon) associated to the text
* @param corner_list = coordinates list fill with polygon corners ooordinates (size >= 14) * @param corner_list = coordinates list fill with polygon corners ooordinates (size >= 14)
* @param Pos = Postion of the shape * @param Pos = Postion of the shape
* format list is * format list is
* <corner_count>, x0, y0, ... xn, yn * <corner_count>, x0, y0, ... xn, yn
*/ */
void CreateGraphicShape( int* corner_list, const wxPoint & Pos ); void CreateGraphicShape( int* corner_list, const wxPoint & Pos );
}; };
......
...@@ -105,14 +105,14 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen ) ...@@ -105,14 +105,14 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_NOCONNECT_STRUCT_TYPE: case DRAW_NOCONNECT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_PICK_ITEM_STRUCT_TYPE: case DRAW_PICK_ITEM_STRUCT_TYPE:
case DRAW_POLYLINE_STRUCT_TYPE: case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE: case DRAW_MARKER_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
case DRAW_SHEETLABEL_STRUCT_TYPE: case DRAW_SHEETLABEL_STRUCT_TYPE:
break; break;
......
...@@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox() ...@@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox()
}; };
EDA_Rect EDA_SchComponentStruct::GetBoundingBox() EDA_Rect SCH_COMPONENT::GetBoundingBox()
{ {
const int PADDING = 40; const int PADDING = 40;
......
...@@ -22,28 +22,9 @@ ...@@ -22,28 +22,9 @@
WX_DEFINE_OBJARRAY( ArrayOfSheetLists ); WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
/***************************/ /***************************/
/* class DrawPartStruct */ /* class SCH_COMPONENT */
/* class EDA_SchComponentStruct */
/***************************/ /***************************/
/***********************************************************************************/
DrawPartStruct::DrawPartStruct( KICAD_T struct_type, const wxPoint& pos ) :
EDA_BaseStruct( struct_type )
/***********************************************************************************/
{
m_Layer = 0;
m_Pos = pos;
m_TimeStamp = 0;
}
/************************************/
DrawPartStruct::~DrawPartStruct()
/************************************/
{
}
/****************************************************************/ /****************************************************************/
const wxString& ReturnDefaultFieldName( int aFieldNdx ) const wxString& ReturnDefaultFieldName( int aFieldNdx )
/****************************************************************/ /****************************************************************/
...@@ -78,7 +59,7 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx ) ...@@ -78,7 +59,7 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx )
/****************************************************************/ /****************************************************************/
const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const const wxString& SCH_COMPONENT::ReturnFieldName( int aFieldNdx ) const
/****************************************************************/ /****************************************************************/
/* Return the Field name from its index (REFERENCE, VALUE ..) /* Return the Field name from its index (REFERENCE, VALUE ..)
...@@ -94,7 +75,7 @@ const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const ...@@ -94,7 +75,7 @@ const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const
/****************************************************************/ /****************************************************************/
wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet ) wxString SCH_COMPONENT::GetPath( DrawSheetPath* sheet )
/****************************************************************/ /****************************************************************/
{ {
wxString str; wxString str;
...@@ -105,7 +86,7 @@ wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet ) ...@@ -105,7 +86,7 @@ wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet )
/********************************************************************/ /********************************************************************/
const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet ) const wxString SCH_COMPONENT::GetRef( DrawSheetPath* sheet )
/********************************************************************/ /********************************************************************/
{ {
wxString path = GetPath( sheet ); wxString path = GetPath( sheet );
...@@ -137,7 +118,7 @@ const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet ) ...@@ -137,7 +118,7 @@ const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet )
/***********************************************************************/ /***********************************************************************/
void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref ) void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, wxString ref )
/***********************************************************************/ /***********************************************************************/
{ {
//check to see if it is already there before inserting it //check to see if it is already there before inserting it
...@@ -176,7 +157,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref ) ...@@ -176,7 +157,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref )
/**************************************/ /**************************************/
void EDA_SchComponentStruct::ClearRefs() void SCH_COMPONENT::ClearRefs()
/**************************************/ /**************************************/
{ {
m_Paths.Empty(); m_Paths.Empty();
...@@ -184,7 +165,7 @@ void EDA_SchComponentStruct::ClearRefs() ...@@ -184,7 +165,7 @@ void EDA_SchComponentStruct::ClearRefs()
} }
const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const const wxString& SCH_COMPONENT::GetFieldValue( int aFieldNdx ) const
{ {
// avoid unnecessarily copying wxStrings. // avoid unnecessarily copying wxStrings.
static const wxString myEmpty = wxEmptyString; static const wxString myEmpty = wxEmptyString;
...@@ -197,14 +178,16 @@ const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const ...@@ -197,14 +178,16 @@ const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const
/*******************************************************************/ /*******************************************************************/
EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) : SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos ) :
DrawPartStruct( DRAW_LIB_ITEM_STRUCT_TYPE, pos ) SCH_ITEM( NULL, TYPE_SCH_COMPONENT )
/*******************************************************************/ /*******************************************************************/
{ {
int ii; int ii;
m_Multi = 0; /* In multi unit chip - which unit to draw. */ m_Multi = 0; /* In multi unit chip - which unit to draw. */
m_Pos = aPos;
//m_FlagControlMulti = 0; //m_FlagControlMulti = 0;
m_UsedOnSheets.Clear(); m_UsedOnSheets.Clear();
m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */ m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */
...@@ -234,7 +217,7 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) : ...@@ -234,7 +217,7 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
/************************************************/ /************************************************/
EDA_Rect EDA_SchComponentStruct::GetBoundaryBox() const EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
/************************************************/ /************************************************/
{ {
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
...@@ -309,14 +292,14 @@ void PartTextStruct::SwapData( PartTextStruct* copyitem ) ...@@ -309,14 +292,14 @@ void PartTextStruct::SwapData( PartTextStruct* copyitem )
/**************************************************************************/ /**************************************************************************/
void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem ) void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
/**************************************************************************/ /**************************************************************************/
/* Used if undo / redo command: /* Used if undo / redo command:
* swap data between this and copyitem * swap data between this and copyitem
*/ */
{ {
EXCHG( m_ChipName, copyitem->m_ChipName ); EXCHG( m_ChipName, copyitem->m_ChipName );
EXCHG( m_Pos, copyitem->m_Pos ); EXCHG( m_Pos, copyitem->m_Pos );
EXCHG( m_Multi, copyitem->m_Multi ); EXCHG( m_Multi, copyitem->m_Multi );
EXCHG( m_Convert, copyitem->m_Convert ); EXCHG( m_Convert, copyitem->m_Convert );
...@@ -332,7 +315,7 @@ void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem ) ...@@ -332,7 +315,7 @@ void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem )
/***********************************************************************/ /***********************************************************************/
void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***********************************************************************/ /***********************************************************************/
{ {
/* save old text in undo list */ /* save old text in undo list */
...@@ -341,13 +324,13 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -341,13 +324,13 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
&& ( (m_Flags & IS_NEW) == 0 ) ) && ( (m_Flags & IS_NEW) == 0 ) )
{ {
/* restore old values and save new ones */ /* restore old values and save new ones */
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy ); SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
/* save in undo list */ /* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED ); ( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */ /* restore new values */
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy ); SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
} }
...@@ -357,7 +340,7 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) ...@@ -357,7 +340,7 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/***************************************************/ /***************************************************/
void EDA_SchComponentStruct::ClearAnnotation() void SCH_COMPONENT::ClearAnnotation()
/***************************************************/ /***************************************************/
/* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1) /* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1)
...@@ -386,16 +369,16 @@ void EDA_SchComponentStruct::ClearAnnotation() ...@@ -386,16 +369,16 @@ void EDA_SchComponentStruct::ClearAnnotation()
/**************************************************************/ /**************************************************************/
EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy() SCH_COMPONENT* SCH_COMPONENT::GenCopy()
/**************************************************************/ /**************************************************************/
{ {
EDA_SchComponentStruct* new_item = new EDA_SchComponentStruct( m_Pos ); SCH_COMPONENT* new_item = new SCH_COMPONENT( m_Pos );
int ii; int ii;
new_item->m_Multi = m_Multi; new_item->m_Multi = m_Multi;
new_item->m_ChipName = m_ChipName; new_item->m_ChipName = m_ChipName;
new_item->m_PrefixString = m_PrefixString; new_item->m_PrefixString = m_PrefixString;
//new_item->m_FlagControlMulti = m_FlagControlMulti; //new_item->m_FlagControlMulti = m_FlagControlMulti;
new_item->m_UsedOnSheets = m_UsedOnSheets; new_item->m_UsedOnSheets = m_UsedOnSheets;
...@@ -418,7 +401,7 @@ EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy() ...@@ -418,7 +401,7 @@ EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy()
/*****************************************************************/ /*****************************************************************/
void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate ) void SCH_COMPONENT::SetRotationMiroir( int type_rotate )
/******************************************************************/ /******************************************************************/
/* Compute the new matrix transform for a schematic component /* Compute the new matrix transform for a schematic component
...@@ -561,7 +544,7 @@ void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate ) ...@@ -561,7 +544,7 @@ void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate )
/****************************************************/ /****************************************************/
int EDA_SchComponentStruct::GetRotationMiroir() int SCH_COMPONENT::GetRotationMiroir()
/****************************************************/ /****************************************************/
{ {
int type_rotate = CMP_ORIENT_0; int type_rotate = CMP_ORIENT_0;
...@@ -626,7 +609,7 @@ int EDA_SchComponentStruct::GetRotationMiroir() ...@@ -626,7 +609,7 @@ int EDA_SchComponentStruct::GetRotationMiroir()
/***********************************************************************/ /***********************************************************************/
wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord ) wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
/***********************************************************************/ /***********************************************************************/
/* Renvoie la coordonn�e du point coord, en fonction de l'orientation /* Renvoie la coordonn�e du point coord, en fonction de l'orientation
...@@ -651,7 +634,7 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord ) ...@@ -651,7 +634,7 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord )
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void EDA_SchComponentStruct::Show( int nestLevel, std::ostream& os ) void SCH_COMPONENT::Show( int nestLevel, std::ostream& os )
{ {
// for now, make it look like XML: // for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
...@@ -748,7 +731,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const ...@@ -748,7 +731,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
int orient; int orient;
int dx, dy, x1, y1, x2, y2; int dx, dy, x1, y1, x2, y2;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) m_Parent; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
orient = m_Orient; orient = m_Orient;
wxPoint pos = DrawLibItem->m_Pos; wxPoint pos = DrawLibItem->m_Pos;
......
...@@ -65,35 +65,21 @@ public: ...@@ -65,35 +65,21 @@ public:
}; };
/* the class DrawPartStruct describes a basic virtual component WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
* Not used directly:
* used classes are EDA_SchComponentStruct (the "classic" schematic component, below) /**
* and the Pseudo component DrawSheetStruct * Class SCH_COMPONENT
* describes a real schematic component
*/ */
class DrawPartStruct : public EDA_BaseStruct class SCH_COMPONENT : public SCH_ITEM
{ {
public: public:
int m_Layer; int m_Multi; /* In multi unit chip - which unit to draw. */
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
PartTextStruct m_Field[NUMBER_OF_FIELDS];
wxPoint m_Pos; /* Exact position of part. */
public: wxPoint m_Pos;
DrawPartStruct( KICAD_T struct_type, const wxPoint& pos );
~DrawPartStruct();
virtual wxString GetClass() const wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
{ PartTextStruct m_Field[NUMBER_OF_FIELDS];
return wxT( "DrawPart" );
}
};
WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
/* the class EDA_SchComponentStruct describes a real component */
class EDA_SchComponentStruct : public DrawPartStruct
{
public:
int m_Multi; /* In multi unit chip - which unit to draw. */
//int m_FlagControlMulti; //int m_FlagControlMulti;
ArrayOfSheetLists m_UsedOnSheets; ArrayOfSheetLists m_UsedOnSheets;
...@@ -108,16 +94,16 @@ public: ...@@ -108,16 +94,16 @@ public:
* determined, upon file load, by the first non-digits in the reference fields. */ * determined, upon file load, by the first non-digits in the reference fields. */
public: public:
EDA_SchComponentStruct( const wxPoint& pos = wxPoint( 0, 0 ) ); SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ) );
~EDA_SchComponentStruct( void ) { } ~SCH_COMPONENT() { }
virtual wxString GetClass() const virtual wxString GetClass() const
{ {
return wxT( "EDA_SchComponent" ); return wxT( "SCH_COMPONENT" );
} }
EDA_SchComponentStruct* GenCopy(); SCH_COMPONENT* GenCopy();
void SetRotationMiroir( int type ); void SetRotationMiroir( int type );
int GetRotationMiroir(); int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord ); wxPoint GetScreenCoord( const wxPoint& coord );
...@@ -143,7 +129,7 @@ public: ...@@ -143,7 +129,7 @@ public:
const wxPoint& offset, const wxPoint& offset,
int draw_mode, int draw_mode,
int Color = -1 ); int Color = -1 );
void SwapData( EDA_SchComponentStruct* copyitem ); void SwapData( SCH_COMPONENT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
......
...@@ -42,7 +42,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -42,7 +42,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxString msg; wxString msg;
wxPoint mouse_position = GetScreen()->m_MousePosition; wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin* Pin = NULL; LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL; SCH_COMPONENT* LibItem = NULL;
DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin ); DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) ) if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
...@@ -57,15 +57,15 @@ SchematicGeneralLocateAndDisplay( bool IncludePin ) ...@@ -57,15 +57,15 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
{ {
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE: case COMPONENT_FIELD_DRAW_TYPE:
LibItem = (EDA_SchComponentStruct*) DrawStruct->m_Parent; LibItem = (SCH_COMPONENT*) DrawStruct->m_Parent;
SendMessageToPCBNEW( DrawStruct,LibItem ); SendMessageToPCBNEW( DrawStruct,LibItem );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, &LibItem ); Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, &LibItem );
if( Pin ) if( Pin )
break; // Priority is probing a pin first break; // Priority is probing a pin first
LibItem = (EDA_SchComponentStruct*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
SendMessageToPCBNEW( DrawStruct, LibItem ); SendMessageToPCBNEW( DrawStruct, LibItem );
break; break;
...@@ -118,7 +118,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) ...@@ -118,7 +118,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
{ {
EDA_BaseStruct* DrawStruct; EDA_BaseStruct* DrawStruct;
LibDrawPin* Pin; LibDrawPin* Pin;
EDA_SchComponentStruct* LibItem; SCH_COMPONENT* LibItem;
wxString Text; wxString Text;
wxString msg; wxString msg;
int ii; int ii;
...@@ -175,7 +175,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) ...@@ -175,7 +175,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
if( DrawStruct ) if( DrawStruct )
{ {
PartTextStruct* Field = (PartTextStruct*) DrawStruct; PartTextStruct* Field = (PartTextStruct*) DrawStruct;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent; LibItem = (SCH_COMPONENT*) Field->m_Parent;
LibItem->Display_Infos( this ); LibItem->Display_Infos( this );
return DrawStruct; return DrawStruct;
...@@ -199,7 +199,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) ...@@ -199,7 +199,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
if( DrawStruct ) if( DrawStruct )
{ {
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
LibItem = (EDA_SchComponentStruct*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
LibItem->Display_Infos( this ); LibItem->Display_Infos( this );
return DrawStruct; return DrawStruct;
} }
......
...@@ -86,7 +86,7 @@ void RemoteCommand( const char* cmdline ) ...@@ -86,7 +86,7 @@ void RemoteCommand( const char* cmdline )
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
EDA_SchComponentStruct* LibItem ) SCH_COMPONENT* LibItem )
/*****************************************************************************/ /*****************************************************************************/
/** Send a remote command to eeschema via a socket, /** Send a remote command to eeschema via a socket,
...@@ -116,8 +116,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT ...@@ -116,8 +116,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
} }
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
LibItem = (EDA_SchComponentStruct*) objectToSync; LibItem = (SCH_COMPONENT*) objectToSync;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) ); sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line ); SendCommand( MSG_TO_PCB, Line );
break; break;
......
...@@ -47,7 +47,7 @@ DanglingEndHandle* ItemList; ...@@ -47,7 +47,7 @@ DanglingEndHandle* ItemList;
static void TestWireForDangling( EDA_DrawLineStruct* DrawRef, static void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
WinEDA_SchematicFrame* frame, wxDC* DC ); WinEDA_SchematicFrame* frame, wxDC* DC );
void TestLabelForDangling( DrawTextStruct* label, void TestLabelForDangling( SCH_TEXT* label,
WinEDA_SchematicFrame* frame, wxDC* DC ); WinEDA_SchematicFrame* frame, wxDC* DC );
DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ); DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList );
...@@ -111,11 +111,11 @@ void WinEDA_SchematicFrame::TestDanglingEnds( EDA_BaseStruct* DrawList, wxDC* DC ...@@ -111,11 +111,11 @@ void WinEDA_SchematicFrame::TestDanglingEnds( EDA_BaseStruct* DrawList, wxDC* DC
{ {
switch( DrawItem->Type() ) switch( DrawItem->Type() )
{ {
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawItem ) #define STRUCT ( (SCH_LABEL*) DrawItem )
TestLabelForDangling( STRUCT, this, DC ); TestLabelForDangling( STRUCT, this, DC );
break; break;
break; break;
...@@ -155,7 +155,7 @@ LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( EDA_BaseStruct* DrawList, ...@@ -155,7 +155,7 @@ LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( EDA_BaseStruct* DrawList,
* NULL sinon * NULL sinon
*/ */
{ {
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
LibDrawPin* Pin; LibDrawPin* Pin;
wxPoint pinpos; wxPoint pinpos;
...@@ -223,7 +223,7 @@ void TestWireForDangling( EDA_DrawLineStruct* DrawRef, ...@@ -223,7 +223,7 @@ void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
/********************************************************/ /********************************************************/
void TestLabelForDangling( DrawTextStruct* label, void TestLabelForDangling( SCH_TEXT* label,
WinEDA_SchematicFrame* frame, wxDC* DC ) WinEDA_SchematicFrame* frame, wxDC* DC )
/********************************************************/ /********************************************************/
{ {
...@@ -281,7 +281,7 @@ void TestLabelForDangling( DrawTextStruct* label, ...@@ -281,7 +281,7 @@ void TestLabelForDangling( DrawTextStruct* label,
/****************************************************/ /****************************************************/
wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin, wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin,
EDA_SchComponentStruct* DrawLibItem ) SCH_COMPONENT* DrawLibItem )
/****************************************************/ /****************************************************/
/* Retourne la position physique de la pin, qui d�pend de l'orientation /* Retourne la position physique de la pin, qui d�pend de l'orientation
...@@ -316,13 +316,13 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) ...@@ -316,13 +316,13 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
{ {
switch( DrawItem->Type() ) switch( DrawItem->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawItem ) #define STRUCT ( (SCH_LABEL*) DrawItem )
item = new DanglingEndHandle( LABEL_END ); item = new DanglingEndHandle( LABEL_END );
item->m_Item = DrawItem; item->m_Item = DrawItem;
...@@ -395,15 +395,15 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) ...@@ -395,15 +395,15 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
lastitem = item; lastitem = item;
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
{ {
#undef STRUCT #undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) DrawItem ) #define STRUCT ( (SCH_COMPONENT*) DrawItem )
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
Entry = FindLibPart( STRUCT->m_ChipName, wxEmptyString, FIND_ROOT ); Entry = FindLibPart( STRUCT->m_ChipName, wxEmptyString, FIND_ROOT );
if( Entry == NULL ) if( Entry == NULL )
break; break;
LibEDA_BaseStruct* DrawLibItem = Entry->m_Drawings; LibEDA_BaseStruct* DrawLibItem = Entry->m_Drawings;
for( ; DrawLibItem != NULL; DrawLibItem = DrawLibItem->Next() ) for( ; DrawLibItem != NULL; DrawLibItem = DrawLibItem->Next() )
{ {
...@@ -455,7 +455,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList ) ...@@ -455,7 +455,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
break; break;
} }
default: default:
; ;
} }
......
...@@ -280,10 +280,10 @@ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnectio ...@@ -280,10 +280,10 @@ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnectio
if( DelStruct->m_Flags & STRUCT_DELETED ) if( DelStruct->m_Flags & STRUCT_DELETED )
continue; continue;
if( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE ) if( DelStruct->Type() != TYPE_SCH_LABEL )
continue; continue;
GetScreen()->m_Curseur = ( (DrawTextStruct*) DelStruct )->m_Pos; GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos;
EDA_BaseStruct* TstStruct = EDA_BaseStruct* TstStruct =
PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM ); PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM );
......
...@@ -845,7 +845,7 @@ int GenListeCmp( ListComponent* List ) ...@@ -845,7 +845,7 @@ int GenListeCmp( ListComponent* List )
{ {
int ItemCount = 0; int ItemCount = 0;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
DrawSheetPath* sheet; DrawSheetPath* sheet;
/* Build the sheet (not screen) list */ /* Build the sheet (not screen) list */
...@@ -858,9 +858,9 @@ int GenListeCmp( ListComponent* List ) ...@@ -858,9 +858,9 @@ int GenListeCmp( ListComponent* List )
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
ItemCount++; ItemCount++;
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
DrawLibItem->m_Parent = sheet->LastScreen(); DrawLibItem->m_Parent = sheet->LastScreen();
if( List ) if( List )
{ {
...@@ -910,8 +910,8 @@ static int GenListeGLabels( ListLabel* List ) ...@@ -910,8 +910,8 @@ static int GenListeGLabels( ListLabel* List )
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
ItemCount++; ItemCount++;
if( List ) if( List )
{ {
...@@ -1063,12 +1063,12 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 ) ...@@ -1063,12 +1063,12 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 )
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text; Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
else else
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text; Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text; Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
else else
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text; Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
ii = Text1->CmpNoCase( *Text2 ); ii = Text1->CmpNoCase( *Text2 );
...@@ -1102,12 +1102,12 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 ) ...@@ -1102,12 +1102,12 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 )
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text; Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
else else
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text; Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text; Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
else else
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text; Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
ii = Text1->CmpNoCase( *Text2 ); ii = Text1->CmpNoCase( *Text2 );
} }
...@@ -1125,7 +1125,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems ) ...@@ -1125,7 +1125,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
*/ */
{ {
int ii; int ii;
EDA_SchComponentStruct* LibItem; SCH_COMPONENT* LibItem;
wxString OldName, CurrName; wxString OldName, CurrName;
for( ii = 0; ii < NbItems; ii++ ) for( ii = 0; ii < NbItems; ii++ )
...@@ -1149,7 +1149,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems ) ...@@ -1149,7 +1149,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
/*******************************************************************************************/ /*******************************************************************************************/
void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, EDA_SchComponentStruct* DrawLibItem, void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem,
bool CompactForm ) bool CompactForm )
/*******************************************************************************************/ /*******************************************************************************************/
{ {
...@@ -1198,7 +1198,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in ...@@ -1198,7 +1198,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
{ {
int ii, Multi, Unit; int ii, Multi, Unit;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
char NameCmp[80]; char NameCmp[80];
wxString msg; wxString msg;
...@@ -1254,10 +1254,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in ...@@ -1254,10 +1254,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
if( DrawList == NULL ) if( DrawList == NULL )
continue; continue;
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
if( List[ii].m_Ref[0] == '#' ) if( List[ii].m_Ref[0] == '#' )
continue; continue;
...@@ -1313,7 +1313,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in ...@@ -1313,7 +1313,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
int ii, Multi; int ii, Multi;
wxChar Unit; wxChar Unit;
EDA_BaseStruct* DrawList; EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem; SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
wxString msg; wxString msg;
...@@ -1331,10 +1331,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in ...@@ -1331,10 +1331,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
if( DrawList == NULL ) if( DrawList == NULL )
continue; continue;
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue; continue;
DrawLibItem = (EDA_SchComponentStruct*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
if( List[ii].m_Ref[0] == '#' ) if( List[ii].m_Ref[0] == '#' )
continue; continue;
...@@ -1354,10 +1354,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in ...@@ -1354,10 +1354,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
List[ii].m_Ref, Unit ); List[ii].m_Ref, Unit );
// if( s_ListWithSubCmponents ) // if( s_ListWithSubCmponents )
// print the sheet path // print the sheet path
if( m_ListSubCmpItems->GetValue() ) if( m_ListSubCmpItems->GetValue() )
{ {
msg = List[ii].m_SheetList.PathHumanReadable(); msg = List[ii].m_SheetList.PathHumanReadable();
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) ); fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) );
} }
...@@ -1377,7 +1377,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems ) ...@@ -1377,7 +1377,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
/******************************************************************/ /******************************************************************/
{ {
int ii, jj; int ii, jj;
DrawLabelStruct* DrawTextItem; SCH_LABEL* DrawTextItem;
DrawSheetLabelStruct* DrawSheetLabel; DrawSheetLabelStruct* DrawSheetLabel;
ListLabel* LabelItem; ListLabel* LabelItem;
wxString msg, sheetpath; wxString msg, sheetpath;
...@@ -1389,14 +1389,14 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems ) ...@@ -1389,14 +1389,14 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
switch( LabelItem->m_LabelType ) switch( LabelItem->m_LabelType )
{ {
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
DrawTextItem = (DrawLabelStruct*) (LabelItem->m_Label); DrawTextItem = (SCH_LABEL*) (LabelItem->m_Label);
if( LabelItem->m_LabelType == DRAW_HIER_LABEL_STRUCT_TYPE ) if( LabelItem->m_LabelType == TYPE_SCH_HIERLABEL )
labeltype = wxT("Hierarchical"); labeltype = wxT("Hierarchical");
else else
labeltype = wxT("Global "); labeltype = wxT("Global ");
sheetpath = CONV_FROM_UTF8(LabelItem->m_SheetPath); sheetpath = CONV_FROM_UTF8(LabelItem->m_SheetPath);
msg.Printf( msg.Printf(
_( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ), _( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ),
DrawTextItem->m_Text.GetData(), DrawTextItem->m_Text.GetData(),
......
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_build_BOM.h // Name: dialog_build_BOM.h
// Purpose: // Purpose:
// Author: jean-pieere Charras // Author: jean-pieere Charras
// Modified by: // Modified by:
// Created: 01/15/06 18:18:44 // Created: 01/15/06 18:18:44
// RCS-ID: // RCS-ID:
// Copyright: GNU license // Copyright: GNU license
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/15/06 18:18:44 // Generated by DialogBlocks (unregistered), 01/15/06 18:18:44
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
*/ */
class WinEDA_Build_BOM_Frame: public wxDialog class WinEDA_Build_BOM_Frame: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_Build_BOM_Frame ) DECLARE_DYNAMIC_CLASS( WinEDA_Build_BOM_Frame )
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
...@@ -88,11 +88,11 @@ public: ...@@ -88,11 +88,11 @@ public:
/// Constructors /// Constructors
WinEDA_Build_BOM_Frame( ); WinEDA_Build_BOM_Frame( );
WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent, WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent,
wxWindowID id = SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME, wxWindowID id = SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE, const wxString& caption = SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE,
const wxPoint& pos = SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION, const wxPoint& pos = SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION,
const wxSize& size = SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE, const wxSize& size = SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE,
long style = SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE ); long style = SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE );
/// Creation /// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE, long style = SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE, long style = SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE );
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
////@end WinEDA_Build_BOM_Frame event handler declarations ////@end WinEDA_Build_BOM_Frame event handler declarations
void GenList(); void GenList();
////@begin WinEDA_Build_BOM_Frame member function declarations ////@begin WinEDA_Build_BOM_Frame member function declarations
...@@ -129,12 +129,12 @@ public: ...@@ -129,12 +129,12 @@ public:
/// Retrieves icon resources /// Retrieves icon resources
wxIcon GetIconResource( const wxString& name ); wxIcon GetIconResource( const wxString& name );
////@end WinEDA_Build_BOM_Frame member function declarations ////@end WinEDA_Build_BOM_Frame member function declarations
void GenereListeOfItems(const wxString & FullFileName); void GenereListeOfItems(const wxString & FullFileName);
void CreateExportList(const wxString & FullFileName); void CreateExportList(const wxString & FullFileName);
int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE ); int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE );
int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems); int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems);
void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem, bool CompactForm = FALSE); void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
void SavePreferences(); void SavePreferences();
/// Should we show tooltips? /// Should we show tooltips?
...@@ -161,9 +161,9 @@ public: ...@@ -161,9 +161,9 @@ public:
wxCheckBox* m_AddField8; wxCheckBox* m_AddField8;
////@end WinEDA_Build_BOM_Frame member variables ////@end WinEDA_Build_BOM_Frame member variables
WinEDA_DrawFrame * m_Parent; WinEDA_DrawFrame * m_Parent;
wxString m_LibArchiveFileName; wxString m_LibArchiveFileName;
wxString m_ListFileName; wxString m_ListFileName;
}; };
#endif #endif
......
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_component_in_schematic.cpp // Name: dialog_edit_component_in_schematic.cpp
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 03/03/2006 15:02:54 // Created: 03/03/2006 15:02:54
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 03/03/2006 15:02:54 // Generated by DialogBlocks (unregistered), 03/03/2006 15:02:54
...@@ -41,7 +41,7 @@ BEGIN_EVENT_TABLE( WinEDA_ComponentPropertiesFrame, wxDialog ) ...@@ -41,7 +41,7 @@ BEGIN_EVENT_TABLE( WinEDA_ComponentPropertiesFrame, wxDialog )
////@end WinEDA_ComponentPropertiesFrame event table entries ////@end WinEDA_ComponentPropertiesFrame event table entries
EVT_RADIOBOX(ID_ON_SELECT_FIELD, WinEDA_ComponentPropertiesFrame::SelectNewField) EVT_RADIOBOX(ID_ON_SELECT_FIELD, WinEDA_ComponentPropertiesFrame::SelectNewField)
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -54,21 +54,21 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( ) ...@@ -54,21 +54,21 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( )
} }
WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
EDA_SchComponentStruct * cmp, SCH_COMPONENT * cmp,
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{ {
m_Parent = parent; m_Parent = parent;
m_Cmp = cmp; m_Cmp = cmp;
m_LibEntry = FindLibPart(m_Cmp->m_ChipName.GetData(), wxEmptyString, FIND_ROOT); m_LibEntry = FindLibPart(m_Cmp->m_ChipName.GetData(), wxEmptyString, FIND_ROOT);
InitBuffers(); InitBuffers();
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
if ( m_LibEntry == NULL ) if ( m_LibEntry == NULL )
{ {
SetTitle(_("Component properties (Not found in lib)")); SetTitle(_("Component properties (Not found in lib)"));
} }
} }
/*! /*!
...@@ -77,7 +77,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_Schemat ...@@ -77,7 +77,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_Schemat
bool WinEDA_ComponentPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) bool WinEDA_ComponentPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{ {
m_FieldNameCtrl = NULL; m_FieldNameCtrl = NULL;
////@begin WinEDA_ComponentPropertiesFrame member initialisation ////@begin WinEDA_ComponentPropertiesFrame member initialisation
m_GeneralBoxSizer = NULL; m_GeneralBoxSizer = NULL;
m_NoteBook = NULL; m_NoteBook = NULL;
...@@ -114,9 +114,9 @@ bool WinEDA_ComponentPropertiesFrame::Create( wxWindow* parent, wxWindowID id, c ...@@ -114,9 +114,9 @@ bool WinEDA_ComponentPropertiesFrame::Create( wxWindow* parent, wxWindowID id, c
*/ */
void WinEDA_ComponentPropertiesFrame::CreateControls() void WinEDA_ComponentPropertiesFrame::CreateControls()
{ {
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
////@begin WinEDA_ComponentPropertiesFrame content construction ////@begin WinEDA_ComponentPropertiesFrame content construction
// Generated by DialogBlocks, 07/11/2007 08:28:00 (unregistered) // Generated by DialogBlocks, 07/11/2007 08:28:00 (unregistered)
...@@ -242,8 +242,8 @@ void WinEDA_ComponentPropertiesFrame::CreateControls() ...@@ -242,8 +242,8 @@ void WinEDA_ComponentPropertiesFrame::CreateControls()
itemBoxSizer23->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer23->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end WinEDA_ComponentPropertiesFrame content construction ////@end WinEDA_ComponentPropertiesFrame content construction
BuildPanelBasic(); BuildPanelBasic();
BuildPanelFields(); BuildPanelFields();
} }
/*! /*!
...@@ -295,7 +295,7 @@ void WinEDA_ComponentPropertiesFrame::OnCancelClick( wxCommandEvent& event ) ...@@ -295,7 +295,7 @@ void WinEDA_ComponentPropertiesFrame::OnCancelClick( wxCommandEvent& event )
void WinEDA_ComponentPropertiesFrame::OnRestoreCmpDefaultsClick( wxCommandEvent& event ) void WinEDA_ComponentPropertiesFrame::OnRestoreCmpDefaultsClick( wxCommandEvent& event )
{ {
SetInitCmp(event); SetInitCmp(event);
} }
/*! /*!
...@@ -304,5 +304,5 @@ void WinEDA_ComponentPropertiesFrame::OnRestoreCmpDefaultsClick( wxCommandEvent& ...@@ -304,5 +304,5 @@ void WinEDA_ComponentPropertiesFrame::OnRestoreCmpDefaultsClick( wxCommandEvent&
void WinEDA_ComponentPropertiesFrame::OnOkClick( wxCommandEvent& event ) void WinEDA_ComponentPropertiesFrame::OnOkClick( wxCommandEvent& event )
{ {
ComponentPropertiesAccept(event); ComponentPropertiesAccept(event);
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_component_in_schematic.h // Name: dialog_edit_component_in_schematic.h
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 03/03/2006 15:02:54 // Created: 03/03/2006 15:02:54
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 03/03/2006 15:02:54 // Generated by DialogBlocks (unregistered), 03/03/2006 15:02:54
...@@ -68,7 +68,7 @@ class wxNotebook; ...@@ -68,7 +68,7 @@ class wxNotebook;
*/ */
class WinEDA_ComponentPropertiesFrame: public wxDialog class WinEDA_ComponentPropertiesFrame: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_ComponentPropertiesFrame ) DECLARE_DYNAMIC_CLASS( WinEDA_ComponentPropertiesFrame )
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
...@@ -76,8 +76,8 @@ public: ...@@ -76,8 +76,8 @@ public:
/// Constructors /// Constructors
WinEDA_ComponentPropertiesFrame( ); WinEDA_ComponentPropertiesFrame( );
WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
EDA_SchComponentStruct * cmp, SCH_COMPONENT * cmp,
wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE ); wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE );
/// Creation /// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE );
...@@ -110,14 +110,14 @@ public: ...@@ -110,14 +110,14 @@ public:
/// Should we show tooltips? /// Should we show tooltips?
static bool ShowToolTips(); static bool ShowToolTips();
void InitBuffers(); void InitBuffers();
void BuildPanelBasic(); void BuildPanelBasic();
void BuildPanelFields(); void BuildPanelFields();
void ComponentPropertiesAccept(wxCommandEvent& event); void ComponentPropertiesAccept(wxCommandEvent& event);
void SetInitCmp( wxCommandEvent& event ); void SetInitCmp( wxCommandEvent& event );
void CopyDataToPanelField(); void CopyDataToPanelField();
void CopyPanelFieldToData(); void CopyPanelFieldToData();
void SelectNewField(wxCommandEvent& event); void SelectNewField(wxCommandEvent& event);
////@begin WinEDA_ComponentPropertiesFrame member variables ////@begin WinEDA_ComponentPropertiesFrame member variables
wxBoxSizer* m_GeneralBoxSizer; wxBoxSizer* m_GeneralBoxSizer;
...@@ -136,21 +136,21 @@ public: ...@@ -136,21 +136,21 @@ public:
wxBoxSizer* m_FieldSelectionBoxSizer; wxBoxSizer* m_FieldSelectionBoxSizer;
////@end WinEDA_ComponentPropertiesFrame member variables ////@end WinEDA_ComponentPropertiesFrame member variables
WinEDA_SchematicFrame * m_Parent; WinEDA_SchematicFrame * m_Parent;
EDA_SchComponentStruct * m_Cmp; SCH_COMPONENT * m_Cmp;
EDA_LibComponentStruct * m_LibEntry; EDA_LibComponentStruct * m_LibEntry;
int m_CurrentFieldId; int m_CurrentFieldId;
wxRadioBox * m_FieldSelection; wxRadioBox * m_FieldSelection;
WinEDA_GraphicTextCtrl * m_FieldTextCtrl; WinEDA_GraphicTextCtrl * m_FieldTextCtrl;
WinEDA_EnterText * m_FieldNameCtrl; WinEDA_EnterText * m_FieldNameCtrl;
WinEDA_PositionCtrl * m_FieldPositionCtrl; WinEDA_PositionCtrl * m_FieldPositionCtrl;
wxString m_FieldText[NUMBER_OF_FIELDS]; wxString m_FieldText[NUMBER_OF_FIELDS];
wxString m_FieldName[NUMBER_OF_FIELDS]; wxString m_FieldName[NUMBER_OF_FIELDS];
wxPoint m_FieldPosition[NUMBER_OF_FIELDS]; wxPoint m_FieldPosition[NUMBER_OF_FIELDS];
int m_FieldSize[NUMBER_OF_FIELDS]; int m_FieldSize[NUMBER_OF_FIELDS];
int m_FieldFlags[NUMBER_OF_FIELDS]; int m_FieldFlags[NUMBER_OF_FIELDS];
int m_FieldOrient[NUMBER_OF_FIELDS]; int m_FieldOrient[NUMBER_OF_FIELDS];
}; };
#endif #endif
......
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.cpp // Name: dialog_edit_label.cpp
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 19/02/2006 15:46:26 // Created: 19/02/2006 15:46:26
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 19/02/2006 15:46:26 // Generated by DialogBlocks (unregistered), 19/02/2006 15:46:26
...@@ -51,42 +51,42 @@ WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( ) ...@@ -51,42 +51,42 @@ WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( )
} }
WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
DrawTextStruct * CurrentText, SCH_TEXT * CurrentText,
const wxPoint& pos, const wxPoint& pos,
wxWindowID id, const wxString& caption, const wxSize& size, long style ) wxWindowID id, const wxString& caption, const wxSize& size, long style )
{ {
wxString msg; wxString msg;
m_Parent = parent; m_Parent = parent;
m_CurrentText = CurrentText; m_CurrentText = CurrentText;
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
m_TextLabel->SetValue(m_CurrentText->m_Text); m_TextLabel->SetValue(m_CurrentText->m_Text);
m_TextLabel->SetFocus(); m_TextLabel->SetFocus();
switch( m_CurrentText->Type() ) switch( m_CurrentText->Type() )
{ {
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
SetTitle(_("Global Label properties")); SetTitle(_("Global Label properties"));
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
SetTitle(_("Hierarchal Label properties")); SetTitle(_("Hierarchal Label properties"));
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
SetTitle(_("Label properties")); SetTitle(_("Label properties"));
break; break;
default: default:
SetTitle(_("Text properties")); SetTitle(_("Text properties"));
break; break;
} }
msg = m_SizeTitle->GetLabel() + ReturnUnitSymbol(); msg = m_SizeTitle->GetLabel() + ReturnUnitSymbol();
m_SizeTitle->SetLabel(msg); m_SizeTitle->SetLabel(msg);
msg = ReturnStringFromValue(g_UnitMetric, m_CurrentText->m_Size.x, m_Parent->m_InternalUnits); msg = ReturnStringFromValue(g_UnitMetric, m_CurrentText->m_Size.x, m_Parent->m_InternalUnits);
m_TextSize->SetValue(msg); m_TextSize->SetValue(msg);
} }
/*! /*!
...@@ -120,8 +120,8 @@ bool WinEDA_LabelPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const ...@@ -120,8 +120,8 @@ bool WinEDA_LabelPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const
*/ */
void WinEDA_LabelPropertiesFrame::CreateControls() void WinEDA_LabelPropertiesFrame::CreateControls()
{ {
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
////@begin WinEDA_LabelPropertiesFrame content construction ////@begin WinEDA_LabelPropertiesFrame content construction
// Generated by DialogBlocks, 07/11/2007 12:37:47 (unregistered) // Generated by DialogBlocks, 07/11/2007 12:37:47 (unregistered)
...@@ -189,8 +189,8 @@ void WinEDA_LabelPropertiesFrame::CreateControls() ...@@ -189,8 +189,8 @@ void WinEDA_LabelPropertiesFrame::CreateControls()
m_TextShape->SetValidator( wxGenericValidator(& m_CurrentText->m_Shape) ); m_TextShape->SetValidator( wxGenericValidator(& m_CurrentText->m_Shape) );
////@end WinEDA_LabelPropertiesFrame content construction ////@end WinEDA_LabelPropertiesFrame content construction
if (m_CurrentText->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || if (m_CurrentText->Type() == TYPE_SCH_GLOBALLABEL ||
m_CurrentText->Type() == DRAW_HIER_LABEL_STRUCT_TYPE) m_CurrentText->Type() == TYPE_SCH_HIERLABEL)
m_TextShape->Show(true); m_TextShape->Show(true);
} }
......
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.h // Name: dialog_edit_label.h
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 19/02/2006 15:46:26 // Created: 19/02/2006 15:46:26
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 19/02/2006 15:46:26 // Generated by DialogBlocks (unregistered), 19/02/2006 15:46:26
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
*/ */
class WinEDA_LabelPropertiesFrame: public wxDialog class WinEDA_LabelPropertiesFrame: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_LabelPropertiesFrame ) DECLARE_DYNAMIC_CLASS( WinEDA_LabelPropertiesFrame )
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
...@@ -68,9 +68,9 @@ public: ...@@ -68,9 +68,9 @@ public:
/// Constructors /// Constructors
WinEDA_LabelPropertiesFrame( ); WinEDA_LabelPropertiesFrame( );
WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent, WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
DrawTextStruct * CurrentText, SCH_TEXT * CurrentText,
const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION, const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION,
wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE ); wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE );
/// Creation /// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE );
...@@ -99,8 +99,8 @@ public: ...@@ -99,8 +99,8 @@ public:
/// Should we show tooltips? /// Should we show tooltips?
static bool ShowToolTips(); static bool ShowToolTips();
void TextPropertiesAccept(wxCommandEvent& event); void TextPropertiesAccept(wxCommandEvent& event);
////@begin WinEDA_LabelPropertiesFrame member variables ////@begin WinEDA_LabelPropertiesFrame member variables
wxTextCtrl* m_TextLabel; wxTextCtrl* m_TextLabel;
wxRadioBox* m_TextOrient; wxRadioBox* m_TextOrient;
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
////@end WinEDA_LabelPropertiesFrame member variables ////@end WinEDA_LabelPropertiesFrame member variables
WinEDA_SchematicFrame * m_Parent; WinEDA_SchematicFrame * m_Parent;
DrawTextStruct * m_CurrentText; SCH_TEXT * m_CurrentText;
}; };
......
This diff is collapsed.
...@@ -69,7 +69,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept( wxCommandEvent& event ) ...@@ -69,7 +69,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept( wxCommandEvent& event )
/********************************************************************************/ /********************************************************************************/
void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ) void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC )
/********************************************************************************/ /********************************************************************************/
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
...@@ -87,10 +87,10 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ...@@ -87,10 +87,10 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
switch( TextStruct->Type() ) switch( TextStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
ItemInitialPosition = TextStruct->m_Pos; ItemInitialPosition = TextStruct->m_Pos;
OldSize = TextStruct->m_Size; OldSize = TextStruct->m_Size;
OldOrient = TextStruct->m_Orient; OldOrient = TextStruct->m_Orient;
...@@ -101,13 +101,13 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ...@@ -101,13 +101,13 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
} }
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = ItemInitialPosition; GetScreen()->m_Curseur = ItemInitialPosition;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->ManageCurseur = ShowWhileMoving; DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitMoveTexte; DrawPanel->ForceCloseManageCurseur = ExitMoveTexte;
GetScreen()->SetCurItem( TextStruct ); GetScreen()->SetCurItem( TextStruct );
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE ); DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC );
...@@ -115,7 +115,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ...@@ -115,7 +115,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
/*************************************************************************/ /*************************************************************************/
void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct, void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* TextStruct,
wxDC* DC ) wxDC* DC )
/*************************************************************************/ /*************************************************************************/
...@@ -140,11 +140,11 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct, ...@@ -140,11 +140,11 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
/***********************************************************************************/ /***********************************************************************************/
void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC ) void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
/***********************************************************************************/ /***********************************************************************************/
{ {
if( TextStruct == NULL ) if( TextStruct == NULL )
TextStruct = (DrawTextStruct*) PickStruct( GetScreen()->m_Curseur, TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur,
GetScreen(), TEXTITEM | LABELITEM ); GetScreen(), TEXTITEM | LABELITEM );
if( TextStruct == NULL ) if( TextStruct == NULL )
return; return;
...@@ -160,10 +160,10 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* ...@@ -160,10 +160,10 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC*
/* Rotation du texte */ /* Rotation du texte */
switch( TextStruct->Type() ) switch( TextStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
TextStruct->m_Orient++; TextStruct->m_Orient++;
TextStruct->m_Orient &= 3; TextStruct->m_Orient &= 3;
break; break;
...@@ -187,28 +187,28 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) ...@@ -187,28 +187,28 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
/* Routine to create new text struct (GraphicText, label or Glabel). /* Routine to create new text struct (GraphicText, label or Glabel).
*/ */
{ {
DrawTextStruct* NewText = NULL; SCH_TEXT* NewText = NULL;
g_ItemToRepeat = NULL; g_ItemToRepeat = NULL;
switch( type ) switch( type )
{ {
case LAYER_NOTES: case LAYER_NOTES:
NewText = new DrawTextStruct( GetScreen()->m_Curseur ); NewText = new SCH_TEXT( GetScreen()->m_Curseur );
break; break;
case LAYER_LOCLABEL: case LAYER_LOCLABEL:
NewText = new DrawLabelStruct( GetScreen()->m_Curseur ); NewText = new SCH_LABEL( GetScreen()->m_Curseur );
break; break;
case LAYER_HIERLABEL: case LAYER_HIERLABEL:
NewText = new DrawHierLabelStruct(GetScreen()->m_Curseur ); NewText = new SCH_HIERLABEL(GetScreen()->m_Curseur );
NewText->m_Shape = s_DefaultShapeGLabel; NewText->m_Shape = s_DefaultShapeGLabel;
NewText->m_Orient = s_DefaultOrientGLabel; NewText->m_Orient = s_DefaultOrientGLabel;
break; break;
case LAYER_GLOBLABEL: case LAYER_GLOBLABEL:
NewText = new DrawGlobalLabelStruct(GetScreen()->m_Curseur ); NewText = new SCH_GLOBALLABEL(GetScreen()->m_Curseur );
NewText->m_Shape = s_DefaultShapeGLabel; NewText->m_Shape = s_DefaultShapeGLabel;
NewText->m_Orient = s_DefaultOrientGLabel; NewText->m_Orient = s_DefaultOrientGLabel;
break; break;
...@@ -226,11 +226,11 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) ...@@ -226,11 +226,11 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
if( NewText->m_Text.IsEmpty() ) if( NewText->m_Text.IsEmpty() )
{ {
SAFE_DELETE( NewText ); SAFE_DELETE( NewText );
return NULL; return NULL;
} }
if( type == LAYER_GLOBLABEL || type == LAYER_HIERLABEL) if( type == LAYER_GLOBLABEL || type == LAYER_HIERLABEL)
{ {
s_DefaultShapeGLabel = NewText->m_Shape; s_DefaultShapeGLabel = NewText->m_Shape;
s_DefaultOrientGLabel = NewText->m_Orient; s_DefaultOrientGLabel = NewText->m_Orient;
...@@ -240,7 +240,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) ...@@ -240,7 +240,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
DrawPanel->ManageCurseur = ShowWhileMoving; DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitMoveTexte; DrawPanel->ForceCloseManageCurseur = ExitMoveTexte;
GetScreen()->SetCurItem( NewText ); GetScreen()->SetCurItem( NewText );
return NewText; return NewText;
} }
...@@ -260,11 +260,11 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -260,11 +260,11 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* redraw the text */ /* redraw the text */
switch( TextStruct->Type() ) switch( TextStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
( (DrawTextStruct*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur; ( (SCH_TEXT*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur;
break; break;
default: default:
...@@ -297,19 +297,19 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -297,19 +297,19 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
if( Struct->m_Flags & IS_NEW ) if( Struct->m_Flags & IS_NEW )
{ {
SAFE_DELETE( Struct ); SAFE_DELETE( Struct );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
} }
else /* this was a move command on an "old" text: restore its old settings. */ else /* this was a move command on an "old" text: restore its old settings. */
{ {
switch( Struct->Type() ) switch( Struct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
{ {
DrawTextStruct* Text = (DrawTextStruct*) Struct; SCH_TEXT* Text = (SCH_TEXT*) Struct;
Text->m_Pos = ItemInitialPosition; Text->m_Pos = ItemInitialPosition;
Text->m_Size = OldSize; Text->m_Size = OldSize;
Text->m_Orient = OldOrient; Text->m_Orient = OldOrient;
...@@ -327,7 +327,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -327,7 +327,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text,
wxDC* DC, int newtype ) wxDC* DC, int newtype )
/*****************************************************************************/ /*****************************************************************************/
...@@ -339,22 +339,22 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, ...@@ -339,22 +339,22 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
if( Text == NULL ) if( Text == NULL )
return; return;
DrawTextStruct* newtext; SCH_TEXT* newtext;
switch( newtype ) switch( newtype )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
newtext = new DrawLabelStruct( Text->m_Pos, Text->m_Text ); newtext = new SCH_LABEL( Text->m_Pos, Text->m_Text );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
newtext = new DrawGlobalLabelStruct(Text->m_Pos, Text->m_Text ); newtext = new SCH_GLOBALLABEL(Text->m_Pos, Text->m_Text );
break;
case TYPE_SCH_HIERLABEL:
newtext = new SCH_HIERLABEL(Text->m_Pos, Text->m_Text );
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_TEXT:
newtext = new DrawHierLabelStruct(Text->m_Pos, Text->m_Text ); newtext = new SCH_TEXT( Text->m_Pos, Text->m_Text );
break;
case DRAW_TEXT_STRUCT_TYPE:
newtext = new DrawTextStruct( Text->m_Pos, Text->m_Text );
break; break;
default: default:
...@@ -395,13 +395,13 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, ...@@ -395,13 +395,13 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
{ {
Text->m_Flags = 0; Text->m_Flags = 0;
DeleteStruct( DrawPanel, DC, Text ); // old text is really saved in undo list DeleteStruct( DrawPanel, DC, Text ); // old text is really saved in undo list
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
g_ItemToRepeat = NULL; g_ItemToRepeat = NULL;
} }
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
SAFE_DELETE( g_ItemToUndoCopy ); SAFE_DELETE( g_ItemToUndoCopy );
DrawPanel->CursorOff( DC ); // Erase schematic cursor DrawPanel->CursorOff( DC ); // Erase schematic cursor
...@@ -415,15 +415,15 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, ...@@ -415,15 +415,15 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
SaveCopyInUndoList( newtext, IS_NEW ); SaveCopyInUndoList( newtext, IS_NEW );
} }
else else
{ {
GetScreen()->SetCurItem( newtext ); GetScreen()->SetCurItem( newtext );
newtext->m_Flags = IS_NEW; newtext->m_Flags = IS_NEW;
} }
if( (flags & IS_MOVED) != 0 ) if( (flags & IS_MOVED) != 0 )
{ {
GetScreen()->SetCurItem( newtext ); GetScreen()->SetCurItem( newtext );
StartMoveTexte( newtext, DC ); StartMoveTexte( newtext, DC );
} }
......
...@@ -376,9 +376,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -376,9 +376,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y; STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x; STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y; STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
...@@ -389,11 +389,11 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC ) ...@@ -389,11 +389,11 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat ) #define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy(); g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x; STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y; STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
...@@ -474,7 +474,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -474,7 +474,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
* - une jonction * - une jonction
* - ou une pin * - ou une pin
* - ou une extr�mit� unique de fil * - ou une extr�mit� unique de fil
* *
* - type BUS, si il y a * - type BUS, si il y a
* - ou une extr�mit� unique de BUS * - ou une extr�mit� unique de BUS
*/ */
...@@ -528,9 +528,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer ) ...@@ -528,9 +528,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE; return TRUE;
item = PickStruct( screen, LABELITEM ); item = PickStruct( screen, LABELITEM );
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE) if( item && (item->Type() != TYPE_SCH_TEXT)
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) ) && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
return TRUE; return TRUE;
pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList ); pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList );
......
...@@ -40,7 +40,7 @@ static int s_ItemSelectColor = BROWN; ...@@ -40,7 +40,7 @@ static int s_ItemSelectColor = BROWN;
static EDA_LibComponentStruct* DummyCmp; static EDA_LibComponentStruct* DummyCmp;
static int* Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings static int* Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings
static void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, static void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_SchComponentStruct* Component, SCH_COMPONENT* Component,
EDA_LibComponentStruct* Entry, EDA_LibComponentStruct* Entry,
const wxPoint& Pos, const wxPoint& Pos,
int TransMat[2][2], int TransMat[2][2],
...@@ -82,9 +82,9 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -82,9 +82,9 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
* posX, posY = position du composant * posX, posY = position du composant
* DrawMode = GrOR .. * DrawMode = GrOR ..
* Color = 0 : dessin en vraies couleurs, sinon couleur = Color * Color = 0 : dessin en vraies couleurs, sinon couleur = Color
* *
* Une croix symbolise le point d'accrochage (ref position) du composant * Une croix symbolise le point d'accrochage (ref position) du composant
* *
* Le composant est toujours trace avec orientation 0 * Le composant est toujours trace avec orientation 0
*/ */
{ {
...@@ -204,7 +204,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -204,7 +204,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
* Routine to draw the given part at given position, transformed/mirror as * * Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... * * specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/ *****************************************************************************/
void EDA_SchComponentStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
{ {
EDA_LibComponentStruct* Entry; EDA_LibComponentStruct* Entry;
...@@ -262,7 +262,7 @@ void DrawTextField( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -262,7 +262,7 @@ void DrawTextField( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
int orient, color; int orient, color;
wxPoint pos; /* Position des textes */ wxPoint pos; /* Position des textes */
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) Field->m_Parent; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) Field->m_Parent;
int hjustify, vjustify; int hjustify, vjustify;
int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth ); int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth );
...@@ -357,30 +357,30 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName ...@@ -357,30 +357,30 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
PQCompFunc( (PQCompFuncType) LibraryEntryCompare ); PQCompFunc( (PQCompFuncType) LibraryEntryCompare );
Entry = NULL; Entry = NULL;
FindLibName.Empty(); FindLibName.Empty();
while( Lib ) while( Lib )
{ {
if( !LibName.IsEmpty() ) if( !LibName.IsEmpty() )
{ {
if( Lib->m_Name != LibName ) if( Lib->m_Name != LibName )
{ {
Lib = Lib->m_Pnext; Lib = Lib->m_Pnext;
continue; continue;
} }
} }
if( Lib == NULL ) if( Lib == NULL )
break; break;
Entry = (EDA_LibComponentStruct*) PQFind( Lib->m_Entries, &DummyEntry ); Entry = (EDA_LibComponentStruct*) PQFind( Lib->m_Entries, &DummyEntry );
if( Entry != NULL ) if( Entry != NULL )
{ {
FindLibName = Lib->m_Name; FindLibName = Lib->m_Name;
break; break;
} }
Lib = Lib->m_Pnext; Lib = Lib->m_Pnext;
} }
...@@ -404,7 +404,7 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName ...@@ -404,7 +404,7 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
*****************************************************************************/ *****************************************************************************/
/* DrawMode = GrXOR, GrOR ..*/ /* DrawMode = GrXOR, GrOR ..*/
void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_SchComponentStruct* Component, SCH_COMPONENT* Component,
EDA_LibComponentStruct* Entry, EDA_LibComponentStruct* Entry,
const wxPoint& Pos, const wxPoint& Pos,
int TransMat[2][2], int TransMat[2][2],
...@@ -431,13 +431,13 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -431,13 +431,13 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
/* Elimination des elements non relatifs a l'unite */ /* Elimination des elements non relatifs a l'unite */
if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) ) if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) )
continue; continue;
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) ) if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue; continue;
if( DEntry->m_Flags & IS_MOVED ) if( DEntry->m_Flags & IS_MOVED )
continue; // Element en deplacement non trace continue; // Element en deplacement non trace
SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0; SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
LineWidth = MAX( DEntry->m_Width, g_DrawMinimunLineWidth ); LineWidth = MAX( DEntry->m_Width, g_DrawMinimunLineWidth );
...@@ -502,12 +502,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -502,12 +502,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
LibDrawCircle* Circle = (LibDrawCircle*) DEntry; LibDrawCircle* Circle = (LibDrawCircle*) DEntry;
CharColor = GETCOLOR( LAYER_DEVICE ); CharColor = GETCOLOR( LAYER_DEVICE );
x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x + x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
TransMat[0][1] * Circle->m_Pos.y; TransMat[0][1] * Circle->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x + y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
TransMat[1][1] * Circle->m_Pos.y; TransMat[1][1] * Circle->m_Pos.y;
fill_option = Circle->m_Fill & (~g_PrintFillMask); fill_option = Circle->m_Fill & (~g_PrintFillMask);
if( Color < 0 ) if( Color < 0 )
{ {
...@@ -536,12 +536,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -536,12 +536,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
/* The text orientation may need to be flipped if the /* The text orientation may need to be flipped if the
* transformation matrix cuases xy axes to be flipped. */ * transformation matrix cuases xy axes to be flipped. */
t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0); t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
+ TransMat[0][1] * Text->m_Pos.y; + TransMat[0][1] * Text->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
+ TransMat[1][1] * Text->m_Pos.y; + TransMat[1][1] * Text->m_Pos.y;
DrawGraphicText( panel, DC, wxPoint( x1, y1 ), CharColor, Text->m_Text, DrawGraphicText( panel, DC, wxPoint( x1, y1 ), CharColor, Text->m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
Text->m_Size, Text->m_Size,
...@@ -591,7 +591,7 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -591,7 +591,7 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
&&*/ !g_ShowAllPins ) &&*/ !g_ShowAllPins )
break; break;
} }
/* Calcul de l'orientation reelle de la Pin */ /* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient( TransMat ); orient = Pin->ReturnPinDrawOrient( TransMat );
...@@ -896,7 +896,7 @@ bool MapAngles( int* Angle1, int* Angle2, int TransMat[2][2] ) ...@@ -896,7 +896,7 @@ bool MapAngles( int* Angle1, int* Angle2, int TransMat[2][2] )
*****************************************************************************/ *****************************************************************************/
void DrawingLibInGhost( WinEDA_DrawPanel* panel, wxDC* DC, void DrawingLibInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_LibComponentStruct* LibEntry, EDA_LibComponentStruct* LibEntry,
EDA_SchComponentStruct* DrawLibItem, int PartX, int PartY, SCH_COMPONENT* DrawLibItem, int PartX, int PartY,
int multi, int convert, int Color, bool DrawPinText ) int multi, int convert, int Color, bool DrawPinText )
{ {
int DrawMode = g_XorMode; int DrawMode = g_XorMode;
......
...@@ -459,22 +459,22 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -459,22 +459,22 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break; break;
} }
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
{ {
DrawTextStruct* Struct; SCH_TEXT* Struct;
Struct = (DrawTextStruct*) DrawStruct; Struct = (SCH_TEXT*) DrawStruct;
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy; Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor ); Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy; Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
break; break;
} }
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
{ {
DrawLabelStruct* Struct; SCH_LABEL* Struct;
Struct = (DrawLabelStruct*) DrawStruct; Struct = (SCH_LABEL*) DrawStruct;
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy; Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor ); Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy; Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
...@@ -491,11 +491,11 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -491,11 +491,11 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break; break;
} }
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
{ {
EDA_LibComponentStruct* LibEntry; EDA_LibComponentStruct* LibEntry;
EDA_SchComponentStruct* Struct; SCH_COMPONENT* Struct;
Struct = (EDA_SchComponentStruct*) DrawStruct; Struct = (SCH_COMPONENT*) DrawStruct;
LibEntry = FindLibPart( Struct->m_ChipName.GetData(), wxEmptyString, FIND_ROOT ); LibEntry = FindLibPart( Struct->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL ) if( LibEntry == NULL )
break; break;
......
This diff is collapsed.
...@@ -72,7 +72,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem( ...@@ -72,7 +72,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
{ {
DrawSheetPath* sheet, * SheetWithComponentFound = NULL; DrawSheetPath* sheet, * SheetWithComponentFound = NULL;
EDA_BaseStruct* DrawList = NULL; EDA_BaseStruct* DrawList = NULL;
EDA_SchComponentStruct* Component = NULL; SCH_COMPONENT* Component = NULL;
wxSize DrawAreaSize = DrawPanel->GetClientSize(); wxSize DrawAreaSize = DrawPanel->GetClientSize();
wxPoint pos, curpos; wxPoint pos, curpos;
bool DoCenterAndRedraw = FALSE; bool DoCenterAndRedraw = FALSE;
...@@ -91,10 +91,10 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem( ...@@ -91,10 +91,10 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
DrawList = sheet->LastDrawList(); DrawList = sheet->LastDrawList();
for( ; (DrawList != NULL) && (NotFound == true); DrawList = DrawList->Pnext ) for( ; (DrawList != NULL) && (NotFound == true); DrawList = DrawList->Pnext )
{ {
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* pSch; SCH_COMPONENT* pSch;
pSch = (EDA_SchComponentStruct*) DrawList; pSch = (SCH_COMPONENT*) DrawList;
if( component_reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 ) if( component_reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 )
{ {
Component = pSch; Component = pSch;
...@@ -465,9 +465,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -465,9 +465,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
{ {
switch( DrawList->Type() ) switch( DrawList->Type() )
{ {
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
EDA_SchComponentStruct * pSch; SCH_COMPONENT * pSch;
pSch = (EDA_SchComponentStruct*) DrawList; pSch = (SCH_COMPONENT*) DrawList;
if( WildCompareString( WildText, pSch->GetRef(Sheet), FALSE ) ) if( WildCompareString( WildText, pSch->GetRef(Sheet), FALSE ) )
{ {
NotFound = FALSE; NotFound = FALSE;
...@@ -481,12 +481,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -481,12 +481,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
} }
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
DrawTextStruct * pDraw; SCH_TEXT * pDraw;
pDraw = (DrawTextStruct*) DrawList; pDraw = (SCH_TEXT*) DrawList;
if( WildCompareString( WildText, pDraw->m_Text, FALSE ) ) if( WildCompareString( WildText, pDraw->m_Text, FALSE ) )
{ {
NotFound = FALSE; NotFound = FALSE;
...@@ -551,12 +551,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -551,12 +551,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
DoCenterAndRedraw = TRUE; DoCenterAndRedraw = TRUE;
} }
/* the struct is a DRAW_LIB_ITEM_STRUCT_TYPE type, /* the struct is a TYPE_SCH_COMPONENT type,
* coordinates must be computed according to its orientation matrix * coordinates must be computed according to its orientation matrix
*/ */
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE ) if( Struct->Type() == TYPE_SCH_COMPONENT )
{ {
EDA_SchComponentStruct* pSch = (EDA_SchComponentStruct*) Struct; SCH_COMPONENT* pSch = (SCH_COMPONENT*) Struct;
pos.x -= pSch->m_Pos.x; pos.x -= pSch->m_Pos.x;
pos.y -= pSch->m_Pos.y; pos.y -= pSch->m_Pos.y;
......
...@@ -59,7 +59,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent ) ...@@ -59,7 +59,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
/**************************************************************************/ /**************************************************************************/
EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC, SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
const wxString& libname, const wxString& libname,
wxArrayString& HistoryList, wxArrayString& HistoryList,
bool UseLibBrowser ) bool UseLibBrowser )
...@@ -73,7 +73,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -73,7 +73,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
int ii, CmpCount = 0; int ii, CmpCount = 0;
LibDrawField* Field; LibDrawField* Field;
EDA_LibComponentStruct* Entry = NULL; EDA_LibComponentStruct* Entry = NULL;
EDA_SchComponentStruct* DrawLibItem = NULL; SCH_COMPONENT* DrawLibItem = NULL;
LibraryStruct* Library = NULL; LibraryStruct* Library = NULL;
wxString Name, keys, msg; wxString Name, keys, msg;
bool AllowWildSeach = TRUE; bool AllowWildSeach = TRUE;
...@@ -180,7 +180,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC, ...@@ -180,7 +180,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawPanel->ManageCurseur = ShowWhileMoving; DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp; DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp;
DrawLibItem = new EDA_SchComponentStruct( GetScreen()->m_Curseur ); DrawLibItem = new SCH_COMPONENT( GetScreen()->m_Curseur );
DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */ DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */
DrawLibItem->m_Convert = 1; DrawLibItem->m_Convert = 1;
DrawLibItem->m_ChipName = Name; DrawLibItem->m_ChipName = Name;
...@@ -257,7 +257,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -257,7 +257,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
wxPoint move_vector; wxPoint move_vector;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
panel->m_Parent->GetScreen()->GetCurItem(); panel->m_Parent->GetScreen()->GetCurItem();
/* Effacement du composant */ /* Effacement du composant */
...@@ -276,7 +276,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -276,7 +276,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/**************************************************************************/ /**************************************************************************/
void WinEDA_SchematicFrame::CmpRotationMiroir( void WinEDA_SchematicFrame::CmpRotationMiroir(
EDA_SchComponentStruct* DrawComponent, wxDC* DC, int type_rotate ) SCH_COMPONENT* DrawComponent, wxDC* DC, int type_rotate )
/**************************************************************************/ /**************************************************************************/
/* Routine permettant les rotations et les miroirs d'un composant /* Routine permettant les rotations et les miroirs d'un composant
...@@ -293,7 +293,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir( ...@@ -293,7 +293,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); {
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox());
}
} }
DrawComponent->SetRotationMiroir( type_rotate ); DrawComponent->SetRotationMiroir( type_rotate );
...@@ -320,7 +322,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -320,7 +322,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie de la fonction de placement de composant /* Routine de sortie de la fonction de placement de composant
*/ */
{ {
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
Panel->m_Parent->GetScreen()->GetCurItem(); Panel->m_Parent->GetScreen()->GetCurItem();
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */ if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */
...@@ -352,7 +354,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -352,7 +354,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/************************************************************************/ /************************************************************************/
void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent, void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
int unit, wxDC* DC ) int unit, wxDC* DC )
/************************************************************************/ /************************************************************************/
/* Selection de l'unite dans les boitiers a multiples Parts */ /* Selection de l'unite dans les boitiers a multiples Parts */
...@@ -400,7 +402,7 @@ void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent, ...@@ -400,7 +402,7 @@ void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent,
/************************************************************************/ /************************************************************************/
void WinEDA_SchematicFrame::ConvertPart( EDA_SchComponentStruct* DrawComponent, void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
wxDC* DC ) wxDC* DC )
/************************************************************************/ /************************************************************************/
{ {
...@@ -469,13 +471,13 @@ int LookForConvertPart( EDA_LibComponentStruct* LibEntry ) ...@@ -469,13 +471,13 @@ int LookForConvertPart( EDA_LibComponentStruct* LibEntry )
/***********************************************************************************/ /***********************************************************************************/
void WinEDA_SchematicFrame::StartMovePart( EDA_SchComponentStruct* Component, void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
wxDC* DC ) wxDC* DC )
/***********************************************************************************/ /***********************************************************************************/
{ {
if( Component == NULL ) if( Component == NULL )
return; return;
if( Component->Type() != DRAW_LIB_ITEM_STRUCT_TYPE ) if( Component->Type() != TYPE_SCH_COMPONENT )
return; return;
if( Component->m_Flags == 0 ) if( Component->m_Flags == 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -26,7 +26,7 @@ typedef enum { ...@@ -26,7 +26,7 @@ typedef enum {
* NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1 * NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
* is the last id for user netlist format * is the last id for user netlist format
*/ */
NET_TYPE_CUSTOM_MAX = NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1 NET_TYPE_CUSTOM_MAX = NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
} TypeNetForm; } TypeNetForm;
...@@ -39,11 +39,11 @@ enum NetObjetType { /* Type des objets de Net */ ...@@ -39,11 +39,11 @@ enum NetObjetType { /* Type des objets de Net */
NET_JONCTION, NET_JONCTION,
NET_LABEL, NET_LABEL,
NET_GLOBLABEL, NET_GLOBLABEL,
NET_HIERLABEL, //on a screen to indicate connection to a higher-level sheet NET_HIERLABEL, //on a screen to indicate connection to a higher-level sheet
NET_SHEETLABEL, //on a drawscreen element to indicate connection to a lower-level sheet. NET_SHEETLABEL, //on a drawscreen element to indicate connection to a lower-level sheet.
NET_BUSLABELMEMBER, NET_BUSLABELMEMBER,
NET_GLOBBUSLABELMEMBER, NET_GLOBBUSLABELMEMBER,
NET_HIERBUSLABELMEMBER, NET_HIERBUSLABELMEMBER,
NET_SHEETBUSLABELMEMBER, NET_SHEETBUSLABELMEMBER,
NET_PINLABEL, NET_PINLABEL,
NET_PIN, NET_PIN,
...@@ -93,23 +93,23 @@ public: ...@@ -93,23 +93,23 @@ public:
/* Structures pour memo et liste des elements */ /* Structures pour memo et liste des elements */
typedef struct ListLabel typedef struct ListLabel
{ {
int m_LabelType; int m_LabelType;
void * m_Label; void * m_Label;
char m_SheetPath[64]; char m_SheetPath[64];
} ListLabel; } ListLabel;
typedef struct ListComponent typedef struct ListComponent
{ {
EDA_SchComponentStruct * m_Comp; SCH_COMPONENT * m_Comp;
char m_Ref[32]; char m_Ref[32];
//have to store it here since the object refrerences will be duplicated. //have to store it here since the object refrerences will be duplicated.
DrawSheetPath m_SheetList; //composed of UIDs DrawSheetPath m_SheetList; //composed of UIDs
} ListComponent; } ListComponent;
/* Structure decrivant 1 composant de la schematique (pour *annotation* ) */ /* Structure decrivant 1 composant de la schematique (pour *annotation* ) */
struct CmpListStruct struct CmpListStruct
{ {
public: public:
EDA_SchComponentStruct* m_Cmp; /* Pointeur sur le composant */ SCH_COMPONENT* m_Cmp; /* Pointeur sur le composant */
int m_NbParts; /* Nombre de parts par boitier */ int m_NbParts; /* Nombre de parts par boitier */
bool m_PartsLocked; // For multi part components: True if the part cannot be changed bool m_PartsLocked; // For multi part components: True if the part cannot be changed
int m_Unit; /* Numero de part */ int m_Unit; /* Numero de part */
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
int m_NumRef; /* Numero de reference */ int m_NumRef; /* Numero de reference */
int m_Flag; /* flag pour calculs internes */ int m_Flag; /* flag pour calculs internes */
wxPoint m_Pos; /* position components */ wxPoint m_Pos; /* position components */
char m_Path[128]; // the 'path' of the object in the sheet hierarchy. char m_Path[128]; // the 'path' of the object in the sheet hierarchy.
}; };
......
...@@ -39,15 +39,15 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -39,15 +39,15 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_SHEETLABEL_STRUCT_TYPE: case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE: case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE: case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
DrawStruct->Place( this, DC ); DrawStruct->Place( this, DC );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
...@@ -354,16 +354,16 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -354,16 +354,16 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
InstallNextScreen( (DrawSheetStruct*) DrawStruct ); InstallNextScreen( (DrawSheetStruct*) DrawStruct );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
InstallCmpeditFrame( this, pos, (EDA_SchComponentStruct*) DrawStruct ); InstallCmpeditFrame( this, pos, (SCH_COMPONENT*) DrawStruct );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
EditSchematicText( (DrawTextStruct*) DrawStruct, DC ); EditSchematicText( (SCH_TEXT*) DrawStruct, DC );
break; break;
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
......
...@@ -55,11 +55,11 @@ static void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus, ...@@ -55,11 +55,11 @@ static void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
WinEDA_SchematicFrame* frame ); WinEDA_SchematicFrame* frame );
static void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet ); static void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet );
static void AddMenusForPinSheet( wxMenu* PopMenu, DrawSheetLabelStruct* PinSheet ); static void AddMenusForPinSheet( wxMenu* PopMenu, DrawSheetLabelStruct* PinSheet );
static void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text ); static void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text );
static void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label ); static void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label );
static void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel ); static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel );
static void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* GLabel ); static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel );
static void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ); static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field ); static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field );
static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction, static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame ); WinEDA_SchematicFrame* frame );
...@@ -90,20 +90,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -90,20 +90,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
* Ce menu est ensuite compl�t� par la liste des commandes de ZOOM * Ce menu est ensuite compl�t� par la liste des commandes de ZOOM
*/ */
{ {
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu
if( BlockActive ) if( BlockActive )
{ {
AddMenusForBlock( PopMenu, this ); AddMenusForBlock( PopMenu, this );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
return true; return true;
} }
// Simple localisation des elements si possible // Simple localisation des elements si possible
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{ {
DrawStruct = SchematicGeneralLocateAndDisplay( FALSE ); DrawStruct = SchematicGeneralLocateAndDisplay( FALSE );
...@@ -111,7 +111,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -111,7 +111,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{ {
DrawSheetLabelStruct* slabel; DrawSheetLabelStruct* slabel;
slabel = LocateSheetLabel( (DrawSheetStruct*) DrawStruct, slabel = LocateSheetLabel( (DrawSheetStruct*) DrawStruct,
GetScreen()->m_Curseur ); GetScreen()->m_Curseur );
if( slabel ) if( slabel )
DrawStruct = slabel; DrawStruct = slabel;
} }
...@@ -134,8 +134,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -134,8 +134,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{ {
if( DrawStruct && DrawStruct->m_Flags ) if( DrawStruct && DrawStruct->m_Flags )
{ {
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
} }
} }
...@@ -149,7 +149,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -149,7 +149,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
return true; return true;
} }
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
int flags = DrawStruct->m_Flags; int flags = DrawStruct->m_Flags;
bool is_new = (flags & IS_NEW) ? TRUE : FALSE; bool is_new = (flags & IS_NEW) ? TRUE : FALSE;
...@@ -182,20 +182,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -182,20 +182,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm );
break; break;
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
AddMenusForText( PopMenu, (DrawTextStruct*) DrawStruct ); AddMenusForText( PopMenu, (SCH_TEXT*) DrawStruct );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
AddMenusForLabel( PopMenu, (DrawLabelStruct*) DrawStruct ); AddMenusForLabel( PopMenu, (SCH_LABEL*) DrawStruct );
break; break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
AddMenusForGLabel( PopMenu, (DrawGlobalLabelStruct*) DrawStruct ); AddMenusForGLabel( PopMenu, (SCH_GLOBALLABEL*) DrawStruct );
break; break;
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
AddMenusForHLabel( PopMenu, (DrawHierLabelStruct*) DrawStruct ); AddMenusForHLabel( PopMenu, (SCH_HIERLABEL*) DrawStruct );
break; break;
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
...@@ -205,17 +205,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -205,17 +205,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
break; break;
// Many fields are inside a component. If this is the case, add the component menu // Many fields are inside a component. If this is the case, add the component menu
EDA_SchComponentStruct* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); SCH_COMPONENT* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
if( Component ) if( Component )
{ {
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct ); AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
} }
} }
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct ); AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
break; break;
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
...@@ -259,7 +259,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -259,7 +259,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
} }
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
return true; return true;
} }
...@@ -278,7 +278,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field ) ...@@ -278,7 +278,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field )
/**************************************************************************/ /**************************************************************************/
void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ) void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
/**************************************************************************/ /**************************************************************************/
/* Add menu commands for a component /* Add menu commands for a component
...@@ -321,13 +321,13 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ) ...@@ -321,13 +321,13 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
if( LibEntry && LibEntry->m_Options != ENTRY_POWER ) if( LibEntry && LibEntry->m_Options != ENTRY_POWER )
{ {
msg = AddHotkeyName( _( "Value " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_VALUE ); msg = AddHotkeyName( _( "Value " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_VALUE );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_VALUE_CMP, msg, edit_comp_value_xpm ); ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_VALUE_CMP, msg, edit_comp_value_xpm );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_REF_CMP, _( "Reference" ), edit_comp_ref_xpm ); ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_REF_CMP, _( "Reference" ), edit_comp_ref_xpm );
msg = AddHotkeyName( _( "Footprint " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_FOOTPRINT ); msg = AddHotkeyName( _( "Footprint " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_FOOTPRINT );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, msg, edit_comp_footprint_xpm ); ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, msg, edit_comp_footprint_xpm );
} }
if( LibEntry && (LookForConvertPart( LibEntry ) >= 2) ) if( LibEntry && (LookForConvertPart( LibEntry ) >= 2) )
editmenu->Append( ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ) ); editmenu->Append( ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ) );
...@@ -363,7 +363,7 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component ) ...@@ -363,7 +363,7 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
/*******************************************************************/ /*******************************************************************/
void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel ) void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
/*******************************************************************/ /*******************************************************************/
/* Add menu commands for a Global Label /* Add menu commands for a Global Label
...@@ -388,7 +388,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel ) ...@@ -388,7 +388,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm ); ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
} }
/*******************************************************************/ /*******************************************************************/
void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel ) void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
/*******************************************************************/ /*******************************************************************/
/* Add menu commands for a hierarchal Label /* Add menu commands for a hierarchal Label
*/ */
...@@ -414,7 +414,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel ) ...@@ -414,7 +414,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
/*****************************************************************/ /*****************************************************************/
void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label ) void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
/*****************************************************************/ /*****************************************************************/
/* Add menu commands for a Label /* Add menu commands for a Label
...@@ -441,7 +441,7 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label ) ...@@ -441,7 +441,7 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
/*****************************************************************/ /*****************************************************************/
void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text ) void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
/*****************************************************************/ /*****************************************************************/
/* Add menu commands for a Text (a comment) /* Add menu commands for a Text (a comment)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -90,22 +90,22 @@ void SwapData( EDA_BaseStruct* Item ) ...@@ -90,22 +90,22 @@ void SwapData( EDA_BaseStruct* Item )
EXCHG( SOURCE->m_Pos, DEST->m_Pos ); EXCHG( SOURCE->m_Pos, DEST->m_Pos );
break; break;
case DRAW_LABEL_STRUCT_TYPE: case TYPE_SCH_LABEL:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case TYPE_SCH_GLOBALLABEL:
case DRAW_HIER_LABEL_STRUCT_TYPE: case TYPE_SCH_HIERLABEL:
case DRAW_TEXT_STRUCT_TYPE: case TYPE_SCH_TEXT:
#undef SOURCE #undef SOURCE
#undef DEST #undef DEST
#define SOURCE ( (DrawTextStruct*) Item ) #define SOURCE ( (SCH_TEXT*) Item )
#define DEST ( (DrawTextStruct*) image ) #define DEST ( (SCH_TEXT*) image )
DEST->SwapData( SOURCE ); DEST->SwapData( SOURCE );
break; break;
case DRAW_LIB_ITEM_STRUCT_TYPE: case TYPE_SCH_COMPONENT:
#undef SOURCE #undef SOURCE
#undef DEST #undef DEST
#define SOURCE ( (EDA_SchComponentStruct*) Item ) #define SOURCE ( (SCH_COMPONENT*) Item )
#define DEST ( (EDA_SchComponentStruct*) image ) #define DEST ( (SCH_COMPONENT*) image )
DEST->SwapData( SOURCE ); DEST->SwapData( SOURCE );
break; break;
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
/* Cross probing with pcbnew */ /* Cross probing with pcbnew */
void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync, void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
EDA_SchComponentStruct* LibItem ); SCH_COMPONENT* LibItem );
/* netlist generation */ /* netlist generation */
void* BuildNetListBase(); void* BuildNetListBase();
...@@ -144,10 +144,10 @@ private: ...@@ -144,10 +144,10 @@ private:
// Text ,label, glabel // Text ,label, glabel
EDA_BaseStruct* CreateNewText( wxDC* DC, int type ); EDA_BaseStruct* CreateNewText( wxDC* DC, int type );
void EditSchematicText( DrawTextStruct* TextStruct, wxDC* DC ); void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
void ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC ); void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
void StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC ); void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
void ConvertTextType( DrawTextStruct* Text, wxDC* DC, int newtype ); void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype );
// Wire, Bus // Wire, Bus
void BeginSegment( wxDC* DC, int type ); void BeginSegment( wxDC* DC, int type );
...@@ -168,10 +168,10 @@ private: ...@@ -168,10 +168,10 @@ private:
public: public:
bool EditSheet( DrawSheetStruct* Sheet, wxDC* DC ); bool EditSheet( DrawSheetStruct* Sheet, wxDC* DC );
/** Function UpdateSheetNumberAndDate /** Function UpdateSheetNumberAndDate
* Set a sheet number, the sheet count for sheets in the whole schematic * Set a sheet number, the sheet count for sheets in the whole schematic
* and update the date in all screens * and update the date in all screens
*/ */
void UpdateSheetNumberAndDate(); void UpdateSheetNumberAndDate();
private: private:
...@@ -188,25 +188,25 @@ public: ...@@ -188,25 +188,25 @@ public:
private: private:
// Component // Component
EDA_SchComponentStruct* Load_Component( wxDC* DC, SCH_COMPONENT* Load_Component( wxDC* DC,
const wxString& libname, const wxString& libname,
wxArrayString& List, wxArrayString& List,
bool UseLibBrowser ); bool UseLibBrowser );
void StartMovePart( EDA_SchComponentStruct* DrawLibItem, wxDC* DC ); void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC );
public: public:
void CmpRotationMiroir( EDA_SchComponentStruct* DrawComponent, void CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
wxDC* DC, int type_rotate ); wxDC* DC, int type_rotate );
private: private:
void SelPartUnit( EDA_SchComponentStruct* DrawComponent, void SelPartUnit( SCH_COMPONENT* DrawComponent,
int unit, wxDC* DC ); int unit, wxDC* DC );
void ConvertPart( EDA_SchComponentStruct* DrawComponent, wxDC* DC ); void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
void SetInitCmp( EDA_SchComponentStruct* DrawComponent, wxDC* DC ); void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
void EditComponentReference( EDA_SchComponentStruct* DrawLibItem, void EditComponentReference( SCH_COMPONENT* DrawLibItem,
wxDC* DC ); wxDC* DC );
void EditComponentValue( EDA_SchComponentStruct* DrawLibItem, wxDC* DC ); void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
void EditComponentFootprint( EDA_SchComponentStruct* DrawLibItem, void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
wxDC* DC ); wxDC* DC );
void StartMoveCmpField( PartTextStruct* Field, wxDC* DC ); void StartMoveCmpField( PartTextStruct* Field, wxDC* DC );
void EditCmpFieldText( PartTextStruct* Field, wxDC* DC ); void EditCmpFieldText( PartTextStruct* Field, wxDC* DC );
......
...@@ -153,7 +153,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -153,7 +153,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
if( SheetLabel->m_Flags & IS_NEW ) if( SheetLabel->m_Flags & IS_NEW )
{ /* Nouveau Placement en cours, on l'efface */ { /* Nouveau Placement en cours, on l'efface */
RedrawOneStruct( Panel, DC, SheetLabel, g_XorMode ); RedrawOneStruct( Panel, DC, SheetLabel, g_XorMode );
SAFE_DELETE( SheetLabel ); SAFE_DELETE( SheetLabel );
} }
else else
{ {
...@@ -359,16 +359,16 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S ...@@ -359,16 +359,16 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
{ {
EDA_BaseStruct* DrawStruct; EDA_BaseStruct* DrawStruct;
DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL; DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL;
DrawHierLabelStruct* HLabel = NULL; SCH_HIERLABEL* HLabel = NULL;
if(!Sheet->m_AssociatedScreen) return NULL; if(!Sheet->m_AssociatedScreen) return NULL;
DrawStruct = Sheet->m_AssociatedScreen->EEDrawList; DrawStruct = Sheet->m_AssociatedScreen->EEDrawList;
HLabel = NULL; HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext ) for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{ {
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE ) if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
continue; continue;
HLabel = (DrawHierLabelStruct*) DrawStruct; HLabel = (SCH_HIERLABEL*) DrawStruct;
/* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */ /* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */
SheetLabel = Sheet->m_Label; SheetLabel = Sheet->m_Label;
......
This diff is collapsed.
This diff is collapsed.
...@@ -934,7 +934,7 @@ typedef boost::ptr_vector<WINDOW> WINDOWS; ...@@ -934,7 +934,7 @@ typedef boost::ptr_vector<WINDOW> WINDOWS;
/** /**
* Class KEEPOUT * Class KEEPOUT
* is used for <keepout_descriptor> and <plane_descriptor>. * is used for &lt;keepout_descriptor&gt; and &lt;plane_descriptor&gt;.
*/ */
class KEEPOUT : public ELEM class KEEPOUT : public ELEM
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment