diff --git a/pcbnew/bitmaps/Footprint_Text.xpm b/bitmaps/Footprint_Text.xpm similarity index 75% rename from pcbnew/bitmaps/Footprint_Text.xpm rename to bitmaps/Footprint_Text.xpm index c6a441ba82..2a401ac0ec 100644 --- a/pcbnew/bitmaps/Footprint_Text.xpm +++ b/bitmaps/Footprint_Text.xpm @@ -1,23 +1,29 @@ -/* XPM */ -static char * footprint_text_xpm[] = { -"16 16 4 1", -" c None", -". c #009B9B", -"+ c #007070", -"@ c #005050", -" .............. ", -" .............. ", -" .+ .... +. ", -" .@ .... . ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .....+ ", -" ........ ", -" "}; +/* XPM */ +#ifndef XPMMAIN +extern char *footprint_text_xpm[]; + +#else +char * footprint_text_xpm[] = { +"16 16 4 1", +" c None", +". c #009B9B", +"+ c #007070", +"@ c #005050", +" .............. ", +" .............. ", +" .+ .... +. ", +" .@ .... . ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .....+ ", +" ........ ", +" "}; +#endif + diff --git a/change_log.txt b/change_log.txt index 48eb4bc09c..d6247405c1 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,17 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2007-sept-13 UPDATE Jean-Pierre Charras +================================================================================ ++ all + * EDA_BaseStruct.SetType() removed. + The m_StructType member of class EDA_BaseStruct is no more modified in kicad. + Now Virtual functions can be widely used. + * The old EDA_BaseStruct.ReturnClassName() was removed. + the virtual EDA_BaseStruct.GetClass() is used instead. + ++ gerbview: hotkeys Ok. + 2007-Sep-13 UPDATE Geoff Harland ================================================================================ diff --git a/common/base_struct.cpp b/common/base_struct.cpp index 5fad30f045..3be1d5db67 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -16,58 +16,6 @@ #include "macros.h" - -// KICAD_T names for error messages only: -static wxString KICAD_TName[MAX_STRUCT_TYPE_ID + 1] = { - wxT( "Not init" ), - - wxT( "Pcb" ), - wxT( "Equipot" ), - wxT( "Module" ), - wxT( "Pad" ), - wxT( "DrawSegment" ), - wxT( "Text (pcb)" ), - wxT( "Text module" ), - wxT( "edge module" ), - wxT( "track" ), - wxT( "zone" ), - wxT( "via" ), - wxT( "marker" ), - wxT( "cotation" ), - wxT( "mire" ), - wxT( "screen" ), - wxT( "block" ), - wxT( "edge zone" ), - - wxT( "Polyline" ), - wxT( "Junction" ), - wxT( "Text" ), - wxT( "Label" ), - wxT( "Glob label" ), - wxT( "Lib item" ), - wxT( "Pick struct" ), - wxT( "Segment" ), - wxT( "Raccord" ), - wxT( "Sheet" ), - wxT( "Sheet label" ), - wxT( "Marker" ), - wxT( "No connect" ), - wxT( "Text (lib item)" ), - wxT( "Screen" ), - wxT( "Block locate" ), - wxT( "Library component" ), - wxT( "lib cmp draw circle" ), - wxT( "lib cmp draw graphic text" ), - wxT( "lib cmp draw rect" ), - wxT( "lib cmp draw poly line" ), - wxT( "lib cmp draw line" ), - wxT( "lib cmp pin" ), - wxT( "lib cmp field" ), - wxT( "unknown" ), - wxT( "unknown" ) -}; - - enum textbox { ID_TEXTBOX_LIST = 8010 }; @@ -130,7 +78,7 @@ void EDA_BaseStruct::AddToChain( EDA_BaseStruct* laststruct ) /*********************************************************/ /* - * addition d'une nouvelle struct a la liste chain�, apres la structure laststruct + * Add "this" to the linked list, after laststruct */ { Pnext = laststruct->Pnext; @@ -152,7 +100,7 @@ void EDA_BaseStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off msg.Printf( wxT( "EDA_BaseStruct::Draw() error. Method for struct type %d used but not implemented (" ), Type() ); - msg += ReturnClassName() + wxT( ")\n" ); + msg += GetClass() + wxT( ")\n" ); printf( CONV_TO_UTF8( msg ) ); } @@ -170,25 +118,6 @@ void EDA_BaseStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC ) #endif -/*********************************************/ -wxString EDA_BaseStruct::ReturnClassName() const -/*********************************************/ - -/* Used at run time for diags: return the class name of the item, - * from its .Type() value. - */ -{ - int ii = Type(); - wxString classname; - - if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) ) - ii = MAX_STRUCT_TYPE_ID; - classname = KICAD_TName[ii]; - - return classname; -} - - // see base_struct.h SEARCH_RESULT EDA_BaseStruct::IterateForward( EDA_BaseStruct* listStart, INSPECTOR* inspector, const void* testData, const KICAD_T scanTypes[] ) @@ -287,9 +216,9 @@ std::ostream& EDA_BaseStruct::NestedSpace( int nestLevel, std::ostream& os ) -/*********************************************************/ -/* EDA_TextStruct (classe de base, non utilis� seule */ -/*********************************************************/ +/**************************************************/ +/* EDA_TextStruct (basic class, not directly used */ +/**************************************************/ EDA_TextStruct::EDA_TextStruct( const wxString& text ) { m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT; /* XY size of font */ diff --git a/eeschema/block.cpp b/eeschema/block.cpp index c3a4a14553..0652b2bb71 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -1350,7 +1350,7 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct ) { wxString msg; msg << wxT( "DuplicateStruct error: unexpected StructType " ) << - DrawStruct->Type() << wxT( " " ) << DrawStruct->ReturnClassName(); + DrawStruct->Type() << wxT( " " ) << DrawStruct->GetClass(); DisplayError( NULL, msg ); } break; diff --git a/eeschema/class_screen.h b/eeschema/class_screen.h index 40d912c6b9..7c23cca07d 100644 --- a/eeschema/class_screen.h +++ b/eeschema/class_screen.h @@ -90,6 +90,11 @@ class SCH_SCREEN : public BASE_SCREEN public: SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE ); ~SCH_SCREEN(); + virtual wxString GetClass() const + { + return wxT("SCH_SCREEN"); + } + void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies) @@ -120,6 +125,11 @@ public: const wxString& text = wxEmptyString ); ~DrawSheetLabelStruct() { } + virtual wxString GetClass() const + { + return wxT("DrawSheetLabelStruct"); + } + DrawSheetLabelStruct* GenCopy(); DrawSheetLabelStruct* Next() @@ -148,6 +158,11 @@ public: public: DrawSheetStruct( const wxPoint& pos = wxPoint( 0, 0 ) ); ~DrawSheetStruct(); + virtual wxString GetClass() const + { + return wxT("DrawSheetStruct"); + } + void Place( WinEDA_DrawFrame* frame, wxDC* DC ); DrawSheetStruct* GenCopy(); void Display_Infos( WinEDA_DrawFrame* frame ); diff --git a/eeschema/class_text-label.cpp b/eeschema/class_text-label.cpp index 31b0715ddb..1e20003bef 100644 --- a/eeschema/class_text-label.cpp +++ b/eeschema/class_text-label.cpp @@ -41,7 +41,8 @@ DrawTextStruct* DrawTextStruct::GenCopy() switch( Type() ) { - case DRAW_TEXT_STRUCT_TYPE: + default: + case DRAW_TEXT_STRUCT_TYPE: newitem = new DrawTextStruct( m_Pos, m_Text ); break; case DRAW_GLOBAL_LABEL_STRUCT_TYPE: @@ -50,8 +51,6 @@ DrawTextStruct* DrawTextStruct::GenCopy() case DRAW_LABEL_STRUCT_TYPE: newitem = new DrawLabelStruct( m_Pos, m_Text ); break; - default: - newitem = 0; // will crash below } newitem->m_Layer = m_Layer; @@ -78,13 +77,6 @@ void DrawTextStruct::SwapData( DrawTextStruct* copyitem ) EXCHG( m_Shape, copyitem->m_Shape ); EXCHG( m_Orient, copyitem->m_Orient ); - // EXCHG( m_StructType, copyitem->m_StructType ); - // how can you swap a type, it is what it was created as! - // this is a very bad usage of m_StructType. - KICAD_T aType = copyitem->Type(); - copyitem->SetType( Type() ); - SetType( aType ); - EXCHG( m_Layer, copyitem->m_Layer ); EXCHG( m_HJustify, copyitem->m_HJustify ); EXCHG( m_VJustify, copyitem->m_VJustify ); @@ -137,37 +129,11 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString } -/***************************************************************/ -void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, - int DrawMode, int Color ) -/***************************************************************/ - -/* Les textes type label ou notes peuvent avoir 4 directions, mais - * sont tj cadres par rapport a la 1ere lettre du texte - */ -{ - switch( Type() ) - { - case DRAW_GLOBAL_LABEL_STRUCT_TYPE: - DrawAsGlobalLabel( panel, DC, offset, DrawMode, Color ); - break; - - case DRAW_LABEL_STRUCT_TYPE: - DrawAsLabel( panel, DC, offset, DrawMode, Color ); - break; - - default: - DrawAsText( panel, DC, offset, DrawMode, Color ); - } -} - - /*******************************************************************************************/ -void DrawTextStruct::DrawAsText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, +void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int DrawMode, int Color ) /*******************************************************************************************/ - -/* Texts type Label or Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter +/* Texts type Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter */ { int color; @@ -216,25 +182,25 @@ void DrawTextStruct::DrawAsText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoin } -/***************************************************************/ -void DrawTextStruct::DrawAsLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, +/*********************************************************************************************/ +void DrawLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int DrawMode, int Color ) -/***************************************************************/ +/*********************************************************************************************/ { - DrawAsText( panel, DC, offset, DrawMode, Color ); + DrawTextStruct::Draw( panel, DC, offset, DrawMode, Color ); } -/*****************************************************************************/ -void DrawTextStruct::DrawAsGlobalLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, +/*******************************************************************************************/ +void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int DrawMode, int Color ) -/*****************************************************************************/ +/******************************************************************************************/ /* Texts type Global Label have 4 directions, and the Text origin is the graphic icon */ { int* Template; - int Poly[12]; + int Poly[20]; int ii, jj, imax, color, HalfSize; wxSize Size = m_Size; int width = MAX( m_Width, g_DrawMinimunLineWidth ); @@ -291,8 +257,7 @@ void DrawTextStruct::DrawAsGlobalLabel( WinEDA_DrawPanel* panel, wxDC* DC, const jj++; Template++; } -// GRPoly(&panel->m_ClipBox, DC, imax,Poly,1, width, color, color ); /* Polygne Rempli */ - GRPoly( &panel->m_ClipBox, DC, imax, Poly, 0, width, color, color ); /* Polygne Non Rempli */ + GRPoly( &panel->m_ClipBox, DC, imax, Poly, 0, width, color, color ); if( m_IsDangling ) DrawDanglingSymbol( panel, DC, m_Pos + offset, color ); diff --git a/eeschema/component_class.h b/eeschema/component_class.h index 8ec2523749..8715cbde4b 100644 --- a/eeschema/component_class.h +++ b/eeschema/component_class.h @@ -47,6 +47,11 @@ public: public: PartTextStruct(const wxPoint & pos = wxPoint(0,0), const wxString & text = wxEmptyString); ~PartTextStruct(void); + virtual wxString GetClass() const + { + return wxT("PartTextStruct"); + } + void PartTextCopy(PartTextStruct * target); void Place(WinEDA_DrawFrame * frame, wxDC * DC); @@ -72,6 +77,11 @@ public: public: DrawPartStruct( KICAD_T struct_type, const wxPoint & pos); ~DrawPartStruct(void); + virtual wxString GetClass() const + { + return wxT("DrawPartStruct"); + } + }; @@ -89,6 +99,11 @@ public: public: EDA_SchComponentStruct(const wxPoint & pos = wxPoint(0,0)); ~EDA_SchComponentStruct(void){} + virtual wxString GetClass() const + { + return wxT("EDA_SchComponentStruct"); + } + EDA_SchComponentStruct * GenCopy(void); void SetRotationMiroir( int type ); int GetRotationMiroir(void); diff --git a/eeschema/dialog_build_BOM.cpp b/eeschema/dialog_build_BOM.cpp index 0c8efdc7b6..2c1cc053ff 100644 --- a/eeschema/dialog_build_BOM.cpp +++ b/eeschema/dialog_build_BOM.cpp @@ -49,7 +49,7 @@ /* Structures pour memo et liste des elements */ typedef struct ListLabel { - int m_StructType; + int m_LabelType; void * m_Label; int m_SheetNumber; } ListLabel; @@ -691,7 +691,7 @@ BASE_SCREEN * screen; ItemCount++; if( List ) { - List->m_StructType = DRAW_GLOBAL_LABEL_STRUCT_TYPE; + List->m_LabelType = DRAW_GLOBAL_LABEL_STRUCT_TYPE; List->m_SheetNumber = screen->m_SheetNumber; List->m_Label = DrawList; List++; @@ -706,7 +706,7 @@ BASE_SCREEN * screen; { if ( List ) { - List->m_StructType = DRAW_SHEETLABEL_STRUCT_TYPE; + List->m_LabelType = DRAW_SHEETLABEL_STRUCT_TYPE; List->m_SheetNumber = screen->m_SheetNumber; List->m_Label = SheetLabel; List++; @@ -814,12 +814,12 @@ static int ListTriGLabelByVal(ListLabel *Objet1, ListLabel *Objet2) int ii; const wxString * Text1, *Text2; - if( Objet1->m_StructType == DRAW_SHEETLABEL_STRUCT_TYPE ) + if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) Text1 = &((DrawSheetLabelStruct *)Objet1->m_Label)->m_Text; else Text1 = &((DrawTextStruct *)Objet1->m_Label)->m_Text; - if( Objet2->m_StructType == DRAW_SHEETLABEL_STRUCT_TYPE ) + if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) Text2 = &((DrawSheetLabelStruct *)Objet2->m_Label)->m_Text; else Text2 = &((DrawTextStruct *)Objet2->m_Label)->m_Text; @@ -850,12 +850,12 @@ const wxString * Text1, *Text2; if ( ii == 0 ) { - if( Objet1->m_StructType == DRAW_SHEETLABEL_STRUCT_TYPE ) + if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) Text1 = &((DrawSheetLabelStruct *)Objet1->m_Label)->m_Text; else Text1 = &((DrawTextStruct *)Objet1->m_Label)->m_Text; - if( Objet2->m_StructType == DRAW_SHEETLABEL_STRUCT_TYPE ) + if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE ) Text2 = &((DrawSheetLabelStruct *)Objet2->m_Label)->m_Text; else Text2 = &((DrawTextStruct *)Objet2->m_Label)->m_Text; @@ -1092,7 +1092,7 @@ wxString msg; { LabelItem = & List[ii]; - switch( LabelItem->m_StructType ) + switch( LabelItem->m_LabelType ) { case DRAW_GLOBAL_LABEL_STRUCT_TYPE : DrawTextItem = (DrawGlobalLabelStruct *)(LabelItem->m_Label); diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp index e40f1db68e..e86d3a4073 100644 --- a/eeschema/edit_label.cpp +++ b/eeschema/edit_label.cpp @@ -1,7 +1,7 @@ -/**************************************************************************/ -/* EESchema */ -/* editexte.cpp: creation/ editions des textes (labels, textes sur schema) */ -/**************************************************************************/ +/*********************************************************************/ +/* EESchema */ +/* edit_label.cpp: label, global label and text creation or edition */ +/*********************************************************************/ #include "fctsys.h" #include "gr_basic.h" @@ -103,6 +103,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC GetScreen()->SetModify(); DrawPanel->ManageCurseur = ShowWhileMoving; DrawPanel->ForceCloseManageCurseur = ExitMoveTexte; + GetScreen()->SetCurItem( TextStruct ); DrawPanel->ManageCurseur( DrawPanel, DC, TRUE ); DrawPanel->CursorOn( DC ); @@ -158,8 +159,8 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* case DRAW_LABEL_STRUCT_TYPE: case DRAW_GLOBAL_LABEL_STRUCT_TYPE: case DRAW_TEXT_STRUCT_TYPE: - ( (DrawTextStruct*) TextStruct )->m_Orient++; - ( (DrawTextStruct*) TextStruct )->m_Orient &= 3; + TextStruct->m_Orient++; + TextStruct->m_Orient &= 3; break; default: @@ -189,27 +190,25 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) { case LAYER_NOTES: NewText = new DrawTextStruct( m_CurrentScreen->m_Curseur ); - NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize; break; case LAYER_LOCLABEL: NewText = new DrawLabelStruct( m_CurrentScreen->m_Curseur ); - NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize; break; case LAYER_GLOBLABEL: NewText = new DrawGlobalLabelStruct( m_CurrentScreen->m_Curseur ); - NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize; - ( (DrawGlobalLabelStruct*) NewText )->m_Shape = s_DefaultShapeGLabel; - ( (DrawGlobalLabelStruct*) NewText )->m_Orient = s_DefaultOrientGLabel; + NewText->m_Shape = s_DefaultShapeGLabel; + NewText->m_Orient = s_DefaultOrientGLabel; break; default: - DisplayError( this, wxT( "Editexte: Internal error" ) ); - break; + DisplayError( this, wxT( "WinEDA_SchematicFrame::CreateNewText() Internal error" ) ); + return NULL; } - NewText->m_Flags = IS_NEW | IS_MOVED; + NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize; + NewText->m_Flags = IS_NEW | IS_MOVED; RedrawOneStruct( DrawPanel, DC, NewText, g_XorMode ); EditSchematicText( NewText, DC ); @@ -222,8 +221,8 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) if( type == LAYER_GLOBLABEL ) { - s_DefaultShapeGLabel = ( (DrawGlobalLabelStruct*) NewText )->m_Shape; - s_DefaultOrientGLabel = ( (DrawGlobalLabelStruct*) NewText )->m_Orient; + s_DefaultShapeGLabel = NewText->m_Shape; + s_DefaultOrientGLabel = NewText->m_Orient; } RedrawOneStruct( DrawPanel, DC, NewText, GR_DEFAULT_DRAWMODE ); @@ -236,9 +235,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type ) } -/****************************************/ -/* Dessin du Texte en deplacement */ -/****************************************/ +/************************************/ +/* Redraw a Texte while moving */ +/************************************/ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) { EDA_BaseStruct* TextStruct = panel->GetScreen()->GetCurItem(); @@ -322,41 +321,95 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text, /*****************************************************************************/ /* Routine to change a text type to an other one (GraphicText, label or Glabel). + * A new test, label or global label is created from the old text. + * the old text is deleted */ { if( Text == NULL ) return; - /* save Text in undo list if not already in edit, or moving ... */ - if( Text->m_Flags == 0 ) - SaveCopyInUndoList( Text, IS_CHANGED ); + DrawTextStruct* newtext; - DrawPanel->CursorOff( DC ); // Erase schematic cursor - RedrawOneStruct( DrawPanel, DC, Text, g_XorMode ); - - // erase drawing switch( newtype ) { case DRAW_LABEL_STRUCT_TYPE: - Text->SetType( DRAW_LABEL_STRUCT_TYPE ); - Text->m_Layer = LAYER_LOCLABEL; + newtext = new DrawLabelStruct( Text->m_Pos, Text->m_Text ); break; case DRAW_GLOBAL_LABEL_STRUCT_TYPE: - Text->SetType( DRAW_GLOBAL_LABEL_STRUCT_TYPE ); - Text->m_Layer = LAYER_GLOBLABEL; + newtext = new DrawGlobalLabelStruct( Text->m_Pos, Text->m_Text ); break; case DRAW_TEXT_STRUCT_TYPE: - Text->SetType( DRAW_TEXT_STRUCT_TYPE ); - Text->m_Layer = LAYER_NOTES; + newtext = new DrawTextStruct( Text->m_Pos, Text->m_Text ); break; default: + newtext = NULL; DisplayError( this, wxT( "ConvertTextType: Internal error" ) ); - break; + return; } - RedrawOneStruct( DrawPanel, DC, Text, GR_DEFAULT_DRAWMODE ); + /* copy the old text settings */ + newtext->m_Shape = Text->m_Shape; + newtext->m_Orient = Text->m_Orient; + newtext->m_Size = Text->m_Size; + newtext->m_Width = Text->m_Width; + newtext->m_HJustify = Text->m_HJustify; + newtext->m_VJustify = Text->m_VJustify; + newtext->m_IsDangling = Text->m_IsDangling; + + // save current text flag: + int flags = Text->m_Flags; + + /* add the new text in linked list if old text is in list */ + if( (flags & IS_NEW) == 0 ) + { + newtext->Pnext = GetScreen()->EEDrawList; + GetScreen()->EEDrawList = newtext; + GetScreen()->SetModify(); + } + + /* now delete the old text + * If it is a text flagged IS_NEW it will be deleted by ForceCloseManageCurseur() + * If not, we must delete it. + */ + if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) + { + DrawPanel->ForceCloseManageCurseur( DrawPanel, DC ); + } + if( (flags & IS_NEW) == 0 ) // Delete old text and save it in undo list + { + Text->m_Flags = 0; + DeleteStruct( DrawPanel, DC, Text ); + m_CurrentScreen->SetCurItem( NULL ); + g_ItemToRepeat = NULL; + } + GetScreen()->SetCurItem( newtext ); + + delete g_ItemToUndoCopy; + g_ItemToUndoCopy = NULL; + + DrawPanel->CursorOff( DC ); // Erase schematic cursor + + /* Save the new text in undo list if the old text was not itself a "new created text" + * In this case, the old text is already in undo list as a deleted item + * Of course if the old text was a "new created text" the new text will be put in undo list + * later, at the end of the current command (if not aborted) + */ + if( (flags & IS_NEW) == 0 ) + { + SaveCopyInUndoList( newtext, IS_NEW ); + } + else + newtext->m_Flags = IS_NEW; + + + if( (flags & IS_MOVED) != 0 ) + { + StartMoveTexte( newtext, DC ); + } + + RedrawOneStruct( DrawPanel, DC, newtext, GR_DEFAULT_DRAWMODE ); DrawPanel->CursorOn( DC ); // redraw schematic cursor } diff --git a/eeschema/libcmp.h b/eeschema/libcmp.h index 10d1c70131..4568badfed 100644 --- a/eeschema/libcmp.h +++ b/eeschema/libcmp.h @@ -32,7 +32,7 @@ #define NO_FILL 0 // Poly, Squar, Circle, Arc = option No Fill #define FILLED_SHAPE 1 // Poly, Squar, Circle, Arc = option Fill with current color #define FILLED_WITH_BG_BODYCOLOR 2 // Poly, Squar, Circle, Arc = option Fill - // with background body color +// with background body color //Offsets used in editing library component, for handle aliad dats #define ALIAS_NAME 0 @@ -147,10 +147,10 @@ public: unsigned long m_TimeStamp; // Signature temporelle int m_Flags; // variable used in some functions bool m_IsLibCache; // False for the "standard" libraries, - // True for the library cache + // True for the library cache public: - LibraryStruct( int type, const wxString &name, const wxString &fullname ); + LibraryStruct( int type, const wxString& name, const wxString& fullname ); ~LibraryStruct(); bool WriteHeader( FILE* file ); bool ReadHeader( FILE* file, int* LineNum ); @@ -181,6 +181,8 @@ public: { return (LibEDA_BaseStruct*) Pnext; } + + LibEDA_BaseStruct( KICAD_T struct_type ); virtual ~LibEDA_BaseStruct() { } void Display_Infos_DrawEntry( WinEDA_DrawFrame* frame ); @@ -198,18 +200,25 @@ public: long m_PinNum; /* Pin number: 4 Ascii code like "12" or "anod" or "G6" * "12" is really "12\0\0"*/ wxString m_PinName; - int m_PinNumSize, m_PinNameSize;/* Pin num and Pin name sizes */ + int m_PinNumSize, m_PinNameSize; /* Pin num and Pin name sizes */ // short m_PinNumWidth, m_PinNameWidth; /* (Unused) Pin num and Pin name text width */ public: LibDrawPin(); ~LibDrawPin() { } + virtual wxString GetClass() const + { + return wxT( "LibDrawPin" ); + } + + LibDrawPin* GenCopy(); bool WriteDescr( FILE* File ); void Display_Infos( WinEDA_DrawFrame* frame ); wxPoint ReturnPinEndPoint(); - int ReturnPinDrawOrient( int TransMat[2][2] ); + + int ReturnPinDrawOrient( int TransMat[2][2] ); void ReturnPinStringNum( wxString& buffer ); void SetPinNumFromString( wxString& buffer ); void DrawPinSymbol( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& pin_pos, @@ -236,6 +245,12 @@ public: public: LibDrawArc(); ~LibDrawArc() { } + virtual wxString GetClass() const + { + return wxT( "LibDrawArc" ); + } + + LibDrawArc* GenCopy(); bool WriteDescr( FILE* File ); }; @@ -249,6 +264,12 @@ public: public: LibDrawCircle(); ~LibDrawCircle() { } + virtual wxString GetClass() const + { + return wxT( "LibDrawCircle" ); + } + + LibDrawCircle* GenCopy(); bool WriteDescr( FILE* File ); }; @@ -264,6 +285,12 @@ public: public: LibDrawText(); ~LibDrawText() { } + virtual wxString GetClass() const + { + return wxT( "LibDrawText" ); + } + + LibDrawText* GenCopy(); bool WriteDescr( FILE* File ); }; @@ -277,6 +304,12 @@ public: public: LibDrawSquare(); ~LibDrawSquare() { } + virtual wxString GetClass() const + { + return wxT( "LibDrawSquare" ); + } + + LibDrawSquare* GenCopy(); bool WriteDescr( FILE* File ); }; @@ -289,6 +322,12 @@ public: public: LibDrawSegment(); ~LibDrawSegment() { } + virtual wxString GetClass() const + { + return wxT( "LibDrawSegment" ); + } + + LibDrawSegment* GenCopy(); bool WriteDescr( FILE* File ); }; @@ -301,10 +340,19 @@ public: public: LibDrawPolyline(); - ~LibDrawPolyline() { + ~LibDrawPolyline() + { if( PolyList ) free( PolyList ); } + + + virtual wxString GetClass() const + { + return wxT( "LibDrawPolyline" ); + } + + LibDrawPolyline* GenCopy(); void AddPoint( const wxPoint& point ); bool WriteDescr( FILE* File ); @@ -316,18 +364,23 @@ class LibDrawField : public LibEDA_BaseStruct { public: int m_FieldId; // 0 a 11 - // 0 = Name 1 = Valeur 2 .. 11 autres fields + // 0 = Name; 1 = Valeur; 2 .. 11 other fields wxPoint m_Pos; wxSize m_Size; int m_Orient; /* Orientation */ - int m_Attributs; /* Attributs (Non visible ...) */ - int m_HJustify, m_VJustify; /* Justifications Horiz et Vert du texte */ + int m_Attributs; /* Attributes (Non visible ...) */ + int m_HJustify, m_VJustify; /* Horiz an Vert Texte Justifications */ wxString m_Text; /* Field Data */ wxString m_Name; /* Field Name */ public: LibDrawField( int idfield = 2 ); ~LibDrawField(); + virtual wxString GetClass() const + { + return wxT( "LibDrawField" ); + } + LibDrawField* GenCopy(); void Copy( LibDrawField* Target ); @@ -335,25 +388,31 @@ public: }; -/* classe de base de description des composants en librairie */ +/* basic class to describe components in libraries (true component or alias), non used directly */ class LibCmpEntry : public EDA_BaseStruct { public: LibrEntryType Type; /* Type = ROOT; * = ALIAS pour struct LibraryAliasType */ LibDrawField m_Name; // name (74LS00 ..) in lib ( = VALUE ) - wxString m_Doc; /* ligne de documentation */ - wxString m_KeyWord; /* liste des mots cles */ - wxString m_DocFile; /* nom du fichier Doc Associe */ + wxString m_Doc; /* documentation for info */ + wxString m_KeyWord; /* keyword list (used to select a group of components by keyword) */ + wxString m_DocFile; /* Associed doc filename */ LibrEntryOptions m_Options; // special features (i.e. Entry is a POWER) public: - LibCmpEntry( LibrEntryType CmpType, const wxChar * CmpName ); + LibCmpEntry( LibrEntryType CmpType, const wxChar* CmpName ); virtual ~LibCmpEntry(); + virtual wxString GetClass() const + { + return wxT( "LibCmpEntry" ); + } + + bool WriteDescr( FILE* File ); }; -class EDA_LibComponentStruct : public LibCmpEntry /* composant "racine" */ +class EDA_LibComponentStruct : public LibCmpEntry /* usual component in lib */ { public: LibDrawField m_Prefix; /* Prefix ( U, IC ... ) = REFERENCE */ @@ -361,55 +420,62 @@ public: wxArrayString m_FootprintList; /* list of suitable footprint names for the component (wildcard names accepted)*/ int m_UnitCount; /* Units (or sections) per package */ bool m_UnitSelectionLocked; // True if units are differents and their selection is locked - // (i.e. if part A cannot be automatically changed in part B - int m_TextInside;/* if 0: pin name drawn on the pin itself - * if > 0 pin name drawn inside the component, - * with a distance of m_TextInside in mils */ + // (i.e. if part A cannot be automatically changed in part B + int m_TextInside; /* if 0: pin name drawn on the pin itself + * if > 0 pin name drawn inside the component, + * with a distance of m_TextInside in mils */ bool m_DrawPinNum; bool m_DrawPinName; - LibDrawField* Fields; /* Auxiliairy Field list (id = 2 a 11*/ - LibEDA_BaseStruct* m_Drawings; /* How to draw this part */ - long m_LastDate; // Last change Date + LibDrawField* Fields; /* Auxiliairy Field list (id = 2 a 11) */ + LibEDA_BaseStruct* m_Drawings; /* How to draw this part */ + long m_LastDate; // Last change Date public: - EDA_LibComponentStruct( const wxChar * CmpName ); - EDA_Rect GetBoundaryBox( int Unit, int Convert );/* return Box around the part. */ + virtual wxString GetClass() const + { + return wxT( "EDA_LibComponentStruct" ); + } + + + EDA_LibComponentStruct( const wxChar* CmpName ); + EDA_Rect GetBoundaryBox( int Unit, int Convert ); /* return Box around the part. */ ~EDA_LibComponentStruct(); void SortDrawItems(); }; -class EDA_LibCmpAliasStruct : public LibCmpEntry +class EDA_LibCmpAliasStruct : public LibCmpEntry /* alias of an usual component in lib (root component) */ { public: - wxString m_RootName; /* Part name pour le composant de reference */ + wxString m_RootName; /* Root component Part name */ public: - EDA_LibCmpAliasStruct( const wxChar * CmpName, const wxChar * CmpRootName ); + EDA_LibCmpAliasStruct( const wxChar* CmpName, const wxChar* CmpRootName ); ~EDA_LibCmpAliasStruct(); + virtual wxString GetClass() const + { + return wxT( "EDA_LibCmpAliasStruct" ); + } }; /* Variables */ -extern LibraryStruct* LibraryList; /* All part libs are saved here. */ +extern LibraryStruct* LibraryList; /* All part libs are saved here. */ -/* Variables Utiles pour les editions de composants en librairie */ -eda_global LibEDA_BaseStruct* LibItemToRepeat;/* pointeur sur l'élément que l'on - * peut répéter (Pin..;) */ -eda_global LibraryStruct* CurrentLib; /* Pointeur sur la librairie du - * composant en cours d'edition */ -eda_global EDA_LibComponentStruct* CurrentLibEntry; /* pointeur sur le composant en - * cours d'edition */ -eda_global LibEDA_BaseStruct* CurrentDrawItem;/* pointeur sur les - * elements de dessin du comp. en edition */ +/* Variables used by LibEdit */ +eda_global LibEDA_BaseStruct* LibItemToRepeat; /* pointeur sur l'élément que l'on + * peut répéter (Pin..;) */ +eda_global LibraryStruct* CurrentLib; /* Current opened library */ +eda_global EDA_LibComponentStruct* CurrentLibEntry; /* Current component */ +eda_global LibEDA_BaseStruct* CurrentDrawItem; /* current edited item */ -eda_global wxString CurrentAliasName; // Nom de l'alias selectionné -eda_global bool g_AsDeMorgan; // Pour libedit: -eda_global int CurrentUnit +eda_global wxString CurrentAliasName; // Current selected alias (for components which have aliases) +eda_global bool g_AsDeMorgan; // True if the current component has a "De Morgan" representation +eda_global int CurrentUnit // Current selected part #ifdef MAIN = 1 #endif ; -eda_global int CurrentConvert /* Convert = 1 .. 255 */ +eda_global int CurrentConvert /* Convert = 1 .. 255 */ #ifdef MAIN = 1 #endif diff --git a/eeschema/locate.cpp b/eeschema/locate.cpp index 67fe9ff033..ba69c26643 100644 --- a/eeschema/locate.cpp +++ b/eeschema/locate.cpp @@ -473,7 +473,7 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask, { wxString msg; msg.Printf( wxT( "SnapPoint2() error: unexpected strct type %d (" ), DrawList->Type() ); - msg << DrawList->ReturnClassName() << wxT( ")" ); + msg << DrawList->GetClass() << wxT( ")" ); DisplayError( NULL, msg ); break; } @@ -660,7 +660,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, msg.Printf( wxT( "DrawStructInBox() Err: unexpected StructType %d (" ), DrawStruct->Type() ); - msg << DrawStruct->ReturnClassName() << wxT( ")" ); + msg << DrawStruct->GetClass() << wxT( ")" ); DisplayError( NULL, msg ); break; } diff --git a/eeschema/program.h b/eeschema/program.h index 319abd6041..80addfff38 100644 --- a/eeschema/program.h +++ b/eeschema/program.h @@ -73,8 +73,14 @@ public: bool m_EndIsDangling; // TRUE si Start ou End not connected (wires, tracks...) public: - EDA_DrawLineStruct( const wxPoint &pos, int layer ); + EDA_DrawLineStruct( const wxPoint& pos, int layer ); ~EDA_DrawLineStruct() { } + virtual wxString GetClass() const + { + return wxT( "EDA_DrawLineStruct" ); + } + + bool IsOneEndPointAt( const wxPoint& pos ); EDA_DrawLineStruct* GenCopy(); @@ -83,6 +89,7 @@ public: return m_Start == m_End; } + virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); }; @@ -97,8 +104,14 @@ public: wxString m_Comment; /* Texte (commentaireassocie eventuel */ public: - DrawMarkerStruct( const wxPoint &pos, const wxString &text ); + DrawMarkerStruct( const wxPoint& pos, const wxString& text ); ~DrawMarkerStruct(); + virtual wxString GetClass() const + { + return wxT( "DrawMarkerStruct" ); + } + + DrawMarkerStruct* GenCopy(); wxString GetComment(); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, @@ -112,8 +125,14 @@ public: wxPoint m_Pos; /* XY coordinates of NoConnect. */ public: - DrawNoConnectStruct( const wxPoint &pos ); + DrawNoConnectStruct( const wxPoint& pos ); ~DrawNoConnectStruct() { } + virtual wxString GetClass() const + { + return wxT( "DrawNoConnectStruct" ); + } + + DrawNoConnectStruct* GenCopy(); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); @@ -122,7 +141,7 @@ public: /** * Class DrawBusEntryStruct - * Struct de descr 1 raccord a 45 degres de BUS ou WIRE + * Struct de descr 1 raccord a 45 degres de BUS ou WIRE */ class DrawBusEntryStruct : public EDA_BaseStruct { @@ -133,15 +152,21 @@ public: wxSize m_Size; public: - DrawBusEntryStruct( const wxPoint &pos, int shape, int id ); + DrawBusEntryStruct( const wxPoint& pos, int shape, int id ); ~DrawBusEntryStruct() { } + virtual wxString GetClass() const + { + return wxT( "DrawBusEntryStruct" ); + } + + DrawBusEntryStruct* GenCopy(); wxPoint m_End(); // retourne la coord de fin du raccord virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); }; -class DrawPolylineStruct : public EDA_BaseStruct/* Polyligne (serie de segments) */ +class DrawPolylineStruct : public EDA_BaseStruct /* Polyligne (serie de segments) */ { public: int m_Layer; @@ -152,6 +177,12 @@ public: public: DrawPolylineStruct( int layer ); ~DrawPolylineStruct(); + virtual wxString GetClass() const + { + return wxT( "DrawPolylineStruct" ); + } + + DrawPolylineStruct* GenCopy(); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); @@ -164,15 +195,22 @@ public: wxPoint m_Pos; /* XY coordinates of connection. */ public: - DrawJunctionStruct( const wxPoint &pos ); + DrawJunctionStruct( const wxPoint& pos ); ~DrawJunctionStruct() { } + virtual wxString GetClass() const + { + return wxT( "DrawJunctionStruct" ); + } + + DrawJunctionStruct* GenCopy(); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); }; -class DrawTextStruct : public EDA_BaseStruct, public EDA_TextStruct +class DrawTextStruct : public EDA_BaseStruct + , public EDA_TextStruct { public: int m_Layer; @@ -180,29 +218,23 @@ 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( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, + KICAD_T aType = DRAW_TEXT_STRUCT_TYPE ); ~DrawTextStruct() { } - + + virtual wxString GetClass() const + { + return wxT( "DrawTextStruct" ); + } + + DrawTextStruct* GenCopy(); virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); - - void SwapData( DrawTextStruct* copyitem ); - - virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); - // selectively give public access to a very dangerous protected function: - void SetType( KICAD_T aType ) { EDA_BaseStruct::SetType( aType ); } - - -private: - void DrawAsText( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, - int draw_mode, int Color ); - void DrawAsLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, - int draw_mode, int Color ); - void DrawAsGlobalLabel( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, - int draw_mode, int Color ); + void SwapData( DrawTextStruct* copyitem ); + + virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC ); }; @@ -211,15 +243,29 @@ class DrawLabelStruct : public DrawTextStruct public: DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString ); ~DrawLabelStruct() { } + virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, + int Color = -1 ); + + virtual wxString GetClass() const + { + return wxT( "DrawLabelStruct" ); + } }; class DrawGlobalLabelStruct : public DrawTextStruct { public: - DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), - const wxString& text = wxEmptyString ); + DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), + const wxString& text = wxEmptyString ); ~DrawGlobalLabelStruct() { } + virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, + int Color = -1 ); + + virtual wxString GetClass() const + { + return wxT( "DrawGlobalLabelStruct" ); + } }; diff --git a/eeschema/savelib.cpp b/eeschema/savelib.cpp index 3e3d539a4f..a131d1b815 100644 --- a/eeschema/savelib.cpp +++ b/eeschema/savelib.cpp @@ -230,13 +230,11 @@ LibEDA_BaseStruct* CopyDrawEntryStruct( wxWindow* frame, LibEDA_BaseStruct* DrawItem ) /**********************************************************/ -/* Routine de Duplication d'une structure DrawLibItem d'une partlib - * Parametres d'entree: - * DrawEntry = pointeur sur la structure a dupliquer - * La structure nouvelle est creee, mais n'est pas inseree dans le - * chainage - * Retourne: - * Pointeur sur la structure creee +/* Duplicate a DrawLibItem + * the new item is only created, it is not put in the current component linked list + * @param DrawEntry = DrawLibItem * item to duplicate + * @return a pointer to the new item + * A better way to duplicate a DrawLibItem is to have a virtual GenCopy() in LibEDA_BaseStruct class (ToDo). */ { LibEDA_BaseStruct* NewDrawItem = NULL; @@ -345,12 +343,9 @@ EDA_LibComponentStruct* CopyLibEntryStruct( wxWindow* frame, EDA_LibComponentStr LastItem = NewDrawings; NewDrawings->Pnext = NULL; } - else // Probleme rencontré: arret de copie - { - /* why this? m_StructType is not a flag, it is a type indicator! - OldDrawings->Type() = TYPE_NOT_INIT; - */ - + else // Should nevers occurs, just in case... + { // CopyDrawEntryStruct() was not able to duplicate the type of OldDrawings + // occurs when an unexpected type is encountered DisplayError( frame, wxT( "CopyLibEntryStruct(): error: aborted" ) ); break; } diff --git a/gerbview/block.cpp b/gerbview/block.cpp index e9f7d4715d..80ef619a20 100644 --- a/gerbview/block.cpp +++ b/gerbview/block.cpp @@ -304,7 +304,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC ) /************************************************/ /* - * routine de deplacement des elements du block deja selectionne + * Function to move items in the current selected block */ { int deltaX, deltaY; @@ -322,36 +322,35 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC ) deltaX = GetScreen()->BlockLocate.m_MoveVector.x; deltaY = GetScreen()->BlockLocate.m_MoveVector.y; -/* Deplacement des Segments de piste */ - TRACK* track; - track = m_Pcb->m_Track; + /* Move the Track segments in block */ + TRACK* track = m_Pcb->m_Track; while( track ) { if( IsSegmentInBox( GetScreen()->BlockLocate, track ) ) - { /* la piste est ici bonne a etre deplacee */ + { m_Pcb->m_Status_Pcb = 0; - track->Draw( DrawPanel, DC, GR_XOR ); // effacement + track->Draw( DrawPanel, DC, GR_XOR ); // erase the display track->m_Start.x += deltaX; track->m_Start.y += deltaY; track->m_End.x += deltaX; track->m_End.y += deltaY; track->m_Param += deltaX; track->m_Sous_Netcode += deltaY; - track->Draw( DrawPanel, DC, GR_OR ); // reaffichage + track->Draw( DrawPanel, DC, GR_OR ); // redraw the moved track } - track = (TRACK*) track->Pnext; + track = track->Next(); } - /* Deplacement des Segments de Zone */ - track = (TRACK*) m_Pcb->m_Zone; - while( track ) + /* Move the Zone segments in block */ + SEGZONE * zsegment= m_Pcb->m_Zone; + while( zsegment ) { if( IsSegmentInBox( GetScreen()->BlockLocate, track ) ) - { /* la piste est ici bonne a etre deplacee */ - track->Draw( DrawPanel, DC, GR_XOR ); // effacement - track->m_Start.x += deltaX; track->m_Start.y += deltaY; - track->m_End.x += deltaX; track->m_End.y += deltaY; - track->m_Param += deltaX; track->m_Sous_Netcode += deltaY; - track->Draw( DrawPanel, DC, GR_OR ); // reaffichage + { + zsegment->Draw( DrawPanel, DC, GR_XOR ); // erase the display + zsegment->m_Start.x += deltaX; track->m_Start.y += deltaY; + zsegment->m_End.x += deltaX; track->m_End.y += deltaY; + zsegment->m_Param += deltaX; track->m_Sous_Netcode += deltaY; + zsegment->Draw( DrawPanel, DC, GR_OR ); // redraw the moved zone zegment } - track = (TRACK*) track->Pnext; + zsegment = zsegment->Next(); } DrawPanel->Refresh( TRUE ); @@ -363,10 +362,10 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC ) /**************************************************/ /* - * routine de duplication des elements du block deja selectionne + * Function to duplicate items in the current selected block */ { - int deltaX, deltaY; + wxPoint delta; wxPoint oldpos; oldpos = GetScreen()->m_Curseur; @@ -379,58 +378,45 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC ) /* calcul du vecteur de deplacement pour les deplacements suivants */ - deltaX = GetScreen()->BlockLocate.m_MoveVector.x; - deltaY = GetScreen()->BlockLocate.m_MoveVector.y; + delta = GetScreen()->BlockLocate.m_MoveVector; - /* Deplacement des Segments de piste */ - TRACK* track, * next_track, * new_track; - - track = m_Pcb->m_Track; + /* Copy selected track segments and move the new track its new location */ + TRACK* track = m_Pcb->m_Track; while( track ) { - next_track = track->Next(); + TRACK* next_track = track->Next(); if( IsSegmentInBox( GetScreen()->BlockLocate, track ) ) { - /* la piste est ici bonne a etre deplacee */ + /* this track segment must be duplicated */ m_Pcb->m_Status_Pcb = 0; - new_track = track->Copy(); + TRACK* new_track = track->Copy(); new_track->Insert( m_Pcb, NULL ); - new_track->m_Start.x += deltaX; - new_track->m_Start.y += deltaY; + new_track->m_Start += delta; + new_track->m_End += delta; - new_track->m_End.x += deltaX; - new_track->m_End.y += deltaY; - - new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage + new_track->Draw( DrawPanel, DC, GR_OR ); // draw the new created segment } track = next_track; } - /* Deplacement des Segments de Zone */ - track = (TRACK*) m_Pcb->m_Zone; - while( track ) + /* Copy the Zone segments and move the new segment to its new location */ + SEGZONE * zsegment= m_Pcb->m_Zone; + while( zsegment ) { - next_track = track->Next(); + SEGZONE * next_zsegment = zsegment->Next(); if( IsSegmentInBox( GetScreen()->BlockLocate, track ) ) { - /* la piste est ici bonne a etre deplacee */ - // @todo: bug? memory leak at this point: - new_track = new TRACK( m_Pcb ); + /* this zone segment must be duplicated */ + SEGZONE * new_zsegment = (SEGZONE*) zsegment->Copy(); + new_zsegment->Insert( m_Pcb, NULL ); - new_track = track->Copy(); + new_zsegment->m_Start += delta; + new_zsegment->m_End += delta; - new_track->Insert( m_Pcb, NULL ); - - new_track->m_Start.x += deltaX; - new_track->m_Start.y += deltaY; - - new_track->m_End.x += deltaX; - new_track->m_End.y += deltaY; - - new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage + new_zsegment->Draw( DrawPanel, DC, GR_OR ); // draw the new created segment } - track = next_track; + zsegment = next_zsegment; } } diff --git a/include/base_struct.h b/include/base_struct.h index 05dca12991..171ba28eb7 100644 --- a/include/base_struct.h +++ b/include/base_struct.h @@ -168,20 +168,6 @@ private: private: void InitVars(); - -protected: - /** - * Function SetType - * is dangerous and should not be used. It is here to work around a design - * issue in the DrawTextStruct -> DrawLabelStruct and - * DrawTextStruct -> DrawGlobalLabelStruct class hierarchy of eeschema. - * Only constructors should set m_StructType and once set, there should be - * no reason to change an object's type. For if you do, you risk mis-matching - * the virtual functions of the object with its Type() function, because the - * virtual function table is set in the call to a constructor and cannot be - * changed later without doing an "in place constructor" call (ugly and dangerous). - */ - void SetType( KICAD_T aType ) { m_StructType = aType; } public: @@ -211,8 +197,6 @@ public: m_Status = new_status; } - wxString ReturnClassName() const; - /* addition d'une nouvelle struct a la liste chain� */ void AddToChain( EDA_BaseStruct* laststruct ); @@ -288,8 +272,6 @@ public: const KICAD_T scanTypes[] ); -#if defined(DEBUG) - /** * Function GetClass * returns the class name. @@ -297,15 +279,12 @@ public: */ virtual wxString GetClass() const { - // ReturnClassName() is too hard to maintain, coordinating the array - // with the enum. It would be nice to migrate to virtual GetClass() - // away from ReturnClassName(). Over time, derived classes should - // simply return a wxString from their virtual GetClass() function. - // Some classes do that now. - return ReturnClassName(); + return wxT("EDA_BaseStruct"); } +#if defined(DEBUG) + /** * Function Show * is used to output the object tree, currently for debugging only. diff --git a/include/bitmaps.h b/include/bitmaps.h index 66a0529eea..c5194ae85c 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -108,6 +108,7 @@ #include "../bitmaps/down.xpm" #include "../bitmaps/File_FootPrint.xpm" + #include "../bitmaps/Footprint_Text.xpm" #include "../bitmaps/Options_Pad.xpm" #include "../bitmaps/Options_New_Pad.xpm" diff --git a/include/drawpanel_wxstruct.h b/include/drawpanel_wxstruct.h index 264a19ce6b..5a61dabfc5 100644 --- a/include/drawpanel_wxstruct.h +++ b/include/drawpanel_wxstruct.h @@ -304,7 +304,6 @@ public: } -#if defined (DEBUG) /** * Function GetClass * returns the class name. @@ -314,7 +313,6 @@ public: { return wxT( "BASE_SCREEN" ); } -#endif }; diff --git a/include/pcbstruct.h b/include/pcbstruct.h index 86f1d61603..ae8b8661ff 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -216,7 +216,7 @@ public: MODULE* m_Modules; // linked list of MODULEs EQUIPOT* m_Equipots; // linked list of nets TRACK* m_Track; // linked list of TRACKs and SEGVIAs - TRACK* m_Zone; // linked list of SEGZONEs + SEGZONE* m_Zone; // linked list of SEGZONEs D_PAD** m_Pads; // pointeur liste d'acces aux pads int m_NbPads; // nombre total de pads CHEVELU* m_Ratsnest; // pointeur liste des chevelus @@ -290,7 +290,6 @@ public: EQUIPOT* FindNet( int aNetcode ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -301,6 +300,7 @@ public: return wxT( "BOARD" ); } +#if defined(DEBUG) /** * Function Show * is used to output the object tree, currently for debugging only. @@ -398,7 +398,6 @@ public: */ bool HitTest( const wxPoint& ref_pos ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -406,10 +405,8 @@ public: */ wxString GetClass() const { - return wxT("pgraphic"); + return wxT("DRAWSEGMENT"); } -#endif - }; diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index c311c20854..51555f9d1d 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -383,7 +383,17 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData, #if 0 // both these are on same list, so we must scan it twice in order to get VIA priority, // using new #else code below. - // @todo: consider why we are not using separte lists for TRACKs and SEGVIAs. + // But we are not using separte lists for TRACKs and SEGVIAs, because items are ordered (sortered) in the linked + // list by netcode AND by physical distance: + // when created, if a track or via is connected to an existing track or via, it is put in linked list + // after this existing track or via + // So usually, connected tracks or vias are grouped in this list + // So the algorithm (used in rastnest computations) which computes the track connectivity is faster (more than 100 time regarding to + // a non ordered list) because when it searchs for a connexion, first it tests the near (near in term of linked list) 50 items + // from the current item (track or via) in test. + // Usually, because of this sort, a connected item (if exists) is found. + // If not found (and only in this case) an exhaustive (and time consumming) search is made, + // but this case is statistically rare. case TYPEVIA: case TYPETRACK: result = IterateForward( m_Track, inspector, testData, p ); diff --git a/pcbnew/class_cotation.h b/pcbnew/class_cotation.h index 22a637b848..8934aac3c5 100644 --- a/pcbnew/class_cotation.h +++ b/pcbnew/class_cotation.h @@ -60,7 +60,6 @@ public: bool HitTest( const wxPoint& ref_pos ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -70,7 +69,6 @@ public: { return wxT( "DIMENSION" ); } -#endif }; #endif // #define COTATION_H diff --git a/pcbnew/class_edge_mod.h b/pcbnew/class_edge_mod.h index f948926312..28655724c8 100644 --- a/pcbnew/class_edge_mod.h +++ b/pcbnew/class_edge_mod.h @@ -65,7 +65,6 @@ public: */ bool HitTest( const wxPoint& refPos ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -77,6 +76,7 @@ public: // return wxT( "EDGE" ); ? } +#if defined(DEBUG) /** * Function Show * is used to output the object tree, currently for debugging only. diff --git a/pcbnew/class_equipot.h b/pcbnew/class_equipot.h index a42c703cb9..bea8270d4e 100644 --- a/pcbnew/class_equipot.h +++ b/pcbnew/class_equipot.h @@ -33,7 +33,6 @@ public: int WriteEquipotDescr( FILE* File ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -45,6 +44,7 @@ public: } +#if defined(DEBUG) /** * Function Show * is used to output the object tree, currently for debugging only. diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 1d8e3c6e8a..efc33339ef 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -175,7 +175,6 @@ public: const KICAD_T scanTypes[] ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -187,7 +186,8 @@ public: } - /** + #if defined(DEBUG) + /** * Function Show * is used to output the object tree, currently for debugging only. * @param nestLevel An aid to prettier tree indenting, and is the level diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index fc27c9b2e2..685eaa638a 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -117,8 +117,6 @@ public: */ bool HitTest( const wxPoint& refPos ); -#if defined (DEBUG) - /** * Function GetClass * returns the class name. @@ -129,7 +127,7 @@ public: return wxT( "PAD" ); } - +#if defined (DEBUG) /** * Function Show * is used to output the object tree, currently for debugging only. diff --git a/pcbnew/class_pcb_text.h b/pcbnew/class_pcb_text.h index 94088b5433..7ed6c34834 100644 --- a/pcbnew/class_pcb_text.h +++ b/pcbnew/class_pcb_text.h @@ -49,7 +49,6 @@ public: } -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -60,6 +59,7 @@ public: return wxT("PTEXT"); } +#if defined(DEBUG) /** * Function Show * is used to output the object tree, currently for debugging only. diff --git a/pcbnew/class_text_mod.h b/pcbnew/class_text_mod.h index 867868470f..bacb8293dd 100644 --- a/pcbnew/class_text_mod.h +++ b/pcbnew/class_text_mod.h @@ -99,7 +99,6 @@ public: -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -110,6 +109,7 @@ public: return wxT( "MTEXT" ); } +#if defined(DEBUG) /** * Function Show * is used to output the object tree, currently for debugging only. diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index ab29cbfd98..5ba6a598b1 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -298,7 +298,7 @@ void TRACK::UnLink() { if( Type() == TYPEZONE ) { - ( (BOARD*) Pback )->m_Zone = (TRACK*) Pnext; + ( (BOARD*) Pback )->m_Zone = (SEGZONE*) Pnext; } else { @@ -331,7 +331,7 @@ void TRACK::Insert( BOARD* Pcb, BOARD_ITEM* InsertPoint ) if( Type() == TYPEZONE ) // put SEGZONE on front of m_Zone list { NextS = Pcb->m_Zone; - Pcb->m_Zone = this; + Pcb->m_Zone = (SEGZONE*)this; } else // put TRACK or SEGVIA on front of m_Track list diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h index a248ffeeb6..057de660cb 100644 --- a/pcbnew/class_track.h +++ b/pcbnew/class_track.h @@ -134,7 +134,6 @@ public: */ bool HitTest( const wxPoint& refPos ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -154,8 +153,6 @@ public: */ void Show( int nestLevel, std::ostream& os ); -#endif - }; @@ -164,7 +161,6 @@ class SEGZONE : public TRACK public: SEGZONE( BOARD_ITEM* StructFather ); -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -174,8 +170,9 @@ public: { return wxT("ZONE"); } -#endif - + + SEGZONE* Next() const { return (SEGZONE*) Pnext; } + }; @@ -203,7 +200,6 @@ public: void SetLayerPair( int top_layer, int bottom_layer ); void ReturnLayerPair( int* top_layer, int* bottom_layer ) const; -#if defined(DEBUG) /** * Function GetClass * returns the class name. @@ -213,8 +209,6 @@ public: { return wxT("VIA"); } -#endif - }; diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index 8d163df626..fe010734ec 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -19,7 +19,6 @@ #include "collectors.h" #include "bitmaps.h" -#include "Footprint_Text.xpm" #include "add_cotation.xpm" #include "Add_Mires.xpm" #include "Add_Zone.xpm" @@ -206,7 +205,7 @@ wxString BOARD_ITEM::MenuText() const break; default: - text << item->ReturnClassName() << wxT(" BUG!!"); + text << item->GetClass() << wxT(" Unexpected item type: BUG!!"); break; } diff --git a/pcbnew/edgemod.cpp b/pcbnew/edgemod.cpp index c0849707f6..c8ed202aff 100644 --- a/pcbnew/edgemod.cpp +++ b/pcbnew/edgemod.cpp @@ -1,15 +1,12 @@ /******************************************************/ -/* Edition des contours d'un module: Routines */ -/* d'effacement et d'edition de segments et contours */ -/* appartenant aux modules */ +/* Edition of footprint edges */ /******************************************************/ /* fichier edgemod.cpp */ -/* Routines d'edition des contours d'un module. - * La correction des Arcs de cercle n'est pas traitee ( mais - * les menus en routines sont prevus +/* Functions to edit graphic items used to draw footprint edges. + * Function to Arcs are not made (TODO..) but menus are ready to use */ #include "fctsys.h" @@ -37,7 +34,7 @@ static wxPoint CursorInitialPosition; // Mouse cursor inital position for move void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC ) /****************************************************************************/ -/* Routine de preparation du deplacement d'un element graphique type DRAWSEGMENT +/* Function to initialise the move function params of a graphic item type DRAWSEGMENT */ { if( Edge == NULL ) @@ -58,7 +55,7 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge, wxDC* DC ) /*********************************************************************/ /* - * Routine de placement de l'element graphique type EDGE_MODULE en cours de deplacement + * Function to place a graphic item type EDGE_MODULE currently moved */ { if( Edge == NULL ) @@ -87,7 +84,7 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge, wxDC* DC ) /************************************************************************/ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) /************************************************************************/ -/* redessin du contour du Segment Edge lors des deplacements de la souris */ +/* Move and redraw the current edited graphic item when mouse is moving */ { BASE_SCREEN* screen = panel->GetScreen(); EDGE_MODULE* Edge = (EDGE_MODULE*) screen->GetCurItem(); @@ -115,7 +112,7 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) /************************************************************************/ -/* Affiche le segment Edge Module en cours de trace +/* Redraw the current edited (moved) graphic item */ { BASE_SCREEN* screen = panel->GetScreen(); @@ -149,8 +146,12 @@ static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC ) /***************************************************************************/ -/* change la largeur du EDGE_MODULE Edge, ou de tous si Edge == NULL - */ +/* Change the EDGE_MODULE Edge width, + * if Edge == NULL change the width of the entire footprint edges + * @param ModuleSegmentWidth (global) = new width + * @param Edge = edge to edit, or NULL + * @param DC = current Device Context +*/ { MODULE* Module = m_Pcb->m_Modules; @@ -180,17 +181,30 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Width( EDGE_MODULE* Edge, wxDC* DC ) void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC ) /***************************************************************************/ -/* change la couche du EDGE_MODULE Edge, ou de tous si Edge == NULL - */ +/* Change the EDGE_MODULE Edge layer, (The new layer will be asked) + * if Edge == NULL change the layer of the entire footprint edges + * @param Edge = edge to edit, or NULL + * @param DC = current Device Context +*/ { MODULE* Module = m_Pcb->m_Modules; int new_layer = SILKSCREEN_N_CMP; + if( Edge != NULL ) + new_layer = Edge->GetLayer(); - new_layer = SelectLayer( SILKSCREEN_N_CMP, LAYER_CUIVRE_N, LAST_NO_COPPER_LAYER ); + /* Ask for the new layer */ + new_layer = SelectLayer( new_layer, LAYER_CUIVRE_N, LAST_NO_COPPER_LAYER ); if( new_layer < 0 ) return; + if ( new_layer >= LAYER_CUIVRE_N && new_layer <= LAYER_CMP_N ) + /* an edge is put on a copper layer, and it is very dangerous. a confirmation is requested */ + { + if ( ! IsOK(this, _("The graphic item will be on a copper layer.It is very dangerous. Are you sure") ) ) + return; + } + SaveCopyInUndoList( Module ); if( Edge == NULL ) @@ -217,9 +231,12 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC ) void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC ) /*************************************************************************/ -/* - * Entre la nouvelle valeur pour ModuleSegmentWidth. - * change la largeur du EDGE_MODULE Edge si Edge != NULL +/* Edition of the edge items width + * Ask for a new width and init ModuleSegmentWidth. + * Change the width of EDGE_MODULE Edge if Edge != NULL + * @param Edge = edge to edit, or NULL + * @param DC = current Device Context + * @output ModuleSegmentWidth (global) = new width */ { wxString buffer; @@ -251,6 +268,11 @@ void WinEDA_ModuleEditFrame::Enter_Edge_Width( EDGE_MODULE* Edge, wxDC* DC ) /****************************************************************************/ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC ) /****************************************************************************/ +/* Edition of the edge items width + * delete EDGE_MODULE Edge if Edge != NULL + * @param Edge = edge to edit, or NULL + * @param DC = current Device Context + */ { if( Edge == NULL ) return; @@ -274,6 +296,8 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC ) /******************************************************************/ static void Exit_EditEdge_Module( WinEDA_DrawPanel* Panel, wxDC* DC ) /******************************************************************/ +/* abort function in moving edge. +*/ { EDGE_MODULE* Edge = (EDGE_MODULE*) Panel->GetScreen()->GetCurItem(); @@ -304,10 +328,11 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge, wxDC* DC, int type_edge ) /*************************************************************************/ -/* Fonction de debut de trace d'un nouveau contour. - * - Cree la place en memoire du nouveau contour - * - Prepare les coord des differents points - * - Met a jour la variable type_edge (= S_SEGMENT,S_ARC ...) +/* Create a new edge item (line, arc ..). + * @param Edge = if NULL: create new edge else terminate edge and create a new edge + * @param DC = current Device Context + * @param type_edge = S_SEGMENT,S_ARC .. + * @return the new created edge. */ { MODULE* Module = m_Pcb->m_Modules; @@ -316,13 +341,13 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge, if( Module == NULL ) return NULL; - if( Edge == NULL ) /* debut reel du trace */ + if( Edge == NULL ) /* Start a new edge item */ { SaveCopyInUndoList( Module ); Edge = new EDGE_MODULE( Module ); MoveVector.x = MoveVector.y = 0; - /* Chainage du nouvel element, en tete de liste Drawings */ + /* Add the new item to the Drawings list head*/ Edge->Pback = Module; Edge->Pnext = Module->m_Drawings; if( Module->m_Drawings ) @@ -341,12 +366,12 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge, Edge->SetLayer( SILKSCREEN_N_CMP ); if( Module->GetLayer() == CUIVRE_N ) Edge->SetLayer( SILKSCREEN_N_CU ); - /* Mise a jour du point de depart du segment ou de l'arc */ + /* Initialise the starting point of the new segment or arc */ Edge->m_Start = GetScreen()->m_Curseur; - /* Mise a jour de la fin du segment , rectangle ou de l'arc*/ + /* Initialise the ending point of the new segment or arc */ Edge->m_End = Edge->m_Start; - /* Mise a jour des coord relatives */ + /* Initialise the relative coordinates */ Edge->m_Start0.x = Edge->m_Start.x - Module->m_Pos.x; Edge->m_Start0.y = Edge->m_Start.y - Module->m_Pos.y; RotatePoint( (int*) &(Edge->m_Start0.x), @@ -399,10 +424,12 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge, /*************************************************************************/ void WinEDA_ModuleEditFrame::End_Edge_Module( EDGE_MODULE* Edge, wxDC* DC ) /*************************************************************************/ +/* Terminate a move or create edge function +*/ { MODULE* Module = m_Pcb->m_Modules; - /* test du dernier segment: si null: suppression */ + /* If last segment length is 0: deletion */ if( Edge ) { if( (Edge->m_Start.x == Edge->m_End.x) diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index f6113a2eba..18ee3f5322 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -51,7 +51,6 @@ #include "Width_Net.xpm" #include "Width_Track_Via.xpm" #include "Select_Layer_Pair.xpm" -#include "Footprint_Text.xpm" #include "Flag.xpm" diff --git a/pcbnew/sel_layer.cpp b/pcbnew/sel_layer.cpp index 1609246dd3..eca890d27d 100644 --- a/pcbnew/sel_layer.cpp +++ b/pcbnew/sel_layer.cpp @@ -56,14 +56,15 @@ EVT_RADIOBOX( ID_LAYER_SELECT, WinEDA_SelLayerFrame::Sel_Layer ) END_EVENT_TABLE() -/***********************************************************************************/ +/****************************************************************************************/ int WinEDA_BasePcbFrame::SelectLayer( int default_layer, int min_layer, int max_layer ) -/***********************************************************************************/ +/****************************************************************************************/ /* Install the dialog box for layer selection - * default_layer = Preselection - * min_layer = val min de layer selectionnable (-1 si pas de val mini) - * max_layer = val max de layer selectionnable (-1 si pas de val maxi) + * @param default_layer = Preselection + * @param min_layer = min layer value (-1 if no min value) + * @param max_layer = max layer value (-1 si no max value) + * @return new layer value, or <0 if aborted */ { int layer; @@ -92,7 +93,7 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent, m_Parent = parent; SetFont( *g_DialogFont ); - /* Construction de la liste des couches autoris�s */ + /* Build the layer list */ LayerCount = 0; int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount - 1]; Masque_Layer += ALL_NO_CU_LAYERS; diff --git a/todo.txt b/todo.txt index c075b8696c..9a20a455d7 100644 --- a/todo.txt +++ b/todo.txt @@ -2,13 +2,6 @@ Here are some source code maintenance tasks that need to be done, and maybe some folks will see these items and volunteer to do them. - -*** Look at gerbview/block.cpp for text: -// @todo: bug? memory leak at this point: about line 418 -this definitely looks like a memory leak. - -*** footprint_text_xpm is included more than once into the link image of pcbnew. - *** @todo: grep for @todo and finish off those tasks.