diff --git a/bitmap2component/bitmap2cmp_gui_base.fbp b/bitmap2component/bitmap2cmp_gui_base.fbp index aac71051ff..138d9b12f6 100644 --- a/bitmap2component/bitmap2cmp_gui_base.fbp +++ b/bitmap2component/bitmap2cmp_gui_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 source_name @@ -14,73 +14,73 @@ none 1 bitmap2cmp_gui - + . - + 1 1 0 0 - - - + + + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + BM2CMP_FRAME_BASE - + 500,419 wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER - + Bitmap to Component Converter - - + + wxFILTER_NONE wxDefaultValidator - - - + + + wxTAB_TRAVERSAL 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + bMainSizer wxHORIZONTAL none @@ -89,219 +89,219 @@ wxEXPAND 1 - - - + + + 1 1 - - + + 0 wxID_ANY - - + + m_notebook1 protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Original Picture 1 - - + + 1 1 - - + + 0 wxID_ANY -1,-1 400,300 m_InitialPicturePanel protected - + 5 5 - - - - + + + + wxFILTER_NONE wxDefaultValidator - - - + + + wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + OnPaint - - - - - - + + + + + + - + Greyscale Picture 0 - - + + 1 1 - - + + 0 wxID_ANY -1,-1 400,300 m_GreyscalePicturePanel protected - + 5 5 - - - - + + + + wxFILTER_NONE wxDefaultValidator - - - + + + wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + OnPaint - - - - - - + + + + + + - + Black&&White Picture 0 - - + + 1 1 - - + + 0 wxID_ANY - - + + m_BNPicturePanel protected - + 5 5 - - - - + + + + wxFILTER_NONE wxDefaultValidator - - - + + + wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + OnPaint - - - - - - + + + + + + @@ -311,54 +311,54 @@ wxEXPAND 0 - - + + 1 1 - - + + 0 wxID_ANY - - + + m_panelRight protected - - - - - + + + + + wxFILTER_NONE wxDefaultValidator - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + brightSizer wxVERTICAL none @@ -369,11 +369,11 @@ wxID_ANY Bitmap Info: - + sbSizerInfo wxVERTICAL none - + 5 wxEXPAND|wxBOTTOM @@ -381,10 +381,10 @@ 3 wxBOTH - - + + 0 - + fgSizerInfo wxFLEX_GROWMODE_SPECIFIED none @@ -395,55 +395,55 @@ wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY Size X: - - + + m_staticTextSizeX protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -451,55 +451,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY 0000 - - + + m_SizeXValue protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -507,55 +507,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY pixels - - + + m_SizeXunits protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -563,55 +563,55 @@ wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY Size Y: - - + + m_staticTextSizeY protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -619,55 +619,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY 0000 - - + + m_SizeYValue protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -675,55 +675,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY pixels - - + + m_SizeYunits protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -731,55 +731,55 @@ wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY BPP: - - + + m_staticTextBPP protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -787,55 +787,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY 0000 - - + + m_BPPValue protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -843,55 +843,55 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY bits - - + + m_BPPunits protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -903,56 +903,56 @@ wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL 0 - - + + 1 0 1 - - + + 0 wxID_ANY Load Bitmap - - + + m_buttonLoad protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnLoadFile - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -960,56 +960,56 @@ wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL 0 - - + + 1 0 1 - - + + 0 wxID_ANY Export to Eeschema - - + + m_buttonExportEeschema protected - - - - + + + + Create a library file for Eeschema This library contains only one component: logo - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnExportEeschema - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1017,56 +1017,56 @@ wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL 0 - - + + 1 0 1 - - + + 0 wxID_ANY Export to Pcbnew - - + + m_buttonExportPcbnew protected - - - - + + + + Create a footprint file for PcbNew This footprint contains only one footprint: logo - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnExportPcbnew - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1074,58 +1074,58 @@ wxALL|wxEXPAND 0 - + "Normal" "Negative" - + 1 1 - - + + 0 wxID_ANY Options 1 - - + + m_rbOptions protected - + 0 - + wxRA_SPECIFY_COLS - - - + + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + OnOptionsSelection - - - - - - + + + + + + @@ -1133,55 +1133,55 @@ wxTOP|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY Threshold Value: - - + + m_ThresholdText protected - - - - - - + + + + + + wxFILTER_NONE wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1189,76 +1189,76 @@ wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 1 - - + + 0 wxID_ANY 50 - + 0 - + m_sliderThreshold protected - - + + wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_TOP - + Adjust the level to convert the greyscale picture to a black and white picture. - + wxFILTER_NONE wxDefaultValidator - + 25 - - - - - - - - - - - - + + + + + + + + + + + + OnThresholdChange - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1266,54 +1266,54 @@ - - + + 1 1 - + 1 - + 0 wxID_ANY - - + + m_statusBar protected - - + + wxST_SIZEGRIP - - - + + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 36697e380f..a322e734d0 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -310,7 +309,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type, if( !wxFileName::FileExists( fn ) ) { msg = type + _( " file <" ) + fn + _( "> was not found." ); - DisplayError( this, msg ); + wxMessageBox( msg ); fileHistory->RemoveFileFromHistory( i ); fn = wxEmptyString; } @@ -349,7 +348,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event ) { msg.Printf( _( "Help file %s could not be found." ), GetChars( wxGetApp().GetHelpFileName() ) ); - DisplayError( this, msg ); + wxMessageBox( msg ); } else { @@ -376,7 +375,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event ) else { msg.Printf( _( "Help file %s not found." ), GetChars( wxGetApp().GetHelpFileName() ) ); - DisplayError( this, msg ); + wxMessageBox( msg ); } #elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF @@ -386,7 +385,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event ) { msg.Printf( _( "Help file %s could not be found." ), GetChars( wxGetApp().GetHelpFileName() ) ); - DisplayError( this, msg ); + wxMessageBox( msg ); } else { @@ -589,7 +588,7 @@ bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName ) if( !msg.IsEmpty() ) { - DisplayError( this, msg ); + wxMessageBox( msg ); return false; } @@ -643,7 +642,7 @@ edits you made?" ), if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) ) { msg = _( "Could not create backup file " ) + backupFileName.GetFullPath(); - DisplayError( this, msg ); + wxMessageBox( msg ); } } diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 19cced24a8..aec5809bf7 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -1,4 +1,5 @@ -install(DIRECTORY complex_hierarchy ecc83 electric flat_hierarchy interf_u microwave +install(DIRECTORY complex_hierarchy ecc83 electric flat_hierarchy + kit-dev-coldfire-xilinx_5213 interf_u microwave pic_programmer pspice "sonde xilinx" test_xil_95108 video DESTINATION ${KICAD_DEMOS} COMPONENT resources diff --git a/eeschema/dialogs/dialog_SVG_print.cpp b/eeschema/dialogs/dialog_SVG_print.cpp index fee1553ca8..5d90897ae4 100644 --- a/eeschema/dialogs/dialog_SVG_print.cpp +++ b/eeschema/dialogs/dialog_SVG_print.cpp @@ -228,7 +228,13 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) ); screen->m_IsPrinting = true; - screen->Draw( panel, &dc, GR_COPY ); + if( frame->IsType( SCHEMATIC_FRAME ) ) + screen->Draw( panel, &dc, GR_COPY ); + + if( frame->IsType( LIBEDITOR_FRAME ) ) + ((LIB_EDIT_FRAME*)frame)->RedrawComponent( &dc, + wxPoint(sheetSize.x/2, + sheetSize.y/2) ); if( aPrint_Sheet_Ref ) frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness ); diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index e21f9c0778..d5595602cf 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -250,13 +250,8 @@ bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, CMP_LIBRARY* aLib } -void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) +void LIB_EDIT_FRAME::RedrawComponent( wxDC* aDC, wxPoint aOffset ) { - if( GetScreen() == NULL ) - return; - - m_canvas->DrawBackGround( DC ); - if( m_component ) { // display reference like in schematic (a reference U is shown U? or U?A) @@ -266,10 +261,20 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) wxString fieldText = Field->m_Text; wxString fieldfullText = Field->GetFullText( m_unit ); Field->m_Text = fieldfullText; - m_component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, + m_component->Draw( m_canvas, aDC, aOffset, m_unit, m_convert, GR_DEFAULT_DRAWMODE ); Field->m_Text = fieldText; } +} + +void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) +{ + if( GetScreen() == NULL ) + return; + + m_canvas->DrawBackGround( DC ); + + RedrawComponent( DC, wxPoint( 0, 0 ) ); if( m_canvas->IsMouseCaptured() ) m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); diff --git a/eeschema/libedit_plot_component.cpp b/eeschema/libedit_plot_component.cpp index 9fbac84439..41974bfc96 100644 --- a/eeschema/libedit_plot_component.cpp +++ b/eeschema/libedit_plot_component.cpp @@ -15,6 +15,7 @@ #include #include #include +#include void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event ) @@ -128,6 +129,11 @@ void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_j } +void LIB_EDIT_FRAME::SVG_Print_Component( const wxString& FullFileName ) +{ + DIALOG_SVG_PRINT::DrawSVGPage( this, FullFileName, GetScreen() ); +} + void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData) { if( ! m_component ) diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index c0b4d2c69d..1a6e875ea8 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -47,7 +47,6 @@ #include #include -#include #include #include @@ -926,11 +925,6 @@ void LIB_EDIT_FRAME::ClearTempCopyComponent() } -void LIB_EDIT_FRAME::SVG_Print_Component( const wxString& FullFileName ) -{ - DIALOG_SVG_PRINT::DrawSVGPage( this, FullFileName, GetScreen() ); -} - void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem ) { diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index 3841c47e01..41d5c37f5c 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -247,7 +247,26 @@ public: */ void DisplayLibInfos(); + /** + * Function RedrawComponent + * Redraw the current component loaded in library editor + * Display reference like in schematic (a reference U is shown U? or U?A) + * accordint to the current selected unit and De Morgan selection + * although it is stored without ? and part id. + * @param aDC = the current device context + * @param aOffset = a draw offset. usually à,0 to draw on the screen, but + * can be set to page size / 2 to draw or print in SVG format. + */ + void RedrawComponent( wxDC* aDC, wxPoint aOffset ); + + /** + * Function RedrawActiveWindow + * Redraw the current component loaded in library editor, an axes + * Display reference like in schematic (a reference U is shown U? or U?A) + * update status bar and info shown in the bottom of the window + */ void RedrawActiveWindow( wxDC* DC, bool EraseBg ); + void OnCloseWindow( wxCloseEvent& Event ); void ReCreateHToolbar(); void ReCreateVToolbar(); diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 3747e97718..abbf723742 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -530,7 +530,9 @@ bool SCH_SCREEN::Save( FILE* aFile ) const return true; } - +// note: SCH_SCREEN::Draw is useful only for schematic. +// library editor and library viewer do not use a draw list, and therefore +// SCH_SCREEN::Draw draws nothing void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aColor ) { for( SCH_ITEM* item = m_drawList.begin(); item != NULL; item = item->Next() ) diff --git a/pcbnew/dialogs/dialog_mask_clearance.cpp b/pcbnew/dialogs/dialog_mask_clearance.cpp index 32c1c3ff76..126fbe79f1 100644 --- a/pcbnew/dialogs/dialog_mask_clearance.cpp +++ b/pcbnew/dialogs/dialog_mask_clearance.cpp @@ -1,13 +1,30 @@ -// /////////////////////////////////////////////////////////////////////////// -// Name: dialog_mask_clearance.cpp -// Author: jean-pierre Charras -// Modified by: -// Created: 17 feb 2009 -// Licence: GPL -// /////////////////////////////////////////////////////////////////////////// +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ +/** + * @file dialog_mask_clearance.cpp + */ #include -#include #include #include #include diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 84a18f2d03..3face0a320 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -155,6 +155,10 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); frame->Zoom_Automatique( true ); + // Load config and default values before loading a board file + // Some will be overwritten after loading the board file + frame->LoadProjectSettings( fn.GetFullPath() ); + /* Load file specified in the command line. */ if( fn.IsOk() ) { @@ -180,8 +184,6 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); } } - frame->LoadProjectSettings( fn.GetFullPath() ); - // update the layer names in the listbox frame->ReCreateLayerBox( NULL );