Commit e560573c authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Schematic object encapsulation and other minor improvements.

* Encapsulate file name member of base screen object.
* Encapsulate associated screen member of schematic sheet object.
* Create add screen method to schematic sheet object to simplify setting
  the associated screen.
* Move the change file name code in the schematic sheet object to the edit
  sheet method in the schematic editor frame object to eliminate message
  dialogs.
* Improve reference counting in schematic screen object.
* Add helper type definitions for changing schematic object storage to C++
  containers.
parent fbeb4116
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ void Pcb3D_GLCanvas::SetLights()
 */
void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
{
    wxFileName fn( m_Parent->m_Parent->GetScreen()->m_FileName );
    wxFileName fn( m_Parent->m_Parent->GetScreen()->GetFileName() );
    wxString   FullFileName;
    wxString   file_ext, mask;
    bool       fmt_is_jpeg = FALSE;
@@ -613,7 +613,7 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
    {
        file_ext     = fmt_is_jpeg ? wxT( "jpg" ) : wxT( "png" );
        mask         = wxT( "*." ) + file_ext;
        FullFileName = m_Parent->m_Parent->GetScreen()->m_FileName;
        FullFileName = m_Parent->m_Parent->GetScreen()->GetFileName();
        fn.SetExt( file_ext );

        FullFileName =
+1 −1
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ void WinEDA_DrawFrame::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
        case WS_FILENAME:
        {
            wxString fname, fext;
            wxFileName::SplitPath( screen->m_FileName,
            wxFileName::SplitPath( screen->GetFileName(),
                                   (wxString*) NULL,
                                   &fname,
                                   &fext );
+3 −2
Original line number Diff line number Diff line
@@ -1389,10 +1389,11 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen,
        case WS_FILENAME:
        {
            wxString fname, fext;
            wxFileName::SplitPath( screen->m_FileName, (wxString*) NULL,
                                   &fname, &fext );
            wxFileName::SplitPath( screen->GetFileName(), (wxString*) NULL, &fname, &fext );

            if( WsItem->m_Legende )
                msg = WsItem->m_Legende;

            msg << fname << wxT( "." ) << fext;
            DrawGraphicText( DrawPanel, DC, pos, Color,
                             msg, TEXT_ORIENT_HORIZ, size,
+5 −5
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
        return;
    }

    if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion )
    if( FirstSheet->GetScreen()->IsModify() && confirm_deletion )
    {
        msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ),
                    FirstSheet->m_SheetName.GetData(),
@@ -44,14 +44,14 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )

        if( IsOK( NULL, msg ) )
        {
            frame->SaveEEFile( FirstSheet->m_AssociatedScreen, FILE_SAVE_AS );
            frame->SaveEEFile( FirstSheet->GetScreen(), FILE_SAVE_AS );
        }
    }

    /* free the sub hierarchy */
    if( FirstSheet->m_AssociatedScreen )
    if( FirstSheet->GetScreen() )
    {
        EEDrawList = FirstSheet->m_AssociatedScreen->GetDrawItems();
        EEDrawList = FirstSheet->GetScreen()->GetDrawItems();

        while( EEDrawList != NULL )
        {
@@ -64,7 +64,7 @@ void DeleteSubHierarchy( SCH_SHEET* FirstSheet, bool confirm_deletion )
            }
        }

        FirstSheet->m_AssociatedScreen->FreeDrawList();
        FirstSheet->GetScreen()->FreeDrawList();
    }
}

+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
        fn = m_FileNameCtrl->GetValue();

        if( !fn.IsOk() )
            fn = screen->m_FileName;
            fn = screen->GetFileName();

        fn.SetExt( wxT( "svg" ) );
        fn.MakeAbsolute();
Loading