Commit d1effbf4 authored by CHARRAS's avatar CHARRAS
Browse files

EDA_BaseStruct.SetType() and EDA_BaseStruct.ReturnClassName() removed.

parent 2f3aeeaa
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
/* XPM */
static char * footprint_text_xpm[] = {
#ifndef XPMMAIN
extern char *footprint_text_xpm[];

#else
char * footprint_text_xpm[] = {
"16 16 4 1",
" 	c None",
".	c #009B9B",
@@ -21,3 +25,5 @@ static char * footprint_text_xpm[] = {
"     .....+     ",
"    ........    ",
"                "};
#endif
+11 −0
Original line number Diff line number Diff line
@@ -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 <jean-pierre.charras@inpg.fr>
================================================================================
+ 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 <gharlandau@yahoo.com.au>
================================================================================
+5 −76
Original line number Diff line number Diff line
@@ -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 */
+1 −1
Original line number Diff line number Diff line
@@ -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;
+15 −0
Original line number Diff line number Diff line
@@ -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 );
Loading