Commit 3f5478ee authored by jean-pierre charras's avatar jean-pierre charras
Browse files

fix 2 minor bugs: GERBVIEW: Button "Erase all layers" not working, EESCHEMA:...

fix 2 minor bugs: GERBVIEW: Button "Erase all layers" not working, EESCHEMA: Plot to Clipboard: EDA_DRAW_FRAME::PrintPage() error
parent 2694c524
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
#endif

#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-03-25)"
#define KICAD_BUILD_VERSION "(2011-03-28)"
#endif

// uncomment this line only when creating a stable version
+6 −6
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include "confirm.h"
#include "wxstruct.h"

static bool DrawPage( EDA_DRAW_FRAME* aFrame );
static bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame );


/* calls the function to copy the current page or the current bock to
@@ -23,7 +23,7 @@ static bool DrawPage( EDA_DRAW_FRAME* aFrame );
 */
void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
{
    DrawPage( this );
    DrawPageOnClipboard( this );

    if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
    {
@@ -39,7 +39,7 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
 * to export drawings to other applications (word processing ...)
 * This is not suitable for copy command within eeschema or pcbnew
 */
bool DrawPage( EDA_DRAW_FRAME* aFrame )
bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
{
    bool    success = TRUE;

@@ -49,7 +49,7 @@ bool DrawPage( EDA_DRAW_FRAME* aFrame )
    wxPoint old_org;
    wxPoint DrawOffset;
    int     ClipboardSizeX, ClipboardSizeY;
    bool    DrawBlock = FALSE;
    bool    DrawBlock = false;
    wxRect  DrawArea;
    BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen();

@@ -78,7 +78,7 @@ bool DrawPage( EDA_DRAW_FRAME* aFrame )

    EDA_Rect tmp = aFrame->DrawPanel->m_ClipBox;
    GRResetPenAndBrush( &dc );
    const bool plotBlackAndWhite = FALSE;
    const bool plotBlackAndWhite = false;
    GRForceBlackPen( plotBlackAndWhite );
    screen->m_IsPrinting = true;
    dc.SetUserScale( scale, scale );
@@ -107,7 +107,7 @@ bool DrawPage( EDA_DRAW_FRAME* aFrame )
    }


    GRForceBlackPen( FALSE );
    GRForceBlackPen( false );

    screen->m_StartVisu = tmp_startvisu;
    screen->m_DrawOrg   = old_org;
+0 −1
Original line number Diff line number Diff line
@@ -343,7 +343,6 @@ protected:

    /** Virtual function PrintPage
     * used to print a page
     * Print the page pointed by ActiveScreen, set by the calling print function
     * @param aDC = wxDC given by the calling print function
     * @param aPrintMask = not used here
     * @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
+16 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "gestfich.h"
#include "bitmaps.h"
@@ -62,7 +63,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
    EVT_MENU( ID_GEN_PLOT_SVG, SCH_EDIT_FRAME::SVG_Print )
    EVT_MENU( ID_GEN_PLOT_DXF, SCH_EDIT_FRAME::ToPlot_DXF )
    EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
    EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
    EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )

    EVT_MENU( ID_POPUP_SCH_COPY_ITEM, SCH_EDIT_FRAME::OnCopySchematicItemRequest )
@@ -717,6 +717,21 @@ void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
    frame.ShowModal();
}

/*
 * Function PrintPage (virtual)
 * Previously used to print a page,
 * but now only used to plot/print the current sheet to the clipboard
 * @param aDC = wxDC given by the calling print function
 * @param aPrintMask = not used here
 * @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
 * @param aData = a pointer on an auxiliary data (not used here)
 */
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask,
                                bool aPrintMirrorMode, void* aData)
{
    GetScreen()->Draw( DrawPanel, aDC, GR_DEFAULT_DRAWMODE );
    TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness );
}

void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
{
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
                         _( "Generate bill of materials and/or cross references" ) );

    m_HToolBar->AddTool( ID_BACKANNO_ITEMS, wxEmptyString, wxBitmap( backanno_xpm ),
                         _( "Back bnnotate component foot prints" ) );
                         _( "Back annotate component foot prints" ) );

    // after adding the tools to the toolbar, must call Realize() to reflect the changes
    m_HToolBar->Realize();
Loading