Commit 0ac832f0 authored by charras's avatar charras
Browse files

screen number and screen count now are set

parent 39125547
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ email address.
================================================================================
+eeschema:
    made in some dialogs the ESC key working (linux version, already working under windows)
    screen number and screen count now are set


2008-Apr-29 UPDATE Dick Hollenbeck <dick@softplc.com>
+8 −30
Original line number Diff line number Diff line
@@ -22,45 +22,23 @@ static int ExistUnit( CmpListStruct* Objet, int Unit,
                       CmpListStruct* BaseListeCmp, int NbOfCmp );


/************************************************/
/******************************************************/
void WinEDA_SchematicFrame::UpdateSheetNumberAndDate()
/************************************************/
/******************************************************/

/* Set a sheet number, the sheet count for sheets in the whole schematic
 * and update the date in all screens
 */
{
    wxString       date = GenDate();
    int            sheet_number = 1; // sheet 1 is the root sheet
    DrawSheetPath* sheetpath;
    EDA_ScreenList s_list;

    /* Build the sheet list */
    EDA_SheetList  SheetList( g_RootSheet );
    int            sheet_count = SheetList.GetCount();

    for( sheetpath = SheetList.GetFirst();
        sheetpath != NULL;
        sheetpath = SheetList.GetNext() )
    {
        // Read all sheets in path, but not the root sheet (jj = 1)
        for( int jj = 1; jj < sheetpath->m_numSheets; jj++ )
        {
            DrawSheetStruct* sheet = sheetpath->m_sheets[jj];
            sheet->m_SheetNumber    = sheet_number++;
            sheet->m_NumberOfSheets = sheet_count;
            SCH_SCREEN*      screen = sheet->m_AssociatedScreen;
            if( screen != NULL )
            {
                screen->m_NumberOfScreen = sheet_count;
    // Set the date
    for ( SCH_SCREEN * screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() )
        screen->m_Date = date;
            }
        }
    }

    g_RootSheet->m_AssociatedScreen->m_Date = date;
    g_RootSheet->m_AssociatedScreen->m_NumberOfScreen = sheet_count;
    g_RootSheet->m_SheetNumber    = 1;
    g_RootSheet->m_NumberOfSheets = sheet_count;
    // Set sheet counts
    SetSheetNumberAndCount();
}


+3 −5
Original line number Diff line number Diff line
@@ -47,8 +47,6 @@ DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) :
    m_AssociatedScreen = NULL;
    m_SheetName.Printf( wxT( "Sheet%8.8lX" ), m_TimeStamp );
    m_FileName.Printf( wxT( "file%8.8lX.sch" ), m_TimeStamp );
    m_SheetNumber    = 1;
    m_NumberOfSheets = 1;
}


@@ -499,9 +497,9 @@ bool DrawSheetStruct::Load( WinEDA_SchematicFrame* frame )
}


/*******************************************************************************/
/**********************************/
int DrawSheetStruct::CountSheets()
/*******************************************************************************/
/**********************************/
{
    int count = 1; //1 = this!!

+49 −48
Original line number Diff line number Diff line
@@ -53,8 +53,10 @@ public:
    bool                           Save( FILE* aFile ) const;

#if defined (DEBUG)

    // comment inherited by Doxygen from Base_Struct
    void                           Show( int nestLevel, std::ostream& os );

#endif
};

@@ -64,7 +66,7 @@ public:
 */
WX_DEFINE_ARRAY( DrawSheetStruct *, SheetGrowArray );

class DrawSheetStruct : public SCH_ITEM /*public SCH_SCREEN*/    /* Gestion de la hierarchie */
class DrawSheetStruct : public SCH_ITEM    /* Gestion de la hierarchie */
{
public:
    wxString m_SheetName;               /*this is equivalent to C101 for components:
@@ -75,7 +77,6 @@ private:
                                         * reading the sheet description from file. */
public:
    int         m_SheetNameSize;                        /* Size (height) of the text, used to draw the name */

    int         m_FileNameSize;                         /* Size (height) of the text, used to draw the name */
    wxPoint     m_Pos;
    wxSize      m_Size;                                 /* Position and Size of sheet symbol */
@@ -85,8 +86,6 @@ public:
    SCH_SCREEN* m_AssociatedScreen;             /* Associated Screen which handle the physical data
                                                 * In complex hierarchies we can have many DrawSheetStruct using the same data
                                                 */
    int         m_SheetNumber;                          // sheet number (used for info)
    int         m_NumberOfSheets;                       // Sheets count in the whole schematic (used for info)

public:
    DrawSheetStruct( const wxPoint& pos = wxPoint( 0, 0 ) );
@@ -127,8 +126,10 @@ public:
    //-- the destructor should take care of everything else.

#if defined (DEBUG)

    // comment inherited by Doxygen from Base_Struct
    void Show( int nestLevel, std::ostream& os );

#endif
};

+0 −2
Original line number Diff line number Diff line
@@ -91,8 +91,6 @@ SCH_SCREEN::SCH_SCREEN( int screentype, KICAD_T aType ) :
    SetGridList( g_GridList );
    m_UndoRedoCountMax = 10;
    m_RefCount       = 0;
    m_ScreenNumber   = 1;
    m_NumberOfScreen = 1;
}


Loading