7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 09:41:41 +00:00

class name changes, XOR artifacts

This commit is contained in:
dickelbeck 2008-03-20 01:50:21 +00:00
parent bd77c9f2e6
commit c406eed135
52 changed files with 2677 additions and 2605 deletions

View File

@ -5,6 +5,27 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
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>
================================================================================
* Support for Gnome/KDE menu added.

View File

@ -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
* @param aRect = given rect to merge with this
*/
@ -840,7 +841,7 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
/*******************************************************************/
DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) :
EDA_BaseStruct( DRAW_PICK_ITEM_STRUCT_TYPE )
SCH_ITEM( NULL, DRAW_PICK_ITEM_STRUCT_TYPE )
/*******************************************************************/
{
m_PickedStruct = pickedstruct;
@ -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()

View File

@ -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 );;
@ -37,7 +37,7 @@ void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame )
frame->MsgPanel->EraseMsgBox();
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 )
msg = _( "Pwr Symb" );

View File

@ -90,10 +90,10 @@ void ReAnnotatePowerSymbolsOnly( void )
EDA_BaseStruct* DrawList = sheet->LastDrawList();
for( ; DrawList != NULL; DrawList = DrawList->Pnext )
{
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue;
EDA_SchComponentStruct* DrawLibItem =
(EDA_SchComponentStruct*) DrawList;
SCH_COMPONENT* DrawLibItem =
(SCH_COMPONENT*) DrawList;
EDA_LibComponentStruct* Entry =
FindLibPart(
DrawLibItem->m_ChipName.GetData(), wxEmptyString,
@ -303,14 +303,14 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet )
{
int NbrCmp = 0;
EDA_BaseStruct* DrawList = sheet->LastDrawList();
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry;
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(),
wxEmptyString,
FIND_ROOT );
@ -361,7 +361,7 @@ static void ReAnnotateComponents( CmpListStruct* BaseListeCmp, int NbOfCmp )
{
int ii;
char* Text;
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
/* Reattribution des numeros */
for( ii = 0; ii < NbOfCmp; ii++ )

View File

@ -24,7 +24,7 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_
EDA_BaseStruct* DrawStruct );
static void CollectStructsToDrag( SCH_SCREEN* screen );
static void AddPickedItem( SCH_SCREEN* screen, wxPoint position );
static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibItem,
static LibEDA_BaseStruct* GetNextPinPosition( SCH_COMPONENT* DrawLibItem,
wxPoint& position );
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
static EDA_BaseStruct* SaveStructListForPaste( EDA_BaseStruct* DrawStruct );
@ -555,27 +555,28 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
*****************************************************************************/
bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct )
{
DrawPickedStruct* PickedList = NULL;
if( !DrawStruct )
return FALSE;
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
if( DC )
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */
if( DC )
RedrawStructList( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
DrawPickedStruct* pickedList = (DrawPickedStruct*) DrawStruct;
/* Free the wrapper DrawPickedStruct chain: */
PickedList = (DrawPickedStruct*) DrawStruct;
PickedList->DeleteWrapperList();
if( DC )
panel->PostDirtyRect( pickedList->GetBoundingBoxUnion() );
PlaceStruct( panel->GetScreen(), pickedList); // Place it in its new position.
if( DC )
RedrawStructList( panel, DC, pickedList, GR_DEFAULT_DRAWMODE );
// Free the wrapper DrawPickedStruct chain
pickedList->DeleteWrapperList();
}
else
{
if( DC )
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
panel->PostDirtyRect( DrawStruct->GetBoundingBox());
PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */
if( DC )
RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
@ -604,12 +605,12 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
DrawJunctionStruct* DrawConnect;
EDA_DrawLineStruct* DrawSegment;
DrawBusEntryStruct* DrawRaccord;
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
DrawSheetStruct* DrawSheet;
DrawSheetLabelStruct* DrawSheetLabel;
DrawMarkerStruct* DrawMarker;
DrawNoConnectStruct* DrawNoConnect;
DrawTextStruct* DrawText;
SCH_TEXT* DrawText;
wxPoint px;
if( !DrawStruct )
@ -665,13 +666,13 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
MirrorYPoint( DrawNoConnect->m_Pos, Center );
break;
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
// Text is not really mirrored; it is moved to a suitable position
// which is the closest position for a true mirrored text
// The center position is mirrored and the text is moved for half horizontal len
DrawText = (DrawTextStruct*) DrawStruct;
DrawText = (SCH_TEXT*) DrawStruct;
px = DrawText->m_Pos;
if( DrawText->m_Orient == 0 ) /* horizontal text */
dx = DrawText->Len_Size() / 2;
@ -687,11 +688,11 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
DrawText->m_Pos.x = px.x;
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_GLOBALLABEL:
// Text is not really mirrored: Orientation is changed
DrawText = (DrawLabelStruct*) DrawStruct;
DrawText = (SCH_LABEL*) DrawStruct;
if( DrawText->m_Orient == 0 ) /* horizontal text */
DrawText->m_Orient = 2;
else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/
@ -703,8 +704,8 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
DrawText->m_Pos.x = px.x;
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct;
case TYPE_SCH_COMPONENT:
DrawLibItem = (SCH_COMPONENT*) DrawStruct;
dx = DrawLibItem->m_Pos.x;
g_EDA_Appl->m_SchematicFrame->CmpRotationMiroir( DrawLibItem,
NULL, CMP_MIROIR_Y );
@ -753,43 +754,42 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
*****************************************************************************/
bool MirrorStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct, wxPoint& Center )
{
DrawPickedStruct* PickedList = NULL;
DrawPickedStruct* DrawStructs;
if( !DrawStruct )
return FALSE;
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
DrawPickedStruct* pickedList = (DrawPickedStruct*) DrawStruct;
if( DC )
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
DrawStructs = (DrawPickedStruct*) DrawStruct;
while( DrawStructs )
panel->PostDirtyRect( pickedList->GetBoundingBoxUnion() );
for( DrawPickedStruct* cur = pickedList; cur; cur=cur->Next() )
{
MirrorOneStruct( DrawStructs->m_PickedStruct, Center );
DrawStructs->m_PickedStruct->m_Flags = 0;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
MirrorOneStruct( cur->m_PickedStruct, Center );
cur->m_PickedStruct->m_Flags = 0;
}
if( DC )
RedrawStructList( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
RedrawStructList( panel, DC, pickedList, GR_DEFAULT_DRAWMODE );
/* Free the wrapper DrawPickedStruct chain: */
PickedList = (DrawPickedStruct*) DrawStruct;
PickedList->DeleteWrapperList();
// Free the wrapper DrawPickedStruct chain
pickedList->DeleteWrapperList();
}
else
{
if( DC )
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
MirrorOneStruct( DrawStruct, Center ); /* Place it in its new position. */
panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
MirrorOneStruct( DrawStruct, Center ); // Place it in its new position.
if( DC )
RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
DrawStruct->m_Flags = 0;
}
return TRUE;
return true;
}
@ -825,10 +825,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
switch( Struct->Type() )
{
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
{
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation();
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) Struct )->ClearAnnotation();
}
break;
@ -872,10 +872,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_PICK_ITEM_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE:
@ -891,9 +891,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
break;
}
case DRAW_LIB_ITEM_STRUCT_TYPE:
( (EDA_SchComponentStruct*) NewDrawStruct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) NewDrawStruct )->ClearAnnotation();
case TYPE_SCH_COMPONENT:
( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation();
break;
}
@ -924,13 +924,11 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
*/
{
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
DrawPickedStruct* PickedList = NULL;
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->m_Parent;
if( !DrawStruct )
return;
if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
{
/* Cette stucture est rattachee a une feuille, et n'est pas
@ -942,34 +940,34 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
{
/* Unlink all picked structs from current EEDrawList */
PickedList = (DrawPickedStruct*) DrawStruct;
while( PickedList )
// Unlink all picked structs from current EEDrawList
for( DrawPickedStruct* cur = (DrawPickedStruct*) DrawStruct; cur; cur=cur->Next() )
{
screen->RemoveFromDrawList( PickedList->m_PickedStruct );
PickedList->m_PickedStruct->Pnext =
PickedList->m_PickedStruct->Pback = NULL;
PickedList->m_PickedStruct->m_Flags = IS_DELETED;
PickedList = PickedList->Next();
EDA_BaseStruct* item = cur->m_PickedStruct;
screen->RemoveFromDrawList( item );
panel->PostDirtyRect( item->GetBoundingBox() );
item->Pnext = item->Pback = NULL;
item->m_Flags = IS_DELETED;
}
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
/* Removed items are put to the Undo list */
// Removed items are put onto the Undo list
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED );
}
else /* structure classique */
{
screen->RemoveFromDrawList( DrawStruct );
if( (DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE) ||
(DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE) ||
(DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE) )
switch( DrawStruct->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
}
else
{
break;
// other classes do not yet have GetBoundingBox() implementations
default:
D( DrawStruct->Show( 0, std::cout ); ) // tell me which classes still need GetBoundingBox support
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
}
@ -1062,10 +1060,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
for( PickedList = (DrawPickedStruct*) DrawStruct; PickedList != NULL; ) // Clear annotation for new components
{
EDA_BaseStruct* Struct = PickedList->m_PickedStruct;
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
if( Struct->Type() == TYPE_SCH_COMPONENT )
{
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation();
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) Struct )->ClearAnnotation();
SetStructFather( Struct, GetScreen() );
}
PickedList = (DrawPickedStruct*) PickedList->Pnext;
@ -1086,10 +1084,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
}
else
{
if( DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
{
( (EDA_SchComponentStruct*) DrawStruct )->m_TimeStamp = GetTimeStamp();
( (EDA_SchComponentStruct*) DrawStruct )->ClearAnnotation();
( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation();
}
SetStructFather( DrawStruct, GetScreen() );
RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
@ -1135,11 +1133,11 @@ bool PlaceStruct( BASE_SCREEN* screen, EDA_BaseStruct* DrawStruct )
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_COMPONENT:
case DRAW_SHEET_STRUCT_TYPE:
case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE:
@ -1174,7 +1172,7 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
DrawJunctionStruct* DrawConnect;
EDA_DrawLineStruct* DrawSegment;
DrawBusEntryStruct* DrawRaccord;
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
DrawSheetStruct* DrawSheet;
DrawSheetLabelStruct* DrawSheetLabel;
DrawMarkerStruct* DrawMarker;
@ -1231,24 +1229,24 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
DrawNoConnect->m_Pos += move_vector;
break;
case DRAW_TEXT_STRUCT_TYPE:
#define DrawText ( (DrawTextStruct*) DrawStruct )
case TYPE_SCH_TEXT:
#define DrawText ( (SCH_TEXT*) DrawStruct )
DrawText->m_Pos += move_vector;
break;
case DRAW_LABEL_STRUCT_TYPE:
#define DrawLabel ( (DrawLabelStruct*) DrawStruct )
case TYPE_SCH_LABEL:
#define DrawLabel ( (SCH_LABEL*) DrawStruct )
DrawLabel->m_Pos += move_vector;
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
#define DrawGHLabel ( (DrawLabelStruct*) DrawStruct )
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_GLOBALLABEL:
#define DrawGHLabel ( (SCH_LABEL*) DrawStruct )
DrawGHLabel->m_Pos += move_vector;
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct;
case TYPE_SCH_COMPONENT:
DrawLibItem = (SCH_COMPONENT*) DrawStruct;
DrawLibItem->m_Pos += move_vector;
for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
{
@ -1325,24 +1323,24 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct )
NewDrawStruct = ( (DrawNoConnectStruct*) DrawStruct )->GenCopy();
break;
case DRAW_TEXT_STRUCT_TYPE:
NewDrawStruct = ( (DrawTextStruct*) DrawStruct )->GenCopy();
case TYPE_SCH_TEXT:
NewDrawStruct = ( (SCH_TEXT*) DrawStruct )->GenCopy();
break;
case DRAW_LABEL_STRUCT_TYPE:
NewDrawStruct = ( (DrawLabelStruct*) DrawStruct )->GenCopy();
case TYPE_SCH_LABEL:
NewDrawStruct = ( (SCH_LABEL*) DrawStruct )->GenCopy();
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
NewDrawStruct = ( (DrawHierLabelStruct*) DrawStruct )->GenCopy();
case TYPE_SCH_HIERLABEL:
NewDrawStruct = ( (SCH_HIERLABEL*) DrawStruct )->GenCopy();
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
NewDrawStruct = ( (DrawGlobalLabelStruct*) DrawStruct )->GenCopy();
case TYPE_SCH_GLOBALLABEL:
NewDrawStruct = ( (SCH_GLOBALLABEL*) DrawStruct )->GenCopy();
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
NewDrawStruct = ( (EDA_SchComponentStruct*) DrawStruct )->GenCopy();
case TYPE_SCH_COMPONENT:
NewDrawStruct = ( (SCH_COMPONENT*) DrawStruct )->GenCopy();
break;
case DRAW_SHEET_STRUCT_TYPE:
@ -1465,11 +1463,11 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
{
Struct = DrawStructs->m_PickedStruct;
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
if( Struct->Type() == TYPE_SCH_COMPONENT )
{
LibEDA_BaseStruct* DrawItem;
wxPoint pos;
DrawItem = GetNextPinPosition( (EDA_SchComponentStruct*) Struct, pos );
DrawItem = GetNextPinPosition( (SCH_COMPONENT*) Struct, pos );
while( DrawItem )
{
if( (pos.x < ox) || (pos.x > fx) || (pos.y < oy) || (pos.y > fy) )
@ -1587,12 +1585,12 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
case DRAW_BUSENTRY_STRUCT_TYPE:
break;
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_TEXT:
break;
case DRAW_LABEL_STRUCT_TYPE:
case TYPE_SCH_LABEL:
#undef STRUCT
#define STRUCT ( (DrawLabelStruct*) Struct )
#define STRUCT ( (SCH_LABEL*) Struct )
if( Struct->m_Flags & SELECTED )
break; /* Already in list */
if( STRUCT->m_Pos != position )
@ -1604,10 +1602,10 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
Struct->m_Flags |= SELECTED;
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_GLOBALLABEL:
#undef STRUCT
#define STRUCT ( (DrawLabelStruct*) Struct )
#define STRUCT ( (SCH_LABEL*) Struct )
if( Struct->m_Flags & SELECTED )
break; /* Already in list */
if( STRUCT->m_Pos != position )
@ -1619,7 +1617,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
Struct->m_Flags |= SELECTED;
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
break;
case DRAW_SHEET_STRUCT_TYPE:
@ -1668,7 +1666,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
/*********************************************************************************/
static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibItem,
static LibEDA_BaseStruct* GetNextPinPosition( SCH_COMPONENT* DrawLibItem,
wxPoint& position )
/*********************************************************************************/
{

View File

@ -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
* 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.
*
*
* 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
*/
@ -142,8 +142,8 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
if( !newsegment ) /* first point : Create first wire ou bus */
{
s_ConnexionStartPoint = cursorpos;
s_OldWiresList = ((SCH_SCREEN*)GetScreen())->ExtractWires( TRUE );
((SCH_SCREEN*)GetScreen())->SchematicCleanUp( NULL );
s_OldWiresList = ((SCH_SCREEN*)GetScreen())->ExtractWires( TRUE );
((SCH_SCREEN*)GetScreen())->SchematicCleanUp( NULL );
switch( type )
{
@ -194,7 +194,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Creation du segment suivant ou fin de trac<61> 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;
}
@ -301,7 +301,7 @@ void WinEDA_SchematicFrame::EndSegment( wxDC* DC )
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 */
segment = (EDA_DrawLineStruct*) GetScreen()->EEDrawList;
@ -521,7 +521,7 @@ void WinEDA_SchematicFrame::DeleteCurrentSegment( wxDC* DC )
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;
GetScreen()->SetCurItem( NULL );
}
@ -642,9 +642,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
new_pos = STRUCT->m_Pos;
break;
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_TEXT:
#undef STRUCT
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat )
#define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos;
@ -653,9 +653,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break;
case DRAW_LABEL_STRUCT_TYPE:
case TYPE_SCH_LABEL:
#undef STRUCT
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat )
#define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos;
@ -664,19 +664,19 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (DrawHierLabelStruct*) g_ItemToRepeat )
case TYPE_SCH_HIERLABEL:
#undef STRUCT
#define STRUCT ( (SCH_HIERLABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos;
/*** Increment du numero de label ***/
IncrementLabelMember( STRUCT->m_Text );
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case TYPE_SCH_GLOBALLABEL:
#undef STRUCT
#define STRUCT ( (DrawGlobalLabelStruct*) g_ItemToRepeat )
#define STRUCT ( (SCH_GLOBALLABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos += g_RepeatStep;
new_pos = STRUCT->m_Pos;
@ -701,17 +701,17 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
new_pos = STRUCT->m_Pos;
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
#define STRUCT ( (EDA_SchComponentStruct*) g_ItemToRepeat )
#define STRUCT ( (SCH_COMPONENT*) g_ItemToRepeat )
// Create the duplicate component, position = mouse cursor
g_ItemToRepeat = STRUCT->GenCopy();
new_pos.x = GetScreen()->m_Curseur.x - STRUCT->m_Pos.x;
new_pos.y = GetScreen()->m_Curseur.y - STRUCT->m_Pos.y;
STRUCT->m_Pos = GetScreen()->m_Curseur;
new_pos.y = GetScreen()->m_Curseur.y - STRUCT->m_Pos.y;
STRUCT->m_Pos = GetScreen()->m_Curseur;
STRUCT->m_Flags = IS_NEW;
STRUCT->m_TimeStamp = GetTimeStamp();
STRUCT->m_TimeStamp = GetTimeStamp();
for( int ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
{
STRUCT->m_Field[ii].m_Pos += new_pos;
@ -783,14 +783,14 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
* - une jonction
* - ou une pin
* - ou une extr<EFBFBD>mit<EFBFBD> unique de fil
*
*
* - type BUS, si il y a
* - ou une extr<EFBFBD>mit<EFBFBD> unique de BUS
*/
{
EDA_BaseStruct* item;
LibDrawPin* pin;
EDA_SchComponentStruct* LibItem = NULL;
SCH_COMPONENT* LibItem = NULL;
DrawSheetLabelStruct* pinsheet;
wxPoint itempos;
@ -837,9 +837,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE;
item = PickStruct( pos, screen, LABELITEM );
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE)
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x )
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) )
if( item && (item->Type() != TYPE_SCH_TEXT)
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
return TRUE;
pinsheet = LocateAnyPinSheet( pos, screen );

View File

@ -184,12 +184,12 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
/* Search Hlabel corresponding to this Pinsheet */
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList;
DrawHierLabelStruct* HLabel = NULL;
SCH_HIERLABEL* HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE )
if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
continue;
HLabel = (DrawHierLabelStruct*) DrawStruct;
HLabel = (SCH_HIERLABEL*) DrawStruct;
if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
break; // Found!
HLabel = NULL;
@ -282,9 +282,9 @@ void DrawSheetStruct::DeleteAnnotation( bool recurse )
EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList;
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()
EDA_BaseStruct* bs;
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 ) != '#' )
n++;
}
@ -475,84 +475,84 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
if( (GetFileName() == aFileName) && m_AssociatedScreen )
return true;
SCH_SCREEN* Screen_to_use = NULL;
wxString msg;
bool LoadFromFile = false;
SCH_SCREEN* Screen_to_use = NULL;
wxString msg;
bool LoadFromFile = false;
if( g_RootSheet->SearchHierarchy( aFileName, &Screen_to_use ) ) //do we reload the data from the existing hierarchy
{
msg.Printf( _(
"A Sub Hierarchy named %s exists, Use it (The data in this sheet will be replaced)?" ),
aFileName.GetData() );
if( ! IsOK( NULL, msg ) )
{
DisplayInfo(NULL, _("Sheet Filename Renaming Aborted"));
return false;
}
}
if( ! IsOK( NULL, msg ) )
{
DisplayInfo(NULL, _("Sheet Filename Renaming Aborted"));
return false;
}
}
else if( wxFileExists( aFileName ) ) //do we reload the data from an existing file
{
msg.Printf( _(
"A file named %s exists, load it (otherwise keep current sheet data if possible)?" ),
aFileName.GetData() );
if( IsOK( NULL, msg ) )
{
LoadFromFile = true;
m_AssociatedScreen->m_RefCount--; //be careful with these
if( m_AssociatedScreen->m_RefCount == 0 )
SAFE_DELETE( m_AssociatedScreen );
m_AssociatedScreen = NULL; //will be created later
}
if( IsOK( NULL, msg ) )
{
LoadFromFile = true;
m_AssociatedScreen->m_RefCount--; //be careful with these
if( m_AssociatedScreen->m_RefCount == 0 )
SAFE_DELETE( m_AssociatedScreen );
m_AssociatedScreen = NULL; //will be created later
}
}
// if an associated screen exists, shared between this sheet and others sheets, what we do ?
if( m_AssociatedScreen && ( m_AssociatedScreen->m_RefCount > 1 ))
{
msg = _("This sheet uses shared data in a complex hierarchy" ) ;
msg << wxT("\n");
msg << _("Do we convert it in a simple hierarchical sheet (otherwise delete current sheet data)");
if( IsOK( NULL, msg ) )
{
LoadFromFile = true;
wxString oldfilename = m_AssociatedScreen->m_FileName;
m_AssociatedScreen->m_FileName = aFileName;
aFrame->SaveEEFile( m_AssociatedScreen, FILE_SAVE_AS );
m_AssociatedScreen->m_FileName = oldfilename;
}
m_AssociatedScreen->m_RefCount--; //be careful with these
m_AssociatedScreen = NULL; //will be created later
}
SetFileName( aFileName );
// if we use new data (from file or from internal hierarchy), delete the current sheet data
if( m_AssociatedScreen && (LoadFromFile || Screen_to_use) )
{
m_AssociatedScreen->m_RefCount--;
if( m_AssociatedScreen->m_RefCount == 0 )
SAFE_DELETE( m_AssociatedScreen );
m_AssociatedScreen = NULL; //so that we reload..
}
if ( LoadFromFile )
Load( aFrame );
else if ( Screen_to_use )
{
m_AssociatedScreen = Screen_to_use;
m_AssociatedScreen->m_RefCount++;
}
//just make a new screen if needed.
if( !m_AssociatedScreen )
{
m_AssociatedScreen = new SCH_SCREEN( SCHEMATIC_FRAME );
m_AssociatedScreen->m_RefCount++; //be careful with these
}
m_AssociatedScreen->m_FileName = aFileName;
// if an associated screen exists, shared between this sheet and others sheets, what we do ?
if( m_AssociatedScreen && ( m_AssociatedScreen->m_RefCount > 1 ))
{
msg = _("This sheet uses shared data in a complex hierarchy" ) ;
msg << wxT("\n");
msg << _("Do we convert it in a simple hierarchical sheet (otherwise delete current sheet data)");
if( IsOK( NULL, msg ) )
{
LoadFromFile = true;
wxString oldfilename = m_AssociatedScreen->m_FileName;
m_AssociatedScreen->m_FileName = aFileName;
aFrame->SaveEEFile( m_AssociatedScreen, FILE_SAVE_AS );
m_AssociatedScreen->m_FileName = oldfilename;
}
m_AssociatedScreen->m_RefCount--; //be careful with these
m_AssociatedScreen = NULL; //will be created later
}
SetFileName( aFileName );
// if we use new data (from file or from internal hierarchy), delete the current sheet data
if( m_AssociatedScreen && (LoadFromFile || Screen_to_use) )
{
m_AssociatedScreen->m_RefCount--;
if( m_AssociatedScreen->m_RefCount == 0 )
SAFE_DELETE( m_AssociatedScreen );
m_AssociatedScreen = NULL; //so that we reload..
}
if ( LoadFromFile )
Load( aFrame );
else if ( Screen_to_use )
{
m_AssociatedScreen = Screen_to_use;
m_AssociatedScreen->m_RefCount++;
}
//just make a new screen if needed.
if( !m_AssociatedScreen )
{
m_AssociatedScreen = new SCH_SCREEN( SCHEMATIC_FRAME );
m_AssociatedScreen->m_RefCount++; //be careful with these
}
m_AssociatedScreen->m_FileName = aFileName;
return true;
}
@ -803,9 +803,9 @@ void DrawSheetPath::UpdateAllScreenReferences()
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 );
}
t = t->Pnext;

View File

@ -19,11 +19,11 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
{
case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_COMPONENT:
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE:

View File

@ -18,15 +18,15 @@
/************************/
/* class DrawTextStruct */
/* class DrawLabelStruct */
/* class DrawGlobalLabelStruct */
/* class DrawHierLabelStruct */
/* class SCH_TEXT */
/* class SCH_LABEL */
/* class SCH_GLOBALLABEL */
/* class SCH_HIERLABEL */
/************************/
/**************************************************************************/
DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
EDA_BaseStruct( aType )
SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
SCH_ITEM( NULL, aType )
, EDA_TextStruct( text )
/**************************************************************************/
{
@ -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() )
{
default:
case DRAW_TEXT_STRUCT_TYPE:
newitem = new DrawTextStruct( m_Pos, m_Text );
case TYPE_SCH_TEXT:
newitem = new SCH_TEXT( m_Pos, m_Text );
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
newitem = new DrawGlobalLabelStruct( m_Pos, m_Text );
case TYPE_SCH_GLOBALLABEL:
newitem = new SCH_GLOBALLABEL( m_Pos, m_Text );
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
newitem = new DrawHierLabelStruct( m_Pos, m_Text );
case TYPE_SCH_HIERLABEL:
newitem = new SCH_HIERLABEL( m_Pos, m_Text );
break;
case DRAW_LABEL_STRUCT_TYPE:
newitem = new DrawLabelStruct( m_Pos, m_Text );
case TYPE_SCH_LABEL:
newitem = new SCH_LABEL( m_Pos, m_Text );
break;
}
@ -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 );
@ -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 */
if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) )
{
/* restore old values and save new ones */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy );
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (DrawTextStruct*) g_ItemToUndoCopy );
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy );
}
@ -118,8 +118,8 @@ void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/****************************************************************************/
DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_LABEL_STRUCT_TYPE )
SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text ) :
SCH_TEXT( pos, text, TYPE_SCH_LABEL )
/****************************************************************************/
{
m_Layer = LAYER_LOCLABEL;
@ -129,8 +129,8 @@ DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
/***********************************************************************************/
DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_GLOBAL_LABEL_STRUCT_TYPE )
SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text ) :
SCH_TEXT( pos, text, TYPE_SCH_GLOBALLABEL )
/***********************************************************************************/
{
m_Layer = LAYER_GLOBLABEL;
@ -140,8 +140,8 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString
/***********************************************************************************/
DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& text ) :
DrawTextStruct( pos, text, DRAW_HIER_LABEL_STRUCT_TYPE )
SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text ) :
SCH_TEXT( pos, text, TYPE_SCH_HIERLABEL )
/***********************************************************************************/
{
m_Layer = LAYER_HIERLABEL;
@ -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 )
/*******************************************************************************************/
@ -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 )
/*********************************************************************************************/
{
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 )
/******************************************************************************************/
@ -288,7 +288,7 @@ void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint
* format list is
* 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 HalfSize = m_Size.x / 2;
@ -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 )
/******************************************************************************************/
@ -338,9 +338,9 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi
offset += HalfSize;
break;
case NET_OUTPUT:
offset += TXTMARGE;
break;
case NET_OUTPUT:
offset += TXTMARGE;
break;
default:
break;
@ -392,7 +392,7 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi
* format list is
* <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 width = MAX( m_Width, g_DrawMinimunLineWidth );

View File

@ -76,7 +76,7 @@ int* TemplateShape[5][4] =
extern int* TemplateShape[5][4];
#endif
class DrawTextStruct : public EDA_BaseStruct
class SCH_TEXT : public SCH_ITEM
, public EDA_TextStruct
{
public:
@ -85,31 +85,31 @@ public:
bool m_IsDangling; // TRUE si non connect<63>
public:
DrawTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
KICAD_T aType = DRAW_TEXT_STRUCT_TYPE );
~DrawTextStruct() { }
SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
KICAD_T aType = TYPE_SCH_TEXT );
~SCH_TEXT() { }
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,
int Color = -1 );
void SwapData( DrawTextStruct* copyitem );
void SwapData( SCH_TEXT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
};
class DrawLabelStruct : public DrawTextStruct
class SCH_LABEL : public SCH_TEXT
{
public:
DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~DrawLabelStruct() { }
SCH_LABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~SCH_LABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
@ -120,12 +120,12 @@ public:
};
class DrawGlobalLabelStruct : public DrawTextStruct
class SCH_GLOBALLABEL : public SCH_TEXT
{
public:
DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ),
SCH_GLOBALLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString );
~DrawGlobalLabelStruct() { }
~SCH_GLOBALLABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
@ -138,21 +138,21 @@ public:
/** function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text
* @param corner_list = coordinates list fill with polygon corners ooordinates (size > 20)
* @param Pos = Postion of the shape
* format list is
* <corner_count>, x0, y0, ... xn, yn
* @param Pos = Postion of the shape
* format list is
* <corner_count>, x0, y0, ... xn, yn
*/
void CreateGraphicShape( int* corner_list, const wxPoint & Pos );
};
class DrawHierLabelStruct : public DrawTextStruct
class SCH_HIERLABEL : public SCH_TEXT
{
public:
DrawHierLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ),
SCH_HIERLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString );
~DrawHierLabelStruct() { }
~SCH_HIERLABEL() { }
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
@ -165,9 +165,9 @@ public:
/** function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text
* @param corner_list = coordinates list fill with polygon corners ooordinates (size >= 14)
* @param Pos = Postion of the shape
* format list is
* <corner_count>, x0, y0, ... xn, yn
* @param Pos = Postion of the shape
* format list is
* <corner_count>, x0, y0, ... xn, yn
*/
void CreateGraphicShape( int* corner_list, const wxPoint & Pos );
};

View File

@ -105,14 +105,14 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_NOCONNECT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_COMPONENT:
case DRAW_PICK_ITEM_STRUCT_TYPE:
case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_TEXT:
case DRAW_SHEET_STRUCT_TYPE:
case DRAW_SHEETLABEL_STRUCT_TYPE:
break;

View File

@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox()
};
EDA_Rect EDA_SchComponentStruct::GetBoundingBox()
EDA_Rect SCH_COMPONENT::GetBoundingBox()
{
const int PADDING = 40;

View File

@ -22,28 +22,9 @@
WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
/***************************/
/* class DrawPartStruct */
/* class EDA_SchComponentStruct */
/* class SCH_COMPONENT */
/***************************/
/***********************************************************************************/
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 )
/****************************************************************/
@ -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 ..)
@ -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;
@ -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 );
@ -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
@ -176,7 +157,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref )
/**************************************/
void EDA_SchComponentStruct::ClearRefs()
void SCH_COMPONENT::ClearRefs()
/**************************************/
{
m_Paths.Empty();
@ -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.
static const wxString myEmpty = wxEmptyString;
@ -197,14 +178,16 @@ const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const
/*******************************************************************/
EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
DrawPartStruct( DRAW_LIB_ITEM_STRUCT_TYPE, pos )
SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos ) :
SCH_ITEM( NULL, TYPE_SCH_COMPONENT )
/*******************************************************************/
{
int ii;
m_Multi = 0; /* In multi unit chip - which unit to draw. */
m_Pos = aPos;
//m_FlagControlMulti = 0;
m_UsedOnSheets.Clear();
m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */
@ -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 );
@ -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:
* 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_Multi, copyitem->m_Multi );
EXCHG( m_Convert, copyitem->m_Convert );
@ -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 */
@ -341,13 +324,13 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
&& ( (m_Flags & IS_NEW) == 0 ) )
{
/* restore old values and save new ones */
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
/* save in undo list */
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
/* restore new values */
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy );
}
@ -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)
@ -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;
new_item->m_Multi = m_Multi;
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_UsedOnSheets = m_UsedOnSheets;
@ -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
@ -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;
@ -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<6E>e du point coord, en fonction de l'orientation
@ -651,7 +634,7 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord )
* of nesting of this object within the overall tree.
* @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:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
@ -748,7 +731,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
int orient;
int dx, dy, x1, y1, x2, y2;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) m_Parent;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
orient = m_Orient;
wxPoint pos = DrawLibItem->m_Pos;

View File

@ -65,36 +65,22 @@ public:
};
/* the class DrawPartStruct describes a basic virtual component
* Not used directly:
* used classes are EDA_SchComponentStruct (the "classic" schematic component, below)
* and the Pseudo component DrawSheetStruct
*/
class DrawPartStruct : public EDA_BaseStruct
{
public:
int m_Layer;
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:
DrawPartStruct( KICAD_T struct_type, const wxPoint& pos );
~DrawPartStruct();
virtual wxString GetClass() const
{
return wxT( "DrawPart" );
}
};
WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
/* the class EDA_SchComponentStruct describes a real component */
class EDA_SchComponentStruct : public DrawPartStruct
/**
* Class SCH_COMPONENT
* describes a real schematic component
*/
class SCH_COMPONENT : public SCH_ITEM
{
public:
int m_Multi; /* In multi unit chip - which unit to draw. */
wxPoint m_Pos;
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
PartTextStruct m_Field[NUMBER_OF_FIELDS];
//int m_FlagControlMulti;
ArrayOfSheetLists m_UsedOnSheets;
int m_Convert; /* Gestion (management) des mutiples representations (ex: conversion De Morgan) */
@ -108,16 +94,16 @@ public:
* determined, upon file load, by the first non-digits in the reference fields. */
public:
EDA_SchComponentStruct( const wxPoint& pos = wxPoint( 0, 0 ) );
~EDA_SchComponentStruct( void ) { }
SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ) );
~SCH_COMPONENT() { }
virtual wxString GetClass() const
{
return wxT( "EDA_SchComponent" );
return wxT( "SCH_COMPONENT" );
}
EDA_SchComponentStruct* GenCopy();
SCH_COMPONENT* GenCopy();
void SetRotationMiroir( int type );
int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord );
@ -143,7 +129,7 @@ public:
const wxPoint& offset,
int draw_mode,
int Color = -1 );
void SwapData( EDA_SchComponentStruct* copyitem );
void SwapData( SCH_COMPONENT* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );

View File

@ -42,7 +42,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxString msg;
wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL;
SCH_COMPONENT* LibItem = NULL;
DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
@ -57,15 +57,15 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
{
case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE:
LibItem = (EDA_SchComponentStruct*) DrawStruct->m_Parent;
LibItem = (SCH_COMPONENT*) DrawStruct->m_Parent;
SendMessageToPCBNEW( DrawStruct,LibItem );
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, &LibItem );
if( Pin )
break; // Priority is probing a pin first
LibItem = (EDA_SchComponentStruct*) DrawStruct;
LibItem = (SCH_COMPONENT*) DrawStruct;
SendMessageToPCBNEW( DrawStruct, LibItem );
break;
@ -118,7 +118,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
{
EDA_BaseStruct* DrawStruct;
LibDrawPin* Pin;
EDA_SchComponentStruct* LibItem;
SCH_COMPONENT* LibItem;
wxString Text;
wxString msg;
int ii;
@ -175,7 +175,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
if( DrawStruct )
{
PartTextStruct* Field = (PartTextStruct*) DrawStruct;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent;
LibItem = (SCH_COMPONENT*) Field->m_Parent;
LibItem->Display_Infos( this );
return DrawStruct;
@ -199,7 +199,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
if( DrawStruct )
{
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
LibItem = (EDA_SchComponentStruct*) DrawStruct;
LibItem = (SCH_COMPONENT*) DrawStruct;
LibItem->Display_Infos( this );
return DrawStruct;
}

View File

@ -86,7 +86,7 @@ void RemoteCommand( const char* cmdline )
/*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
EDA_SchComponentStruct* LibItem )
SCH_COMPONENT* LibItem )
/*****************************************************************************/
/** Send a remote command to eeschema via a socket,
@ -116,8 +116,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
}
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
LibItem = (EDA_SchComponentStruct*) objectToSync;
case TYPE_SCH_COMPONENT:
LibItem = (SCH_COMPONENT*) objectToSync;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
break;

View File

@ -47,7 +47,7 @@ DanglingEndHandle* ItemList;
static void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
WinEDA_SchematicFrame* frame, wxDC* DC );
void TestLabelForDangling( DrawTextStruct* label,
void TestLabelForDangling( SCH_TEXT* label,
WinEDA_SchematicFrame* frame, wxDC* DC );
DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList );
@ -111,11 +111,11 @@ void WinEDA_SchematicFrame::TestDanglingEnds( EDA_BaseStruct* DrawList, wxDC* DC
{
switch( DrawItem->Type() )
{
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_LABEL:
#undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawItem )
#define STRUCT ( (SCH_LABEL*) DrawItem )
TestLabelForDangling( STRUCT, this, DC );
break;
break;
@ -155,7 +155,7 @@ LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( EDA_BaseStruct* DrawList,
* NULL sinon
*/
{
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
LibDrawPin* Pin;
wxPoint pinpos;
@ -223,7 +223,7 @@ void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
/********************************************************/
void TestLabelForDangling( DrawTextStruct* label,
void TestLabelForDangling( SCH_TEXT* label,
WinEDA_SchematicFrame* frame, wxDC* DC )
/********************************************************/
{
@ -281,7 +281,7 @@ void TestLabelForDangling( DrawTextStruct* label,
/****************************************************/
wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin,
EDA_SchComponentStruct* DrawLibItem )
SCH_COMPONENT* DrawLibItem )
/****************************************************/
/* Retourne la position physique de la pin, qui d<>pend de l'orientation
@ -316,13 +316,13 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
{
switch( DrawItem->Type() )
{
case DRAW_LABEL_STRUCT_TYPE:
case TYPE_SCH_LABEL:
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
#undef STRUCT
#define STRUCT ( (DrawLabelStruct*) DrawItem )
#define STRUCT ( (SCH_LABEL*) DrawItem )
item = new DanglingEndHandle( LABEL_END );
item->m_Item = DrawItem;
@ -395,15 +395,15 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
lastitem = item;
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
{
#undef STRUCT
#define STRUCT ( (EDA_SchComponentStruct*) DrawItem )
#define STRUCT ( (SCH_COMPONENT*) DrawItem )
EDA_LibComponentStruct* Entry;
Entry = FindLibPart( STRUCT->m_ChipName, wxEmptyString, FIND_ROOT );
if( Entry == NULL )
break;
LibEDA_BaseStruct* DrawLibItem = Entry->m_Drawings;
for( ; DrawLibItem != NULL; DrawLibItem = DrawLibItem->Next() )
{
@ -455,7 +455,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
break;
}
default:
;
}

View File

@ -280,10 +280,10 @@ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnectio
if( DelStruct->m_Flags & STRUCT_DELETED )
continue;
if( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE )
if( DelStruct->Type() != TYPE_SCH_LABEL )
continue;
GetScreen()->m_Curseur = ( (DrawTextStruct*) DelStruct )->m_Pos;
GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos;
EDA_BaseStruct* TstStruct =
PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM );

View File

@ -845,7 +845,7 @@ int GenListeCmp( ListComponent* List )
{
int ItemCount = 0;
EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
DrawSheetPath* sheet;
/* Build the sheet (not screen) list */
@ -858,9 +858,9 @@ int GenListeCmp( ListComponent* List )
{
switch( DrawList->Type() )
{
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
ItemCount++;
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
DrawLibItem = (SCH_COMPONENT*) DrawList;
DrawLibItem->m_Parent = sheet->LastScreen();
if( List )
{
@ -910,8 +910,8 @@ static int GenListeGLabels( ListLabel* List )
{
switch( DrawList->Type() )
{
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_GLOBALLABEL:
ItemCount++;
if( List )
{
@ -1063,12 +1063,12 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 )
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
else
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text;
Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
else
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text;
Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
ii = Text1->CmpNoCase( *Text2 );
@ -1102,12 +1102,12 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 )
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
else
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text;
Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
else
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text;
Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
ii = Text1->CmpNoCase( *Text2 );
}
@ -1125,7 +1125,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
*/
{
int ii;
EDA_SchComponentStruct* LibItem;
SCH_COMPONENT* LibItem;
wxString OldName, CurrName;
for( ii = 0; ii < NbItems; ii++ )
@ -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 )
/*******************************************************************************************/
{
@ -1198,7 +1198,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
{
int ii, Multi, Unit;
EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry;
char NameCmp[80];
wxString msg;
@ -1254,10 +1254,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
if( DrawList == NULL )
continue;
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue;
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
DrawLibItem = (SCH_COMPONENT*) DrawList;
if( List[ii].m_Ref[0] == '#' )
continue;
@ -1313,7 +1313,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
int ii, Multi;
wxChar Unit;
EDA_BaseStruct* DrawList;
EDA_SchComponentStruct* DrawLibItem;
SCH_COMPONENT* DrawLibItem;
EDA_LibComponentStruct* Entry;
wxString msg;
@ -1331,10 +1331,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
if( DrawList == NULL )
continue;
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
if( DrawList->Type() != TYPE_SCH_COMPONENT )
continue;
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
DrawLibItem = (SCH_COMPONENT*) DrawList;
if( List[ii].m_Ref[0] == '#' )
continue;
@ -1354,10 +1354,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
List[ii].m_Ref, Unit );
// if( s_ListWithSubCmponents )
// print the sheet path
// print the sheet path
if( m_ListSubCmpItems->GetValue() )
{
msg = List[ii].m_SheetList.PathHumanReadable();
msg = List[ii].m_SheetList.PathHumanReadable();
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) );
}
@ -1377,7 +1377,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
/******************************************************************/
{
int ii, jj;
DrawLabelStruct* DrawTextItem;
SCH_LABEL* DrawTextItem;
DrawSheetLabelStruct* DrawSheetLabel;
ListLabel* LabelItem;
wxString msg, sheetpath;
@ -1389,14 +1389,14 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
switch( LabelItem->m_LabelType )
{
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
DrawTextItem = (DrawLabelStruct*) (LabelItem->m_Label);
if( LabelItem->m_LabelType == DRAW_HIER_LABEL_STRUCT_TYPE )
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_GLOBALLABEL:
DrawTextItem = (SCH_LABEL*) (LabelItem->m_Label);
if( LabelItem->m_LabelType == TYPE_SCH_HIERLABEL )
labeltype = wxT("Hierarchical");
else
labeltype = wxT("Global ");
sheetpath = CONV_FROM_UTF8(LabelItem->m_SheetPath);
sheetpath = CONV_FROM_UTF8(LabelItem->m_SheetPath);
msg.Printf(
_( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ),
DrawTextItem->m_Text.GetData(),

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_build_BOM.h
// Purpose:
// Purpose:
// Author: jean-pieere Charras
// Modified by:
// Modified by:
// Created: 01/15/06 18:18:44
// RCS-ID:
// RCS-ID:
// Copyright: GNU license
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/15/06 18:18:44
@ -80,7 +80,7 @@
*/
class WinEDA_Build_BOM_Frame: public wxDialog
{
{
DECLARE_DYNAMIC_CLASS( WinEDA_Build_BOM_Frame )
DECLARE_EVENT_TABLE()
@ -88,11 +88,11 @@ public:
/// Constructors
WinEDA_Build_BOM_Frame( );
WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* 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 );
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 );
/// 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 );
@ -119,7 +119,7 @@ public:
////@end WinEDA_Build_BOM_Frame event handler declarations
void GenList();
void GenList();
////@begin WinEDA_Build_BOM_Frame member function declarations
@ -129,12 +129,12 @@ public:
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_Build_BOM_Frame member function declarations
void GenereListeOfItems(const wxString & FullFileName);
void CreateExportList(const wxString & FullFileName);
int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE );
int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems);
void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem, bool CompactForm = FALSE);
void SavePreferences();
void GenereListeOfItems(const wxString & FullFileName);
void CreateExportList(const wxString & FullFileName);
int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE );
int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems);
void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
void SavePreferences();
/// Should we show tooltips?
@ -161,9 +161,9 @@ public:
wxCheckBox* m_AddField8;
////@end WinEDA_Build_BOM_Frame member variables
WinEDA_DrawFrame * m_Parent;
wxString m_LibArchiveFileName;
wxString m_ListFileName;
WinEDA_DrawFrame * m_Parent;
wxString m_LibArchiveFileName;
wxString m_ListFileName;
};
#endif

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_component_in_schematic.cpp
// Purpose:
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Modified by:
// Created: 03/03/2006 15:02:54
// RCS-ID:
// RCS-ID:
// Copyright: License GNU
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 03/03/2006 15:02:54
@ -41,7 +41,7 @@ BEGIN_EVENT_TABLE( WinEDA_ComponentPropertiesFrame, wxDialog )
////@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()
@ -54,21 +54,21 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( )
}
WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
EDA_SchComponentStruct * cmp,
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
SCH_COMPONENT * cmp,
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
m_Parent = parent;
m_Cmp = cmp;
m_LibEntry = FindLibPart(m_Cmp->m_ChipName.GetData(), wxEmptyString, FIND_ROOT);
m_Parent = parent;
m_Cmp = cmp;
m_LibEntry = FindLibPart(m_Cmp->m_ChipName.GetData(), wxEmptyString, FIND_ROOT);
InitBuffers();
InitBuffers();
Create(parent, id, caption, pos, size, style);
if ( m_LibEntry == NULL )
{
SetTitle(_("Component properties (Not found in lib)"));
}
if ( m_LibEntry == NULL )
{
SetTitle(_("Component properties (Not found in lib)"));
}
}
/*!
@ -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 )
{
m_FieldNameCtrl = NULL;
m_FieldNameCtrl = NULL;
////@begin WinEDA_ComponentPropertiesFrame member initialisation
m_GeneralBoxSizer = NULL;
m_NoteBook = NULL;
@ -114,9 +114,9 @@ bool WinEDA_ComponentPropertiesFrame::Create( wxWindow* parent, wxWindowID id, c
*/
void WinEDA_ComponentPropertiesFrame::CreateControls()
{
SetFont(*g_DialogFont);
{
SetFont(*g_DialogFont);
////@begin WinEDA_ComponentPropertiesFrame content construction
// Generated by DialogBlocks, 07/11/2007 08:28:00 (unregistered)
@ -242,8 +242,8 @@ void WinEDA_ComponentPropertiesFrame::CreateControls()
itemBoxSizer23->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end WinEDA_ComponentPropertiesFrame content construction
BuildPanelBasic();
BuildPanelFields();
BuildPanelBasic();
BuildPanelFields();
}
/*!
@ -295,7 +295,7 @@ void WinEDA_ComponentPropertiesFrame::OnCancelClick( wxCommandEvent& event )
void WinEDA_ComponentPropertiesFrame::OnRestoreCmpDefaultsClick( wxCommandEvent& event )
{
SetInitCmp(event);
SetInitCmp(event);
}
/*!
@ -304,5 +304,5 @@ void WinEDA_ComponentPropertiesFrame::OnRestoreCmpDefaultsClick( wxCommandEvent&
void WinEDA_ComponentPropertiesFrame::OnOkClick( wxCommandEvent& event )
{
ComponentPropertiesAccept(event);
ComponentPropertiesAccept(event);
}

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_component_in_schematic.h
// Purpose:
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Modified by:
// Created: 03/03/2006 15:02:54
// RCS-ID:
// RCS-ID:
// Copyright: License GNU
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 03/03/2006 15:02:54
@ -68,7 +68,7 @@ class wxNotebook;
*/
class WinEDA_ComponentPropertiesFrame: public wxDialog
{
{
DECLARE_DYNAMIC_CLASS( WinEDA_ComponentPropertiesFrame )
DECLARE_EVENT_TABLE()
@ -76,8 +76,8 @@ public:
/// Constructors
WinEDA_ComponentPropertiesFrame( );
WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
EDA_SchComponentStruct * 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 );
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 );
/// 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 );
@ -110,14 +110,14 @@ public:
/// Should we show tooltips?
static bool ShowToolTips();
void InitBuffers();
void BuildPanelBasic();
void BuildPanelFields();
void ComponentPropertiesAccept(wxCommandEvent& event);
void SetInitCmp( wxCommandEvent& event );
void CopyDataToPanelField();
void CopyPanelFieldToData();
void SelectNewField(wxCommandEvent& event);
void InitBuffers();
void BuildPanelBasic();
void BuildPanelFields();
void ComponentPropertiesAccept(wxCommandEvent& event);
void SetInitCmp( wxCommandEvent& event );
void CopyDataToPanelField();
void CopyPanelFieldToData();
void SelectNewField(wxCommandEvent& event);
////@begin WinEDA_ComponentPropertiesFrame member variables
wxBoxSizer* m_GeneralBoxSizer;
@ -136,21 +136,21 @@ public:
wxBoxSizer* m_FieldSelectionBoxSizer;
////@end WinEDA_ComponentPropertiesFrame member variables
WinEDA_SchematicFrame * m_Parent;
EDA_SchComponentStruct * m_Cmp;
EDA_LibComponentStruct * m_LibEntry;
int m_CurrentFieldId;
WinEDA_SchematicFrame * m_Parent;
SCH_COMPONENT * m_Cmp;
EDA_LibComponentStruct * m_LibEntry;
int m_CurrentFieldId;
wxRadioBox * m_FieldSelection;
WinEDA_GraphicTextCtrl * m_FieldTextCtrl;
WinEDA_EnterText * m_FieldNameCtrl;
WinEDA_PositionCtrl * m_FieldPositionCtrl;
wxString m_FieldText[NUMBER_OF_FIELDS];
wxString m_FieldName[NUMBER_OF_FIELDS];
wxPoint m_FieldPosition[NUMBER_OF_FIELDS];
int m_FieldSize[NUMBER_OF_FIELDS];
int m_FieldFlags[NUMBER_OF_FIELDS];
int m_FieldOrient[NUMBER_OF_FIELDS];
wxRadioBox * m_FieldSelection;
WinEDA_GraphicTextCtrl * m_FieldTextCtrl;
WinEDA_EnterText * m_FieldNameCtrl;
WinEDA_PositionCtrl * m_FieldPositionCtrl;
wxString m_FieldText[NUMBER_OF_FIELDS];
wxString m_FieldName[NUMBER_OF_FIELDS];
wxPoint m_FieldPosition[NUMBER_OF_FIELDS];
int m_FieldSize[NUMBER_OF_FIELDS];
int m_FieldFlags[NUMBER_OF_FIELDS];
int m_FieldOrient[NUMBER_OF_FIELDS];
};
#endif

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.cpp
// Purpose:
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Modified by:
// Created: 19/02/2006 15:46:26
// RCS-ID:
// RCS-ID:
// Copyright: License GNU
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 19/02/2006 15:46:26
@ -51,42 +51,42 @@ WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( )
}
WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
DrawTextStruct * CurrentText,
const wxPoint& pos,
wxWindowID id, const wxString& caption, const wxSize& size, long style )
SCH_TEXT * CurrentText,
const wxPoint& pos,
wxWindowID id, const wxString& caption, const wxSize& size, long style )
{
wxString msg;
m_Parent = parent;
m_CurrentText = CurrentText;
m_Parent = parent;
m_CurrentText = CurrentText;
Create(parent, id, caption, pos, size, style);
m_TextLabel->SetValue(m_CurrentText->m_Text);
m_TextLabel->SetFocus();
switch( m_CurrentText->Type() )
{
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
SetTitle(_("Global Label properties"));
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
SetTitle(_("Hierarchal Label properties"));
break;
m_TextLabel->SetValue(m_CurrentText->m_Text);
m_TextLabel->SetFocus();
switch( m_CurrentText->Type() )
{
case TYPE_SCH_GLOBALLABEL:
SetTitle(_("Global Label properties"));
break;
case DRAW_LABEL_STRUCT_TYPE:
SetTitle(_("Label properties"));
break;
case TYPE_SCH_HIERLABEL:
SetTitle(_("Hierarchal Label properties"));
break;
default:
SetTitle(_("Text properties"));
break;
}
msg = m_SizeTitle->GetLabel() + ReturnUnitSymbol();
m_SizeTitle->SetLabel(msg);
msg = ReturnStringFromValue(g_UnitMetric, m_CurrentText->m_Size.x, m_Parent->m_InternalUnits);
m_TextSize->SetValue(msg);
case TYPE_SCH_LABEL:
SetTitle(_("Label properties"));
break;
default:
SetTitle(_("Text properties"));
break;
}
msg = m_SizeTitle->GetLabel() + ReturnUnitSymbol();
m_SizeTitle->SetLabel(msg);
msg = ReturnStringFromValue(g_UnitMetric, m_CurrentText->m_Size.x, m_Parent->m_InternalUnits);
m_TextSize->SetValue(msg);
}
/*!
@ -120,8 +120,8 @@ bool WinEDA_LabelPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const
*/
void WinEDA_LabelPropertiesFrame::CreateControls()
{
SetFont(*g_DialogFont);
{
SetFont(*g_DialogFont);
////@begin WinEDA_LabelPropertiesFrame content construction
// Generated by DialogBlocks, 07/11/2007 12:37:47 (unregistered)
@ -189,8 +189,8 @@ void WinEDA_LabelPropertiesFrame::CreateControls()
m_TextShape->SetValidator( wxGenericValidator(& m_CurrentText->m_Shape) );
////@end WinEDA_LabelPropertiesFrame content construction
if (m_CurrentText->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE ||
m_CurrentText->Type() == DRAW_HIER_LABEL_STRUCT_TYPE)
if (m_CurrentText->Type() == TYPE_SCH_GLOBALLABEL ||
m_CurrentText->Type() == TYPE_SCH_HIERLABEL)
m_TextShape->Show(true);
}

View File

@ -1,12 +1,12 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_edit_label.h
// Purpose:
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Modified by:
// Created: 19/02/2006 15:46:26
// RCS-ID:
// RCS-ID:
// Copyright: License GNU
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 19/02/2006 15:46:26
@ -60,7 +60,7 @@
*/
class WinEDA_LabelPropertiesFrame: public wxDialog
{
{
DECLARE_DYNAMIC_CLASS( WinEDA_LabelPropertiesFrame )
DECLARE_EVENT_TABLE()
@ -68,9 +68,9 @@ public:
/// Constructors
WinEDA_LabelPropertiesFrame( );
WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
DrawTextStruct * CurrentText,
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 );
SCH_TEXT * CurrentText,
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 );
/// 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 );
@ -99,8 +99,8 @@ public:
/// Should we show tooltips?
static bool ShowToolTips();
void TextPropertiesAccept(wxCommandEvent& event);
void TextPropertiesAccept(wxCommandEvent& event);
////@begin WinEDA_LabelPropertiesFrame member variables
wxTextCtrl* m_TextLabel;
wxRadioBox* m_TextOrient;
@ -110,7 +110,7 @@ public:
////@end WinEDA_LabelPropertiesFrame member variables
WinEDA_SchematicFrame * m_Parent;
DrawTextStruct * m_CurrentText;
SCH_TEXT * m_CurrentText;
};

View File

@ -39,14 +39,14 @@ static wxPoint OldPos;
/**********************************************************************/
void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
EDA_SchComponentStruct* cmp )
SCH_COMPONENT* cmp )
/*********************************************************************/
/* Create the dialog box for the current component edition
*/
{
parent->DrawPanel->m_IgnoreMouseEvents = TRUE;
if( cmp->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
if( cmp->Type() != TYPE_SCH_COMPONENT )
{
DisplayError( parent,
wxT( "InstallCmpeditFrame() error: This struct is not a component" ) );
@ -55,7 +55,7 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
{
WinEDA_ComponentPropertiesFrame* frame =
new WinEDA_ComponentPropertiesFrame( parent, cmp );
frame->ShowModal();
frame->ShowModal();
frame->Destroy();
}
@ -90,10 +90,10 @@ void WinEDA_ComponentPropertiesFrame::InitBuffers()
for( ii = REFERENCE; ii < NUMBER_OF_FIELDS; ii++ )
{
m_FieldName[ii] = m_Cmp->ReturnFieldName( ii );
if(ii == REFERENCE)
m_FieldText[ii] = m_Cmp->GetRef(m_Parent->GetSheet());
else
m_FieldText[ii] = m_Cmp->m_Field[ii].m_Text;
if(ii == REFERENCE)
m_FieldText[ii] = m_Cmp->GetRef(m_Parent->GetSheet());
else
m_FieldText[ii] = m_Cmp->m_Field[ii].m_Text;
m_FieldSize[ii] = m_Cmp->m_Field[ii].m_Size.x;
m_FieldFlags[ii] =
(m_Cmp->m_Field[ii].m_Attributs & TEXT_NO_VISIBLE) ? 0 : 1;
@ -122,7 +122,7 @@ void WinEDA_ComponentPropertiesFrame::CopyDataToPanelField()
for( int ii = FIELD1; ii < NUMBER_OF_FIELDS; ii++ ){
m_FieldSelection->SetString( ii, m_FieldName[ii] );
}
}
if( fieldId == VALUE && m_LibEntry && m_LibEntry->m_Options == ENTRY_POWER )
m_FieldTextCtrl->Enable( FALSE );
@ -394,7 +394,7 @@ void WinEDA_ComponentPropertiesFrame::ComponentPropertiesAccept( wxCommandEvent&
if( ii == REFERENCE ) // la reference ne peut etre vide
{
if( !m_FieldText[ii].IsEmpty() )
m_Cmp->SetRef(m_Parent->GetSheet(), m_FieldText[ii]);
m_Cmp->SetRef(m_Parent->GetSheet(), m_FieldText[ii]);
}
else if( ii == VALUE ) // la valeur ne peut etre vide et ne peut etre change sur un POWER
{
@ -427,10 +427,10 @@ void WinEDA_ComponentPropertiesFrame::ComponentPropertiesAccept( wxCommandEvent&
m_Cmp->m_Field[ii].m_Pos.y += cmp_pos.y;
}
m_Parent->GetScreen()->SetModify();
m_Parent->GetScreen()->SetModify();
RedrawOneStruct( m_Parent->DrawPanel, &dc, m_Cmp, GR_DEFAULT_DRAWMODE );
m_Parent->TestDanglingEnds( m_Parent->GetScreen()->EEDrawList, &dc );
m_Parent->TestDanglingEnds( m_Parent->GetScreen()->EEDrawList, &dc );
EndModal( 0 );
}
@ -458,9 +458,9 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC )
wxPoint pos, newpos;
int x1, y1;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) CurrentField->m_Parent;
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) CurrentField->m_Parent;
SAFE_DELETE( g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy );
g_ItemToUndoCopy = Cmp->GenCopy();
pos = Cmp->m_Pos;
@ -482,7 +482,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC )
newpos.y = pos.y + Cmp->m_Transform[0][1] * x1 + Cmp->m_Transform[1][1] * y1;
DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = newpos;
GetScreen()->m_Curseur = newpos;
DrawPanel->MouseToCursorSchema();
OldPos = Field->m_Pos;
@ -519,7 +519,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC )
return;
}
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) Field->m_Parent;
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) Field->m_Parent;
FieldNumber = Field->m_FieldId;
if( FieldNumber == VALUE )
@ -567,9 +567,9 @@ void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC )
Field->m_Size.x = Field->m_Size.y = TextFieldSize;
}
Field->m_Text = newtext;
if( FieldNumber == REFERENCE ){
Cmp->SetRef(GetSheet(), newtext);
}
if( FieldNumber == REFERENCE ){
Cmp->SetRef(GetSheet(), newtext);
}
}
else /* Nouveau texte NULL */
{
@ -589,7 +589,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC )
DrawTextField( DrawPanel, DC, Field, flag, g_XorMode );
Cmp->Display_Infos( this );
GetScreen()->SetModify();
GetScreen()->SetModify();
}
@ -608,14 +608,14 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( CurrentField == NULL )
return;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) CurrentField->m_Parent;
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) CurrentField->m_Parent;
FieldNumber = CurrentField->m_FieldId;
/* Effacement: */
if( erase )
DrawTextField( panel, DC, CurrentField, Multiflag, g_XorMode );
pos = ( (EDA_SchComponentStruct*) CurrentField->m_Parent )->m_Pos;
pos = ( (SCH_COMPONENT*) CurrentField->m_Parent )->m_Pos;
/* Les positions sont caculees par la matrice TRANSPOSEE de la matrice
* de rotation-miroir */
@ -642,7 +642,7 @@ static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
DrawTextField( Panel, DC, CurrentField, Multiflag, GR_DEFAULT_DRAWMODE );
}
CurrentField = NULL;
SAFE_DELETE( g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy );
}
@ -658,13 +658,13 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC )
if( Field->m_Text == wxEmptyString )
return;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) Field->m_Parent;
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) Field->m_Parent;
FieldNumber = Field->m_FieldId;
flag = 0;
if( FieldNumber == REFERENCE )
{
Entry = FindLibPart( ( (EDA_SchComponentStruct*) Field->m_Parent )->m_ChipName.GetData(),
Entry = FindLibPart( ( (SCH_COMPONENT*) Field->m_Parent )->m_ChipName.GetData(),
wxEmptyString, FIND_ROOT );
if( Entry != NULL )
{
@ -699,13 +699,13 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
frame->DrawPanel->ManageCurseur = NULL;
frame->DrawPanel->ForceCloseManageCurseur = NULL;
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) m_Parent;
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) m_Parent;
/* save old cmp in undo list */
if( g_ItemToUndoCopy && ( g_ItemToUndoCopy->Type() == Cmp->Type()) )
{
Cmp->SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
Cmp->SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( Cmp, IS_CHANGED );
Cmp->SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
Cmp->SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
}
FieldNumber = m_FieldId;
@ -730,7 +730,7 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/**************************************************************************************************/
void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp, wxDC* DC )
void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
/**************************************************************************************************/
/* Edit the component text reference*/
{
@ -747,7 +747,7 @@ void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp,
if( Entry->m_UnitCount > 1 )
flag = 1;
wxString ref = Cmp->GetRef(GetSheet());
wxString ref = Cmp->GetRef(GetSheet());
Get_Message( _( "Reference" ), ref, this );
if( !ref.IsEmpty() ) // New text entered
@ -755,10 +755,10 @@ void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp,
/* save old cmp in undo list if not already in edit, or moving ... */
if( Cmp->m_Flags == 0 )
SaveCopyInUndoList( Cmp, IS_CHANGED );
Cmp->SetRef(GetSheet(), ref);
Cmp->SetRef(GetSheet(), ref);
DrawTextField( DrawPanel, DC, &Cmp->m_Field[REFERENCE], flag, g_XorMode );
Cmp->SetRef(GetSheet(), ref );
Cmp->SetRef(GetSheet(), ref );
DrawTextField( DrawPanel, DC, &Cmp->m_Field[REFERENCE], flag,
Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
GetScreen()->SetModify();
@ -768,7 +768,7 @@ void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp,
/*****************************************************************************************/
void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxDC* DC )
void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
/*****************************************************************************************/
/* Routine de changement du texte selectionne */
{
@ -789,7 +789,7 @@ void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxD
msg = TextField->m_Text;
if( Get_Message( _( "Value" ), msg, this ) )
msg.Empty(); //allow the user to remove the value.
msg.Empty(); //allow the user to remove the value.
if( !msg.IsEmpty() && !msg.IsEmpty())
{
@ -801,20 +801,20 @@ void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxD
TextField->m_Text = msg;
DrawTextField( DrawPanel, DC, &Cmp->m_Field[VALUE], flag,
Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
GetScreen()->SetModify();
GetScreen()->SetModify();
}
Cmp->Display_Infos( this );
}
/*****************************************************************************************/
void WinEDA_SchematicFrame::EditComponentFootprint( EDA_SchComponentStruct* Cmp, wxDC* DC )
void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
/*****************************************************************************************/
{
wxString msg;
EDA_LibComponentStruct* Entry;
int flag = 0;
bool wasEmpty = false;
bool wasEmpty = false;
if( Cmp == NULL )
return;
@ -828,35 +828,35 @@ void WinEDA_SchematicFrame::EditComponentFootprint( EDA_SchComponentStruct* Cmp,
PartTextStruct* TextField = &Cmp->m_Field[FOOTPRINT];
msg = TextField->m_Text;
if(msg.IsEmpty() )
wasEmpty = true;
if(msg.IsEmpty() )
wasEmpty = true;
if( Get_Message( _( "Footprint" ), msg, this ) )
msg.Empty(); //allow the user to remove the value.
msg.Empty(); //allow the user to remove the value.
/* save old cmp in undo list if not already in edit, or moving ... */
if( Cmp->m_Flags == 0 )
SaveCopyInUndoList( Cmp, IS_CHANGED );
DrawTextField( DrawPanel, DC, &Cmp->m_Field[FOOTPRINT], flag, g_XorMode );
//move the field if it was new.
if(wasEmpty && !msg.IsEmpty())
{
Cmp->m_Field[FOOTPRINT].m_Pos = Cmp->m_Field[REFERENCE].m_Pos;
//add offset here - ? suitable heuristic below?
Cmp->m_Field[FOOTPRINT].m_Pos.x +=
(Cmp->m_Field[REFERENCE].m_Pos.x - Cmp->m_Pos.x) > 0 ?
(Cmp->m_Field[REFERENCE].m_Size.x) : (-1*Cmp->m_Field[REFERENCE].m_Size.x);
Cmp->m_Field[FOOTPRINT].m_Pos.y +=
(Cmp->m_Field[REFERENCE].m_Pos.y - Cmp->m_Pos.y) > 0 ?
(Cmp->m_Field[REFERENCE].m_Size.y) : (-1*Cmp->m_Field[REFERENCE].m_Size.y);
Cmp->m_Field[FOOTPRINT].m_Orient = Cmp->m_Field[REFERENCE].m_Orient;
}
TextField->m_Text = msg;
DrawTextField( DrawPanel, DC, &Cmp->m_Field[FOOTPRINT], flag,
Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
GetScreen()->SetModify();
/* save old cmp in undo list if not already in edit, or moving ... */
if( Cmp->m_Flags == 0 )
SaveCopyInUndoList( Cmp, IS_CHANGED );
DrawTextField( DrawPanel, DC, &Cmp->m_Field[FOOTPRINT], flag, g_XorMode );
//move the field if it was new.
if(wasEmpty && !msg.IsEmpty())
{
Cmp->m_Field[FOOTPRINT].m_Pos = Cmp->m_Field[REFERENCE].m_Pos;
//add offset here - ? suitable heuristic below?
Cmp->m_Field[FOOTPRINT].m_Pos.x +=
(Cmp->m_Field[REFERENCE].m_Pos.x - Cmp->m_Pos.x) > 0 ?
(Cmp->m_Field[REFERENCE].m_Size.x) : (-1*Cmp->m_Field[REFERENCE].m_Size.x);
Cmp->m_Field[FOOTPRINT].m_Pos.y +=
(Cmp->m_Field[REFERENCE].m_Pos.y - Cmp->m_Pos.y) > 0 ?
(Cmp->m_Field[REFERENCE].m_Size.y) : (-1*Cmp->m_Field[REFERENCE].m_Size.y);
Cmp->m_Field[FOOTPRINT].m_Orient = Cmp->m_Field[REFERENCE].m_Orient;
}
TextField->m_Text = msg;
DrawTextField( DrawPanel, DC, &Cmp->m_Field[FOOTPRINT], flag,
Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
GetScreen()->SetModify();
Cmp->Display_Infos( this );
}
/*****************************************************************************/
@ -903,7 +903,7 @@ void WinEDA_ComponentPropertiesFrame::SetInitCmp( wxCommandEvent& event )
m_Cmp->SetRotationMiroir( CMP_NORMAL );
m_Parent->GetScreen()->SetModify();
m_Parent->GetScreen()->SetModify();
RedrawOneStruct( m_Parent->DrawPanel, &dc, m_Cmp, GR_DEFAULT_DRAWMODE );
EndModal( 1 );

Some files were not shown because too many files have changed in this diff Show More