From 3f5478eead2f00d5c5e614c7c6a65154e86c2cfe Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 28 Mar 2011 21:26:31 +0200 Subject: [PATCH] fix 2 minor bugs: GERBVIEW: Button "Erase all layers" not working, EESCHEMA: Plot to Clipboard: EDA_DRAW_FRAME::PrintPage() error --- common/build_version.cpp | 2 +- common/copy_to_clipboard.cpp | 12 ++++++------ eeschema/libeditframe.h | 1 - eeschema/schframe.cpp | 17 ++++++++++++++++- eeschema/tool_sch.cpp | 2 +- gerbview/toolbars_gerber.cpp | 2 +- include/wxEeschemaStruct.h | 12 +++++++++++- packaging/windows/nsis/install.nsi | 2 +- version.txt | 2 +- 9 files changed, 38 insertions(+), 14 deletions(-) diff --git a/common/build_version.cpp b/common/build_version.cpp index 55098504a6..4788eec95c 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -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 diff --git a/common/copy_to_clipboard.cpp b/common/copy_to_clipboard.cpp index 58342d53cb..718e1fa54e 100644 --- a/common/copy_to_clipboard.cpp +++ b/common/copy_to_clipboard.cpp @@ -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; diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index d112cd2e60..ca797f99ed 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -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) diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 1366df6b90..ffe255d479 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -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 ) { diff --git a/eeschema/tool_sch.cpp b/eeschema/tool_sch.cpp index 9d67ebd350..51041cc1d5 100644 --- a/eeschema/tool_sch.cpp +++ b/eeschema/tool_sch.cpp @@ -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(); diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 903b1fe10d..329e239b83 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -34,7 +34,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); // 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" ) ); m_HToolBar->AddTool( wxID_FILE, wxEmptyString, wxBitmap( gerber_file_xpm ), diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index 70a54ab0eb..6d090bef79 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -17,7 +17,6 @@ class LIB_EDIT_FRAME; class LIB_VIEW_FRAME; class DRAWSEGMENT; -class DrawPickedStruct; class SCH_ITEM; class SCH_NO_CONNECT; class CMP_LIBRARY; @@ -743,6 +742,17 @@ public: 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() }; diff --git a/packaging/windows/nsis/install.nsi b/packaging/windows/nsis/install.nsi index c9e3d26a66..c1ab359167 100644 --- a/packaging/windows/nsis/install.nsi +++ b/packaging/windows/nsis/install.nsi @@ -17,7 +17,7 @@ ; General Product Description Definitions !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 SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define COMPANY_NAME "" diff --git a/version.txt b/version.txt index d5efc6ebfc..2cac3a21c6 100644 --- a/version.txt +++ b/version.txt @@ -1,4 +1,4 @@ release version: 2011 mar 17 files (.zip,.tgz): -kicad-2011-03-25 +kicad-2011-03-28