diff --git a/common/page_layout/class_worksheet_dataitem.cpp b/common/page_layout/class_worksheet_dataitem.cpp index 66683d191a..6032f39ef3 100644 --- a/common/page_layout/class_worksheet_dataitem.cpp +++ b/common/page_layout/class_worksheet_dataitem.cpp @@ -249,7 +249,7 @@ const wxPoint WORKSHEET_DATAITEM::GetStartPosUi( int ii ) const { DPOINT pos = GetStartPos( ii ); pos = pos * m_WSunits2Iu; - return wxPoint( int(pos.x), int(pos.y) ); + return wxPoint( KiROUND(pos.x), KiROUND(pos.y) ); } const DPOINT WORKSHEET_DATAITEM::GetEndPos( int ii ) const @@ -285,7 +285,7 @@ const wxPoint WORKSHEET_DATAITEM::GetEndPosUi( int ii ) const { DPOINT pos = GetEndPos( ii ); pos = pos * m_WSunits2Iu; - return wxPoint( int(pos.x), int(pos.y) ); + return wxPoint( KiROUND(pos.x), KiROUND(pos.y) ); } diff --git a/gerbview/files.cpp b/gerbview/files.cpp index a4e22938aa..6d219cd131 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -5,7 +5,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or @@ -184,8 +184,8 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName ) if( layer == NO_AVAILABLE_LAYERS ) { - wxString msg = wxT( "No more empty layers are available. The remaining gerber " ); - msg += wxT( "files will not be loaded." ); + wxString msg = wxT( "No more empty available layers.\n" + "The remaining gerber files will not be loaded." ); wxMessageBox( msg ); break; } @@ -266,8 +266,8 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName ) if( layer == NO_AVAILABLE_LAYERS ) { - wxString msg = wxT( "No more empty layers are available. The remaining gerber " ); - msg += wxT( "files will not be loaded." ); + wxString msg = wxT( "No more empty available layers.\n" + "The remaining gerber files will not be loaded." ); wxMessageBox( msg ); break; } diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index 0423cd6b72..fbdc0288bc 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -84,13 +84,6 @@ static struct IFACE : public KIFACE_I case FRAME_GERBER: { GERBVIEW_FRAME* frame = new GERBVIEW_FRAME( aKiway, aParent ); - - /* Is this really needed since at this point there is no open file? - frame->Zoom_Automatique( true ); // Zoom fit in frame - - if so, why is the constructor not doing it? - */ - return frame; } break; diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index b6d6d412e4..0674be6c1e 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -166,6 +166,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): ReFillLayerWidget(); // this is near end because contents establish size m_LayersManager->ReFillRender(); // Update colors in Render after the config is read m_auimgr.Update(); + + Zoom_Automatique( true ); // Gives a default zoom value } diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 0d965c0af8..942f0fe975 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -305,18 +305,12 @@ void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::OnRunGerbview( wxCommandEvent& event ) { - wxFileName fn( m_ProjectFileName ); - - wxString path = wxT( "\"" ); - - path += fn.GetPath( wxPATH_GET_SEPARATOR | wxPATH_GET_VOLUME ) + wxT( "\"" ); - + // Gerbview is called without any file to open, because we do not know + // the list and the name of files to open (if any...). #if USE_KIFACE && 0 - // I cannot make sense of the fn. - #else - Execute( this, GERBVIEW_EXE, path ); + Execute( this, GERBVIEW_EXE, wxEmptyString ); #endif } diff --git a/pagelayout_editor/events_functions.cpp b/pagelayout_editor/events_functions.cpp index c2fd6982dc..0bec641c0e 100644 --- a/pagelayout_editor/events_functions.cpp +++ b/pagelayout_editor/events_functions.cpp @@ -331,16 +331,29 @@ static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositio wxCHECK_RET( (item != NULL), wxT( "Cannot move NULL item." ) ); wxPoint position = aPanel->GetParent()->GetCrossHairPosition() - ( initialCursorPosition - initialPositionUi ); + wxPoint previous_position; if( (item->GetFlags() & LOCATE_STARTPOINT) ) + { + previous_position = item->GetStartPosUi(); item->MoveStartPointToUi( position ); + } else if( (item->GetFlags() & LOCATE_ENDPOINT) ) + { + previous_position = item->GetEndPosUi(); item->MoveEndPointToUi( position ); + } else + { + previous_position = item->GetStartPosUi(); item->MoveToUi( position ); + } - // Draw the item item at it's new position. - if( aPanel ) + // Draw the item item at it's new position, if it is modified, + // (does not happen each time the mouse is moved, because the + // item is placed on grid) + // to avoid useless computation time. + if( aPanel && ( previous_position != position ) ) aPanel->Refresh(); } diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 4c9f615ed7..6e66dff99f 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -187,7 +187,6 @@ void DIALOG_PLOT::Init_Dialog() // Options to plot texts on footprints m_plotModuleValueOpt->SetValue( m_plotOpts.GetPlotValue() ); m_plotModuleRefOpt->SetValue( m_plotOpts.GetPlotReference() ); - m_plotTextOther->SetValue( m_plotOpts.GetPlotOtherText() ); m_plotInvisibleText->SetValue( m_plotOpts.GetPlotInvisibleText() ); // Options to plot pads and vias holes @@ -480,7 +479,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) case PLOT_FORMAT_DXF: m_drillShapeOpt->Enable( true ); - m_plotModeOpt->Enable( true ); + m_plotModeOpt->Enable( false ); m_plotMirrorOpt->Enable( false ); m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); @@ -502,7 +501,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_forcePSA4OutputOpt->Enable( false ); m_forcePSA4OutputOpt->SetValue( false ); - m_PlotOptionsSizer->Show( m_GerberOptionsSizer ); + m_PlotOptionsSizer->Hide( m_GerberOptionsSizer ); m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer ); m_PlotOptionsSizer->Hide( m_PSOptionsSizer ); break; @@ -570,7 +569,6 @@ void DIALOG_PLOT::applyPlotSettings() tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() ); tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() ); tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() ); - tempOptions.SetPlotOtherText( m_plotTextOther->GetValue() ); tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() ); tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() ); tempOptions.SetDrillMarksType( static_cast diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index 7d1e54bec4..4b7b5695d4 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Nov 6 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -94,7 +94,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_plotPads_on_Silkscreen = new wxCheckBox( this, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Plot pads on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotPads_on_Silkscreen->SetToolTip( _("Enable/disable print/plot pads on silkscreen layers\nWhen disable, pads are never potted on silkscreen layers\nWhen enable, pads are potted only if they appear on silkscreen layers") ); - bSizerPlotItems->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + bSizerPlotItems->Add( m_plotPads_on_Silkscreen, 0, wxALL, 2 ); m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); @@ -102,20 +102,15 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - m_plotTextOther = new wxCheckBox( this, wxID_ANY, _("Plot other module texts on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotTextOther->SetToolTip( _("Enable/disable print/plot module field texts on silkscreen layers") ); - - bSizerPlotItems->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - - m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Plot invisible texts on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") ); + m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plot invisible values/refrences"), wxDefaultPosition, wxDefaultSize, 0 ); + m_plotInvisibleText->SetToolTip( _("Force plot invisible values and/or references") ); bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 ); m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias.") ); - bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 2 ); + bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 ); m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") ); @@ -123,11 +118,16 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr bSizerPlotItems->Add( m_excludeEdgeLayerOpt, 0, wxALL, 2 ); m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxALL, 2 ); + bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerPlotItems->Add( m_plotPSNegativeOpt, 0, wxALL, 2 ); + m_useAuxOriginCheckBox = new wxCheckBox( this, wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in Gerber files.") ); + + bSizerPlotItems->Add( m_useAuxOriginCheckBox, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 ); @@ -231,11 +231,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_GerberOptionsSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); - m_useAuxOriginCheckBox = new wxCheckBox( this, wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in Gerber files.") ); - - m_GerberOptionsSizer->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 ); - m_PlotOptionsSizer->Add( m_GerberOptionsSizer, 0, wxALL|wxEXPAND, 3 ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 2137a6813a..b9e5800cc9 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 1 0 @@ -818,7 +820,7 @@ 2 - wxTOP|wxRIGHT|wxLEFT + wxALL 0 1 @@ -1080,94 +1082,6 @@ - - 2 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Plot other module texts on silkscreen - - 0 - - - 0 - - 1 - m_plotTextOther - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Enable/disable print/plot module field texts on silkscreen layers - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 wxALL @@ -1201,7 +1115,7 @@ 0 0 wxID_ANY - Plot invisible texts on silkscreen + Force plot invisible values/refrences 0 @@ -1222,7 +1136,7 @@ 0 - Force print/plot module invisible texts on silkscreen layers + Force plot invisible values and/or references wxFILTER_NONE wxDefaultValidator @@ -1258,7 +1172,7 @@ 2 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1434,7 +1348,7 @@ 2 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -1608,6 +1522,94 @@ + + 2 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Use auxiliary axis as origin + + 0 + + + 0 + + 1 + m_useAuxOriginCheckBox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Use auxiliary axis as coordinates origin in Gerber files. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2864,94 +2866,6 @@ - - 2 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use auxiliary axis as origin - - 0 - - - 0 - - 1 - m_useAuxOriginCheckBox - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Use auxiliary axis as coordinates origin in Gerber files. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index f435dd1107..aac7fb470f 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Nov 6 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -69,12 +69,12 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxCheckBox* m_plotPads_on_Silkscreen; wxCheckBox* m_plotModuleValueOpt; wxCheckBox* m_plotModuleRefOpt; - wxCheckBox* m_plotTextOther; wxCheckBox* m_plotInvisibleText; wxCheckBox* m_plotNoViaOnMaskOpt; wxCheckBox* m_excludeEdgeLayerOpt; wxCheckBox* m_plotMirrorOpt; wxCheckBox* m_plotPSNegativeOpt; + wxCheckBox* m_useAuxOriginCheckBox; wxStaticText* m_staticText11; wxChoice* m_drillShapeOpt; wxStaticText* m_staticText12; @@ -90,7 +90,6 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxStaticBoxSizer* m_GerberOptionsSizer; wxCheckBox* m_useGerberExtensions; wxCheckBox* m_subtractMaskFromSilk; - wxCheckBox* m_useAuxOriginCheckBox; wxStaticBoxSizer* m_HPGLOptionsSizer; wxStaticText* m_textPenSize; wxTextCtrl* m_HPGLPenSizeOpt; diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 326c33d056..e8a1d8e3e0 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -93,7 +93,6 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_A4Output = false; m_plotReference = true; m_plotValue = true; - m_plotOtherText = true; m_plotInvisibleText = false; m_plotPadsOnSilkLayer = false; m_subtractMaskFromSilk = false; @@ -162,8 +161,6 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter, m_plotReference ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ), m_plotValue ? trueStr : falseStr ); - aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotothertext ), - m_plotOtherText ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ), m_plotInvisibleText ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ), @@ -225,8 +222,6 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const return false; if( m_plotValue != aPcbPlotParams.m_plotValue ) return false; - if( m_plotOtherText != aPcbPlotParams.m_plotOtherText ) - return false; if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText ) return false; if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer ) @@ -390,8 +385,8 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) case T_plotvalue: aPcbPlotParams->m_plotValue = parseBool(); break; - case T_plotothertext: - aPcbPlotParams->m_plotOtherText = parseBool(); + case T_plotothertext: // no more in use: keep for compatibility + parseBool(); // skip param value break; case T_plotinvisibletext: aPcbPlotParams->m_plotInvisibleText = parseBool(); diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index 6e314352e0..60f2b137cc 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -152,9 +152,6 @@ private: /// Enable plotting of part values bool m_plotValue; - /// Enable plotting of other fields - bool m_plotOtherText; - /// Force plotting of fields marked invisible bool m_plotInvisibleText; @@ -237,8 +234,6 @@ public: void SetPlotInvisibleText( bool aFlag ) { m_plotInvisibleText = aFlag; } bool GetPlotInvisibleText() const { return m_plotInvisibleText; } - void SetPlotOtherText( bool aFlag ) { m_plotOtherText = aFlag; } - bool GetPlotOtherText() const { return m_plotOtherText; } void SetPlotValue( bool aFlag ) { m_plotValue = aFlag; } bool GetPlotValue() const { return m_plotValue; } void SetPlotReference( bool aFlag ) { m_plotReference = aFlag; } diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 3926012958..be7ac83311 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -155,10 +155,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule ) if( !textModule ) continue; - if( !GetPlotOtherText() ) - continue; - - if( !textModule->IsVisible() && !GetPlotInvisibleText() ) + if( !textModule->IsVisible() ) continue; textLayer = textModule->GetLayer();