Commit c406eed1 authored by dickelbeck's avatar dickelbeck

class name changes, XOR artifacts

parent bd77c9f2
......@@ -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.
......
......@@ -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()
......
......@@ -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" );
......
......@@ -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++ )
......
This diff is collapsed.
......@@ -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� 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�mit� unique de fil
*
*
* - type BUS, si il y a
* - ou une extr�mit� 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 );
......
......@@ -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 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( 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;
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;
......
......@@ -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:
......
......@@ -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 );
......
......@@ -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�
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 );
};
......
......@@ -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;
......
......@@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox()
};
EDA_Rect EDA_SchComponentStruct::GetBoundingBox()
EDA_Rect SCH_COMPONENT::GetBoundingBox()
{
const int PADDING = 40;
......
......@@ -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�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;
......
......@@ -65,35 +65,21 @@ 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
WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
/**
* Class SCH_COMPONENT
* describes a real schematic component
*/
class DrawPartStruct : public EDA_BaseStruct
class SCH_COMPONENT : public SCH_ITEM
{
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. */
int m_Multi; /* In multi unit chip - which unit to draw. */
public:
DrawPartStruct( KICAD_T struct_type, const wxPoint& pos );
~DrawPartStruct();
wxPoint m_Pos;
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
{
public:
int m_Multi; /* In multi unit chip - which unit to draw. */
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
PartTextStruct m_Field[NUMBER_OF_FIELDS];
//int m_FlagControlMulti;
ArrayOfSheetLists m_UsedOnSheets;
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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:
;
}
......
......@@ -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 );
......
......@@ -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(),
......
/////////////////////////////////////////////////////////////////////////////
// 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
......
/////////////////////////////////////////////////////////////////////////////
// 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);
}
/////////////////////////////////////////////////////////////////////////////
// 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;
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];
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];
};
#endif
......
/////////////////////////////////////////////////////////////////////////////
// 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;
case DRAW_LABEL_STRUCT_TYPE:
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);
m_TextLabel->SetValue(m_CurrentText->m_Text);
m_TextLabel->SetFocus();
switch( m_CurrentText->Type() )
{
case TYPE_SCH_GLOBALLABEL:
SetTitle(_("Global Label properties"));
break;
case TYPE_SCH_HIERLABEL:
SetTitle(_("Hierarchal Label properties"));
break;
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);
}
......
/////////////////////////////////////////////////////////////////////////////
// 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;
};
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept( wxCommandEvent& event )
/********************************************************************************/
void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC )
void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC )
/********************************************************************************/
{
if( TextStruct == NULL )
......@@ -87,10 +87,10 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
switch( TextStruct->Type() )
{
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
ItemInitialPosition = TextStruct->m_Pos;
OldSize = TextStruct->m_Size;
OldOrient = TextStruct->m_Orient;
......@@ -101,13 +101,13 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
}
DrawPanel->CursorOff( DC );
GetScreen()->m_Curseur = ItemInitialPosition;
GetScreen()->m_Curseur = ItemInitialPosition;
DrawPanel->MouseToCursorSchema();
GetScreen()->SetModify();
DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitMoveTexte;
GetScreen()->SetCurItem( TextStruct );
GetScreen()->SetCurItem( TextStruct );
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
DrawPanel->CursorOn( DC );
......@@ -115,7 +115,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
/*************************************************************************/
void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* TextStruct,
wxDC* DC )
/*************************************************************************/
......@@ -140,11 +140,11 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
/***********************************************************************************/
void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC )
void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
/***********************************************************************************/
{
if( TextStruct == NULL )
TextStruct = (DrawTextStruct*) PickStruct( GetScreen()->m_Curseur,
TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur,
GetScreen(), TEXTITEM | LABELITEM );
if( TextStruct == NULL )
return;
......@@ -160,10 +160,10 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC*
/* Rotation du texte */
switch( TextStruct->Type() )
{
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
TextStruct->m_Orient++;
TextStruct->m_Orient &= 3;
break;
......@@ -187,28 +187,28 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
/* Routine to create new text struct (GraphicText, label or Glabel).
*/
{
DrawTextStruct* NewText = NULL;
SCH_TEXT* NewText = NULL;
g_ItemToRepeat = NULL;
switch( type )
{
case LAYER_NOTES:
NewText = new DrawTextStruct( GetScreen()->m_Curseur );
NewText = new SCH_TEXT( GetScreen()->m_Curseur );
break;
case LAYER_LOCLABEL:
NewText = new DrawLabelStruct( GetScreen()->m_Curseur );
NewText = new SCH_LABEL( GetScreen()->m_Curseur );
break;
case LAYER_HIERLABEL:
NewText = new DrawHierLabelStruct(GetScreen()->m_Curseur );
case LAYER_HIERLABEL:
NewText = new SCH_HIERLABEL(GetScreen()->m_Curseur );
NewText->m_Shape = s_DefaultShapeGLabel;
NewText->m_Orient = s_DefaultOrientGLabel;
break;
case LAYER_GLOBLABEL:
NewText = new DrawGlobalLabelStruct(GetScreen()->m_Curseur );
NewText = new SCH_GLOBALLABEL(GetScreen()->m_Curseur );
NewText->m_Shape = s_DefaultShapeGLabel;
NewText->m_Orient = s_DefaultOrientGLabel;
break;
......@@ -226,11 +226,11 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
if( NewText->m_Text.IsEmpty() )
{
SAFE_DELETE( NewText );
SAFE_DELETE( NewText );
return NULL;
}
if( type == LAYER_GLOBLABEL || type == LAYER_HIERLABEL)
if( type == LAYER_GLOBLABEL || type == LAYER_HIERLABEL)
{
s_DefaultShapeGLabel = NewText->m_Shape;
s_DefaultOrientGLabel = NewText->m_Orient;
......@@ -240,7 +240,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitMoveTexte;
GetScreen()->SetCurItem( NewText );
GetScreen()->SetCurItem( NewText );
return NewText;
}
......@@ -260,11 +260,11 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* redraw the text */
switch( TextStruct->Type() )
{
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
( (DrawTextStruct*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur;
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
( (SCH_TEXT*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur;
break;
default:
......@@ -297,19 +297,19 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
if( Struct->m_Flags & IS_NEW )
{
SAFE_DELETE( Struct );
SAFE_DELETE( Struct );
screen->SetCurItem( NULL );
}
else /* this was a move command on an "old" text: restore its old settings. */
{
switch( Struct->Type() )
{
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
{
DrawTextStruct* Text = (DrawTextStruct*) Struct;
SCH_TEXT* Text = (SCH_TEXT*) Struct;
Text->m_Pos = ItemInitialPosition;
Text->m_Size = OldSize;
Text->m_Orient = OldOrient;
......@@ -327,7 +327,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
/*****************************************************************************/
void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text,
wxDC* DC, int newtype )
/*****************************************************************************/
......@@ -339,22 +339,22 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
if( Text == NULL )
return;
DrawTextStruct* newtext;
SCH_TEXT* newtext;
switch( newtype )
{
case DRAW_LABEL_STRUCT_TYPE:
newtext = new DrawLabelStruct( Text->m_Pos, Text->m_Text );
case TYPE_SCH_LABEL:
newtext = new SCH_LABEL( Text->m_Pos, Text->m_Text );
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
newtext = new DrawGlobalLabelStruct(Text->m_Pos, Text->m_Text );
case TYPE_SCH_GLOBALLABEL:
newtext = new SCH_GLOBALLABEL(Text->m_Pos, Text->m_Text );
break;
case TYPE_SCH_HIERLABEL:
newtext = new SCH_HIERLABEL(Text->m_Pos, Text->m_Text );
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
newtext = new DrawHierLabelStruct(Text->m_Pos, Text->m_Text );
break;
case DRAW_TEXT_STRUCT_TYPE:
newtext = new DrawTextStruct( Text->m_Pos, Text->m_Text );
case TYPE_SCH_TEXT:
newtext = new SCH_TEXT( Text->m_Pos, Text->m_Text );
break;
default:
......@@ -395,13 +395,13 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
{
Text->m_Flags = 0;
DeleteStruct( DrawPanel, DC, Text ); // old text is really saved in undo list
GetScreen()->SetCurItem( NULL );
GetScreen()->SetCurItem( NULL );
g_ItemToRepeat = NULL;
}
GetScreen()->SetCurItem( NULL );
SAFE_DELETE( g_ItemToUndoCopy );
SAFE_DELETE( g_ItemToUndoCopy );
DrawPanel->CursorOff( DC ); // Erase schematic cursor
......@@ -415,15 +415,15 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
SaveCopyInUndoList( newtext, IS_NEW );
}
else
{
GetScreen()->SetCurItem( newtext );
{
GetScreen()->SetCurItem( newtext );
newtext->m_Flags = IS_NEW;
}
}
if( (flags & IS_MOVED) != 0 )
{
GetScreen()->SetCurItem( newtext );
GetScreen()->SetCurItem( newtext );
StartMoveTexte( newtext, DC );
}
......
......@@ -376,9 +376,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
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.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
......@@ -389,11 +389,11 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
break;
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
#undef STRUCT
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat )
#define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
g_ItemToRepeat = STRUCT->GenCopy();
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
......@@ -474,7 +474,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
* - une jonction
* - ou une pin
* - ou une extr�mit� unique de fil
*
*
* - type BUS, si il y a
* - ou une extr�mit� unique de BUS
*/
......@@ -528,9 +528,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
return TRUE;
item = PickStruct( 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->EEDrawList );
......
......@@ -40,7 +40,7 @@ static int s_ItemSelectColor = BROWN;
static EDA_LibComponentStruct* DummyCmp;
static int* Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings
static void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_SchComponentStruct* Component,
SCH_COMPONENT* Component,
EDA_LibComponentStruct* Entry,
const wxPoint& Pos,
int TransMat[2][2],
......@@ -82,9 +82,9 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
* posX, posY = position du composant
* DrawMode = GrOR ..
* Color = 0 : dessin en vraies couleurs, sinon couleur = Color
*
*
* Une croix symbolise le point d'accrochage (ref position) du composant
*
*
* Le composant est toujours trace avec orientation 0
*/
{
......@@ -204,7 +204,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
* Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/
void EDA_SchComponentStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color )
{
EDA_LibComponentStruct* Entry;
......@@ -262,7 +262,7 @@ void DrawTextField( WinEDA_DrawPanel* panel, wxDC* DC,
{
int orient, color;
wxPoint pos; /* Position des textes */
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) Field->m_Parent;
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) Field->m_Parent;
int hjustify, vjustify;
int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth );
......@@ -357,30 +357,30 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
PQCompFunc( (PQCompFuncType) LibraryEntryCompare );
Entry = NULL;
Entry = NULL;
FindLibName.Empty();
while( Lib )
{
if( !LibName.IsEmpty() )
{
if( Lib->m_Name != LibName )
{
Lib = Lib->m_Pnext;
Lib = Lib->m_Pnext;
continue;
}
}
if( Lib == NULL )
break;
Entry = (EDA_LibComponentStruct*) PQFind( Lib->m_Entries, &DummyEntry );
if( Entry != NULL )
{
FindLibName = Lib->m_Name;
break;
}
Lib = Lib->m_Pnext;
}
......@@ -404,7 +404,7 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
*****************************************************************************/
/* DrawMode = GrXOR, GrOR ..*/
void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_SchComponentStruct* Component,
SCH_COMPONENT* Component,
EDA_LibComponentStruct* Entry,
const wxPoint& Pos,
int TransMat[2][2],
......@@ -431,13 +431,13 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
/* Elimination des elements non relatifs a l'unite */
if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) )
continue;
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue;
if( DEntry->m_Flags & IS_MOVED )
continue; // Element en deplacement non trace
SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
LineWidth = MAX( DEntry->m_Width, g_DrawMinimunLineWidth );
......@@ -502,12 +502,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
{
LibDrawCircle* Circle = (LibDrawCircle*) DEntry;
CharColor = GETCOLOR( LAYER_DEVICE );
x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
TransMat[0][1] * Circle->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
TransMat[1][1] * Circle->m_Pos.y;
fill_option = Circle->m_Fill & (~g_PrintFillMask);
if( Color < 0 )
{
......@@ -536,12 +536,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
/* The text orientation may need to be flipped if the
* transformation matrix cuases xy axes to be flipped. */
t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
+ TransMat[0][1] * Text->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
+ TransMat[1][1] * Text->m_Pos.y;
DrawGraphicText( panel, DC, wxPoint( x1, y1 ), CharColor, Text->m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
Text->m_Size,
......@@ -591,7 +591,7 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
&&*/ !g_ShowAllPins )
break;
}
/* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient( TransMat );
......@@ -896,7 +896,7 @@ bool MapAngles( int* Angle1, int* Angle2, int TransMat[2][2] )
*****************************************************************************/
void DrawingLibInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
EDA_LibComponentStruct* LibEntry,
EDA_SchComponentStruct* DrawLibItem, int PartX, int PartY,
SCH_COMPONENT* DrawLibItem, int PartX, int PartY,
int multi, int convert, int Color, bool DrawPinText )
{
int DrawMode = g_XorMode;
......
......@@ -459,22 +459,22 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break;
}
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_TEXT:
{
DrawTextStruct* Struct;
Struct = (DrawTextStruct*) DrawStruct;
SCH_TEXT* Struct;
Struct = (SCH_TEXT*) DrawStruct;
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
break;
}
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
{
DrawLabelStruct* Struct;
Struct = (DrawLabelStruct*) DrawStruct;
SCH_LABEL* Struct;
Struct = (SCH_LABEL*) DrawStruct;
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
......@@ -491,11 +491,11 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break;
}
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
{
EDA_LibComponentStruct* LibEntry;
EDA_SchComponentStruct* Struct;
Struct = (EDA_SchComponentStruct*) DrawStruct;
SCH_COMPONENT* Struct;
Struct = (SCH_COMPONENT*) DrawStruct;
LibEntry = FindLibPart( Struct->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
if( LibEntry == NULL )
break;
......
This diff is collapsed.
......@@ -72,7 +72,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
{
DrawSheetPath* sheet, * SheetWithComponentFound = NULL;
EDA_BaseStruct* DrawList = NULL;
EDA_SchComponentStruct* Component = NULL;
SCH_COMPONENT* Component = NULL;
wxSize DrawAreaSize = DrawPanel->GetClientSize();
wxPoint pos, curpos;
bool DoCenterAndRedraw = FALSE;
......@@ -91,10 +91,10 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
DrawList = sheet->LastDrawList();
for( ; (DrawList != NULL) && (NotFound == true); DrawList = DrawList->Pnext )
{
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
if( DrawList->Type() == TYPE_SCH_COMPONENT )
{
EDA_SchComponentStruct* pSch;
pSch = (EDA_SchComponentStruct*) DrawList;
SCH_COMPONENT* pSch;
pSch = (SCH_COMPONENT*) DrawList;
if( component_reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 )
{
Component = pSch;
......@@ -465,9 +465,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
{
switch( DrawList->Type() )
{
case DRAW_LIB_ITEM_STRUCT_TYPE:
EDA_SchComponentStruct * pSch;
pSch = (EDA_SchComponentStruct*) DrawList;
case TYPE_SCH_COMPONENT:
SCH_COMPONENT * pSch;
pSch = (SCH_COMPONENT*) DrawList;
if( WildCompareString( WildText, pSch->GetRef(Sheet), FALSE ) )
{
NotFound = FALSE;
......@@ -481,12 +481,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
}
break;
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
DrawTextStruct * pDraw;
pDraw = (DrawTextStruct*) DrawList;
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
SCH_TEXT * pDraw;
pDraw = (SCH_TEXT*) DrawList;
if( WildCompareString( WildText, pDraw->m_Text, FALSE ) )
{
NotFound = FALSE;
......@@ -551,12 +551,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
DoCenterAndRedraw = TRUE;
}
/* the struct is a DRAW_LIB_ITEM_STRUCT_TYPE type,
/* the struct is a TYPE_SCH_COMPONENT type,
* coordinates must be computed according to its orientation matrix
*/
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
if( Struct->Type() == TYPE_SCH_COMPONENT )
{
EDA_SchComponentStruct* pSch = (EDA_SchComponentStruct*) Struct;
SCH_COMPONENT* pSch = (SCH_COMPONENT*) Struct;
pos.x -= pSch->m_Pos.x;
pos.y -= pSch->m_Pos.y;
......
......@@ -59,7 +59,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
/**************************************************************************/
EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
const wxString& libname,
wxArrayString& HistoryList,
bool UseLibBrowser )
......@@ -73,7 +73,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
int ii, CmpCount = 0;
LibDrawField* Field;
EDA_LibComponentStruct* Entry = NULL;
EDA_SchComponentStruct* DrawLibItem = NULL;
SCH_COMPONENT* DrawLibItem = NULL;
LibraryStruct* Library = NULL;
wxString Name, keys, msg;
bool AllowWildSeach = TRUE;
......@@ -180,7 +180,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp;
DrawLibItem = new EDA_SchComponentStruct( GetScreen()->m_Curseur );
DrawLibItem = new SCH_COMPONENT( GetScreen()->m_Curseur );
DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */
DrawLibItem->m_Convert = 1;
DrawLibItem->m_ChipName = Name;
......@@ -257,7 +257,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
wxPoint move_vector;
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*)
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
panel->m_Parent->GetScreen()->GetCurItem();
/* Effacement du composant */
......@@ -276,7 +276,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/**************************************************************************/
void WinEDA_SchematicFrame::CmpRotationMiroir(
EDA_SchComponentStruct* DrawComponent, wxDC* DC, int type_rotate )
SCH_COMPONENT* DrawComponent, wxDC* DC, int type_rotate )
/**************************************************************************/
/* Routine permettant les rotations et les miroirs d'un composant
......@@ -293,7 +293,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
if( DrawComponent->m_Flags )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
{
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox());
}
}
DrawComponent->SetRotationMiroir( type_rotate );
......@@ -320,7 +322,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie de la fonction de placement de composant
*/
{
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*)
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
Panel->m_Parent->GetScreen()->GetCurItem();
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */
......@@ -352,7 +354,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
/************************************************************************/
void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent,
void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
int unit, wxDC* DC )
/************************************************************************/
/* Selection de l'unite dans les boitiers a multiples Parts */
......@@ -400,7 +402,7 @@ void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent,
/************************************************************************/
void WinEDA_SchematicFrame::ConvertPart( EDA_SchComponentStruct* DrawComponent,
void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
wxDC* DC )
/************************************************************************/
{
......@@ -469,13 +471,13 @@ int LookForConvertPart( EDA_LibComponentStruct* LibEntry )
/***********************************************************************************/
void WinEDA_SchematicFrame::StartMovePart( EDA_SchComponentStruct* Component,
void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
wxDC* DC )
/***********************************************************************************/
{
if( Component == NULL )
return;
if( Component->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
if( Component->Type() != TYPE_SCH_COMPONENT )
return;
if( Component->m_Flags == 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,7 +26,7 @@ typedef enum {
* NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
* is the last id for user netlist format
*/
NET_TYPE_CUSTOM_MAX = NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
NET_TYPE_CUSTOM_MAX = NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
} TypeNetForm;
......@@ -39,11 +39,11 @@ enum NetObjetType { /* Type des objets de Net */
NET_JONCTION,
NET_LABEL,
NET_GLOBLABEL,
NET_HIERLABEL, //on a screen to indicate connection to a higher-level sheet
NET_SHEETLABEL, //on a drawscreen element to indicate connection to a lower-level sheet.
NET_HIERLABEL, //on a screen to indicate connection to a higher-level sheet
NET_SHEETLABEL, //on a drawscreen element to indicate connection to a lower-level sheet.
NET_BUSLABELMEMBER,
NET_GLOBBUSLABELMEMBER,
NET_HIERBUSLABELMEMBER,
NET_HIERBUSLABELMEMBER,
NET_SHEETBUSLABELMEMBER,
NET_PINLABEL,
NET_PIN,
......@@ -93,23 +93,23 @@ public:
/* Structures pour memo et liste des elements */
typedef struct ListLabel
{
int m_LabelType;
void * m_Label;
char m_SheetPath[64];
int m_LabelType;
void * m_Label;
char m_SheetPath[64];
} ListLabel;
typedef struct ListComponent
{
EDA_SchComponentStruct * m_Comp;
char m_Ref[32];
//have to store it here since the object refrerences will be duplicated.
DrawSheetPath m_SheetList; //composed of UIDs
SCH_COMPONENT * m_Comp;
char m_Ref[32];
//have to store it here since the object refrerences will be duplicated.
DrawSheetPath m_SheetList; //composed of UIDs
} ListComponent;
/* Structure decrivant 1 composant de la schematique (pour *annotation* ) */
struct CmpListStruct
{
public:
EDA_SchComponentStruct* m_Cmp; /* Pointeur sur le composant */
SCH_COMPONENT* m_Cmp; /* Pointeur sur le composant */
int m_NbParts; /* Nombre de parts par boitier */
bool m_PartsLocked; // For multi part components: True if the part cannot be changed
int m_Unit; /* Numero de part */
......@@ -121,7 +121,7 @@ public:
int m_NumRef; /* Numero de reference */
int m_Flag; /* flag pour calculs internes */
wxPoint m_Pos; /* position components */
char m_Path[128]; // the 'path' of the object in the sheet hierarchy.
char m_Path[128]; // the 'path' of the object in the sheet hierarchy.
};
......
......@@ -39,15 +39,15 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{
switch( DrawStruct->Type() )
{
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
case DRAW_SHEETLABEL_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
case DRAW_PART_TEXT_STRUCT_TYPE:
DrawStruct->Place( this, DC );
GetScreen()->SetCurItem( NULL );
......@@ -354,16 +354,16 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
InstallNextScreen( (DrawSheetStruct*) DrawStruct );
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
InstallCmpeditFrame( this, pos, (EDA_SchComponentStruct*) DrawStruct );
case TYPE_SCH_COMPONENT:
InstallCmpeditFrame( this, pos, (SCH_COMPONENT*) DrawStruct );
DrawPanel->MouseToCursorSchema();
break;
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
EditSchematicText( (DrawTextStruct*) DrawStruct, DC );
case TYPE_SCH_TEXT:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
EditSchematicText( (SCH_TEXT*) DrawStruct, DC );
break;
case DRAW_PART_TEXT_STRUCT_TYPE:
......
......@@ -55,11 +55,11 @@ static void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
WinEDA_SchematicFrame* frame );
static void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet );
static void AddMenusForPinSheet( wxMenu* PopMenu, DrawSheetLabelStruct* PinSheet );
static void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text );
static void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label );
static void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel );
static void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* GLabel );
static void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component );
static void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text );
static void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label );
static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel );
static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel );
static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field );
static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame );
......@@ -90,20 +90,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
* Ce menu est ensuite compl�t� par la liste des commandes de ZOOM
*/
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu
if( BlockActive )
{
AddMenusForBlock( PopMenu, this );
{
AddMenusForBlock( PopMenu, this );
PopMenu->AppendSeparator();
return true;
}
return true;
}
// Simple localisation des elements si possible
// Simple localisation des elements si possible
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{
DrawStruct = SchematicGeneralLocateAndDisplay( FALSE );
......@@ -111,7 +111,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{
DrawSheetLabelStruct* slabel;
slabel = LocateSheetLabel( (DrawSheetStruct*) DrawStruct,
GetScreen()->m_Curseur );
GetScreen()->m_Curseur );
if( slabel )
DrawStruct = slabel;
}
......@@ -134,8 +134,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{
if( DrawStruct && DrawStruct->m_Flags )
{
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ), cancel_xpm );
PopMenu->AppendSeparator();
}
}
......@@ -149,7 +149,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
return true;
}
GetScreen()->SetCurItem( DrawStruct );
GetScreen()->SetCurItem( DrawStruct );
int flags = DrawStruct->m_Flags;
bool is_new = (flags & IS_NEW) ? TRUE : FALSE;
......@@ -182,20 +182,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm );
break;
case DRAW_TEXT_STRUCT_TYPE:
AddMenusForText( PopMenu, (DrawTextStruct*) DrawStruct );
case TYPE_SCH_TEXT:
AddMenusForText( PopMenu, (SCH_TEXT*) DrawStruct );
break;
case DRAW_LABEL_STRUCT_TYPE:
AddMenusForLabel( PopMenu, (DrawLabelStruct*) DrawStruct );
case TYPE_SCH_LABEL:
AddMenusForLabel( PopMenu, (SCH_LABEL*) DrawStruct );
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
AddMenusForGLabel( PopMenu, (DrawGlobalLabelStruct*) DrawStruct );
case TYPE_SCH_GLOBALLABEL:
AddMenusForGLabel( PopMenu, (SCH_GLOBALLABEL*) DrawStruct );
break;
case DRAW_HIER_LABEL_STRUCT_TYPE:
AddMenusForHLabel( PopMenu, (DrawHierLabelStruct*) DrawStruct );
case TYPE_SCH_HIERLABEL:
AddMenusForHLabel( PopMenu, (SCH_HIERLABEL*) DrawStruct );
break;
case DRAW_PART_TEXT_STRUCT_TYPE:
......@@ -205,17 +205,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
break;
// Many fields are inside a component. If this is the case, add the component menu
EDA_SchComponentStruct* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
SCH_COMPONENT* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
if( Component )
{
PopMenu->AppendSeparator();
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct );
AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
}
}
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct );
case TYPE_SCH_COMPONENT:
AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
break;
case DRAW_SEGMENT_STRUCT_TYPE:
......@@ -259,7 +259,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
}
PopMenu->AppendSeparator();
return true;
return true;
}
......@@ -278,7 +278,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field )
/**************************************************************************/
void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
/**************************************************************************/
/* Add menu commands for a component
......@@ -321,13 +321,13 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
if( LibEntry && LibEntry->m_Options != ENTRY_POWER )
{
msg = AddHotkeyName( _( "Value " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_VALUE );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_VALUE_CMP, msg, edit_comp_value_xpm );
msg = AddHotkeyName( _( "Value " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_VALUE );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_VALUE_CMP, msg, edit_comp_value_xpm );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_REF_CMP, _( "Reference" ), edit_comp_ref_xpm );
msg = AddHotkeyName( _( "Footprint " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_FOOTPRINT );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, msg, edit_comp_footprint_xpm );
msg = AddHotkeyName( _( "Footprint " ), s_Schematic_Hokeys_Descr, HK_EDIT_COMPONENT_FOOTPRINT );
ADD_MENUITEM( editmenu, ID_POPUP_SCH_EDIT_FOOTPRINT_CMP, msg, edit_comp_footprint_xpm );
}
if( LibEntry && (LookForConvertPart( LibEntry ) >= 2) )
editmenu->Append( ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ) );
......@@ -363,7 +363,7 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
/*******************************************************************/
void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
/*******************************************************************/
/* Add menu commands for a Global Label
......@@ -388,7 +388,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
}
/*******************************************************************/
void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
/*******************************************************************/
/* Add menu commands for a hierarchal Label
*/
......@@ -414,7 +414,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
/*****************************************************************/
void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
/*****************************************************************/
/* Add menu commands for a Label
......@@ -441,7 +441,7 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
/*****************************************************************/
void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text )
void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
/*****************************************************************/
/* Add menu commands for a Text (a comment)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -90,22 +90,22 @@ void SwapData( EDA_BaseStruct* Item )
EXCHG( SOURCE->m_Pos, DEST->m_Pos );
break;
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case TYPE_SCH_LABEL:
case TYPE_SCH_GLOBALLABEL:
case TYPE_SCH_HIERLABEL:
case TYPE_SCH_TEXT:
#undef SOURCE
#undef DEST
#define SOURCE ( (DrawTextStruct*) Item )
#define DEST ( (DrawTextStruct*) image )
#define SOURCE ( (SCH_TEXT*) Item )
#define DEST ( (SCH_TEXT*) image )
DEST->SwapData( SOURCE );
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
case TYPE_SCH_COMPONENT:
#undef SOURCE
#undef DEST
#define SOURCE ( (EDA_SchComponentStruct*) Item )
#define DEST ( (EDA_SchComponentStruct*) image )
#define SOURCE ( (SCH_COMPONENT*) Item )
#define DEST ( (SCH_COMPONENT*) image )
DEST->SwapData( SOURCE );
break;
......
......@@ -71,7 +71,7 @@ public:
/* Cross probing with pcbnew */
void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
EDA_SchComponentStruct* LibItem );
SCH_COMPONENT* LibItem );
/* netlist generation */
void* BuildNetListBase();
......@@ -144,10 +144,10 @@ private:
// Text ,label, glabel
EDA_BaseStruct* CreateNewText( wxDC* DC, int type );
void EditSchematicText( DrawTextStruct* TextStruct, wxDC* DC );
void ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC );
void StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC );
void ConvertTextType( DrawTextStruct* Text, wxDC* DC, int newtype );
void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype );
// Wire, Bus
void BeginSegment( wxDC* DC, int type );
......@@ -168,10 +168,10 @@ private:
public:
bool EditSheet( DrawSheetStruct* Sheet, wxDC* DC );
/** Function UpdateSheetNumberAndDate
* Set a sheet number, the sheet count for sheets in the whole schematic
* and update the date in all screens
*/
/** Function UpdateSheetNumberAndDate
* Set a sheet number, the sheet count for sheets in the whole schematic
* and update the date in all screens
*/
void UpdateSheetNumberAndDate();
private:
......@@ -188,25 +188,25 @@ public:
private:
// Component
EDA_SchComponentStruct* Load_Component( wxDC* DC,
SCH_COMPONENT* Load_Component( wxDC* DC,
const wxString& libname,
wxArrayString& List,
bool UseLibBrowser );
void StartMovePart( EDA_SchComponentStruct* DrawLibItem, wxDC* DC );
void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC );
public:
void CmpRotationMiroir( EDA_SchComponentStruct* DrawComponent,
void CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
wxDC* DC, int type_rotate );
private:
void SelPartUnit( EDA_SchComponentStruct* DrawComponent,
void SelPartUnit( SCH_COMPONENT* DrawComponent,
int unit, wxDC* DC );
void ConvertPart( EDA_SchComponentStruct* DrawComponent, wxDC* DC );
void SetInitCmp( EDA_SchComponentStruct* DrawComponent, wxDC* DC );
void EditComponentReference( EDA_SchComponentStruct* DrawLibItem,
void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
void EditComponentReference( SCH_COMPONENT* DrawLibItem,
wxDC* DC );
void EditComponentValue( EDA_SchComponentStruct* DrawLibItem, wxDC* DC );
void EditComponentFootprint( EDA_SchComponentStruct* DrawLibItem,
void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
wxDC* DC );
void StartMoveCmpField( PartTextStruct* Field, wxDC* DC );
void EditCmpFieldText( PartTextStruct* Field, wxDC* DC );
......
......@@ -153,7 +153,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
if( SheetLabel->m_Flags & IS_NEW )
{ /* Nouveau Placement en cours, on l'efface */
RedrawOneStruct( Panel, DC, SheetLabel, g_XorMode );
SAFE_DELETE( SheetLabel );
SAFE_DELETE( SheetLabel );
}
else
{
......@@ -359,16 +359,16 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
{
EDA_BaseStruct* DrawStruct;
DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL;
DrawHierLabelStruct* HLabel = NULL;
SCH_HIERLABEL* HLabel = NULL;
if(!Sheet->m_AssociatedScreen) return NULL;
if(!Sheet->m_AssociatedScreen) return NULL;
DrawStruct = Sheet->m_AssociatedScreen->EEDrawList;
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;
/* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */
SheetLabel = Sheet->m_Label;
......
This diff is collapsed.
This diff is collapsed.
......@@ -934,7 +934,7 @@ typedef boost::ptr_vector<WINDOW> WINDOWS;
/**
* Class KEEPOUT
* is used for <keepout_descriptor> and <plane_descriptor>.
* is used for &lt;keepout_descriptor&gt; and &lt;plane_descriptor&gt;.
*/
class KEEPOUT : public ELEM
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment