fix 2 minor bugs: GERBVIEW: Button "Erase all layers" not working, EESCHEMA: Plot to Clipboard: EDA_DRAW_FRAME::PrintPage() error

This commit is contained in:
jean-pierre charras 2011-03-28 21:26:31 +02:00
parent 2694c524b4
commit 3f5478eead
9 changed files with 38 additions and 14 deletions

View File

@ -6,7 +6,7 @@
#endif #endif
#ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-03-25)" #define KICAD_BUILD_VERSION "(2011-03-28)"
#endif #endif
// uncomment this line only when creating a stable version // uncomment this line only when creating a stable version

View File

@ -15,7 +15,7 @@
#include "confirm.h" #include "confirm.h"
#include "wxstruct.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 /* 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 ) void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )
{ {
DrawPage( this ); DrawPageOnClipboard( this );
if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD ) 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 ...) * to export drawings to other applications (word processing ...)
* This is not suitable for copy command within eeschema or pcbnew * 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; bool success = TRUE;
@ -49,7 +49,7 @@ bool DrawPage( EDA_DRAW_FRAME* aFrame )
wxPoint old_org; wxPoint old_org;
wxPoint DrawOffset; wxPoint DrawOffset;
int ClipboardSizeX, ClipboardSizeY; int ClipboardSizeX, ClipboardSizeY;
bool DrawBlock = FALSE; bool DrawBlock = false;
wxRect DrawArea; wxRect DrawArea;
BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen(); BASE_SCREEN* screen = aFrame->DrawPanel->GetScreen();
@ -78,7 +78,7 @@ bool DrawPage( EDA_DRAW_FRAME* aFrame )
EDA_Rect tmp = aFrame->DrawPanel->m_ClipBox; EDA_Rect tmp = aFrame->DrawPanel->m_ClipBox;
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
const bool plotBlackAndWhite = FALSE; const bool plotBlackAndWhite = false;
GRForceBlackPen( plotBlackAndWhite ); GRForceBlackPen( plotBlackAndWhite );
screen->m_IsPrinting = true; screen->m_IsPrinting = true;
dc.SetUserScale( scale, scale ); 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_StartVisu = tmp_startvisu;
screen->m_DrawOrg = old_org; screen->m_DrawOrg = old_org;

View File

@ -343,7 +343,6 @@ protected:
/** Virtual function PrintPage /** Virtual function PrintPage
* used to print a page * 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 aDC = wxDC given by the calling print function
* @param aPrintMask = not used here * @param aPrintMask = not used here
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode) * @param aPrintMirrorMode = not used here (Set when printing in mirror mode)

View File

@ -9,6 +9,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "gr_basic.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "gestfich.h" #include "gestfich.h"
#include "bitmaps.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_SVG, SCH_EDIT_FRAME::SVG_Print )
EVT_MENU( ID_GEN_PLOT_DXF, SCH_EDIT_FRAME::ToPlot_DXF ) 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_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( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
EVT_MENU( ID_POPUP_SCH_COPY_ITEM, SCH_EDIT_FRAME::OnCopySchematicItemRequest ) 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(); 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 ) void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
{ {

View File

@ -112,7 +112,7 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
_( "Generate bill of materials and/or cross references" ) ); _( "Generate bill of materials and/or cross references" ) );
m_HToolBar->AddTool( ID_BACKANNO_ITEMS, wxEmptyString, wxBitmap( backanno_xpm ), 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 // after adding the tools to the toolbar, must call Realize() to reflect the changes
m_HToolBar->Realize(); m_HToolBar->Realize();

View File

@ -34,7 +34,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, wxBitmap( gerbview_clear_layers_xpm ), m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString, wxBitmap( gerbview_clear_layers_xpm ),
_( "Erase all layers" ) ); _( "Erase all layers" ) );
m_HToolBar->AddTool( wxID_FILE, wxEmptyString, wxBitmap( gerber_file_xpm ), m_HToolBar->AddTool( wxID_FILE, wxEmptyString, wxBitmap( gerber_file_xpm ),

View File

@ -17,7 +17,6 @@
class LIB_EDIT_FRAME; class LIB_EDIT_FRAME;
class LIB_VIEW_FRAME; class LIB_VIEW_FRAME;
class DRAWSEGMENT; class DRAWSEGMENT;
class DrawPickedStruct;
class SCH_ITEM; class SCH_ITEM;
class SCH_NO_CONNECT; class SCH_NO_CONNECT;
class CMP_LIBRARY; class CMP_LIBRARY;
@ -743,6 +742,17 @@ public:
void LoadLibraries( void ); void LoadLibraries( void );
/** Virtual function PrintPage
* 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 always used, NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, int aPrintMask,
bool aPrintMirrorMode, void* aData = NULL );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@ -17,7 +17,7 @@
; General Product Description Definitions ; General Product Description Definitions
!define PRODUCT_NAME "KiCad" !define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.03.25" !define PRODUCT_VERSION "2011.03.28"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME "" !define COMPANY_NAME ""

View File

@ -1,4 +1,4 @@
release version: release version:
2011 mar 17 2011 mar 17
files (.zip,.tgz): files (.zip,.tgz):
kicad-2011-03-25 kicad-2011-03-28