From 7e93bb19df3173f56141e54b71f01430128cd013 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Tue, 29 Sep 2009 04:44:35 +0000 Subject: [PATCH] Isaac's via patch --- bitmaps/CMakeLists.txt | 1 + bitmaps/Via_Sketch.xpm | 27 +++++++++++++++ cvpcb/dialog_display_options.cpp | 7 ++++ cvpcb/dialog_display_options.h | 2 ++ gerbview/gerberframe.cpp | 3 ++ gerbview/gerbview_config.h | 9 +++++ gerbview/lay2plot.cpp | 1 + gerbview/options.cpp | 30 ++++++++++++++++ gerbview/tool_gerber.cpp | 4 +++ gerbview/tracepcb.cpp | 6 ++++ include/bitmaps.h | 1 + include/id.h | 1 + include/pcbstruct.h | 1 + include/wxBasePcbFrame.h | 1 + pcbnew/basepcbframe.cpp | 4 +++ pcbnew/class_board_item.cpp | 2 +- pcbnew/class_track.cpp | 42 +++++++++++++++++++++-- pcbnew/classpcb.cpp | 1 + pcbnew/dialog_display_options.cpp | 11 ++++++ pcbnew/dialog_display_options_base.cpp | 4 +++ pcbnew/dialog_display_options_base.h | 2 ++ pcbnew/dialog_general_options.cpp | 12 +++++++ pcbnew/files.cpp | 1 + pcbnew/librairi.cpp | 2 +- pcbnew/modeditoptions.cpp | 5 +++ pcbnew/moduleframe.cpp | 7 ++++ pcbnew/pcbcfg.h | 9 +++++ pcbnew/pcbframe.cpp | 2 ++ pcbnew/print_board_functions.cpp | 9 +++++ pcbnew/tool_modedit.cpp | 4 +++ pcbnew/tool_pcb.cpp | 4 +++ pcbnew/toolbars_update_user_interface.cpp | 41 +++++++++++++--------- 32 files changed, 235 insertions(+), 21 deletions(-) create mode 100644 bitmaps/Via_Sketch.xpm diff --git a/bitmaps/CMakeLists.txt b/bitmaps/CMakeLists.txt index 70999252d6..f1af6661fb 100644 --- a/bitmaps/CMakeLists.txt +++ b/bitmaps/CMakeLists.txt @@ -363,6 +363,7 @@ set(BITMAP_SRCS unzip.xpm Update_Module_Board.xpm up.xpm + Via_Sketch.xpm viewlibs_icon.xpm Web_support.xpm Width_Net.xpm diff --git a/bitmaps/Via_Sketch.xpm b/bitmaps/Via_Sketch.xpm new file mode 100644 index 0000000000..a8712b8288 --- /dev/null +++ b/bitmaps/Via_Sketch.xpm @@ -0,0 +1,27 @@ +/* XPM */ +#ifndef XPMMAIN +extern const char *via_sketch_xpm[]; + +#else +const char * via_sketch_xpm[] = { +"16 16 3 1", +" c None", +". c #7D7D00", +"+ c #7C7C00", +" ", +" .... ", +" ..++++.. ", +" .. .. ", +" .. .. ", +" . .. . ", +" .+ .... +. ", +" .+ .. .. +. ", +" .+ .. .. +. ", +" .+ .... +. ", +" . .. . ", +" .. .. ", +" .. .. ", +" ..++++.. ", +" .... ", +" "}; +#endif diff --git a/cvpcb/dialog_display_options.cpp b/cvpcb/dialog_display_options.cpp index ad61992405..db5d122341 100644 --- a/cvpcb/dialog_display_options.cpp +++ b/cvpcb/dialog_display_options.cpp @@ -96,6 +96,7 @@ bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID i m_TextDisplayOption = NULL; ColumnBoxSizer = NULL; m_IsShowPadFill = NULL; + m_IsShowViaFill = NULL; m_IsShowPadNum = NULL; m_CancelButton = NULL; ////@end WinEDA_FootprintDisplayOptionsFrame member initialisation @@ -154,6 +155,10 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls() m_IsShowPadFill->SetValue(false); ColumnBoxSizer->Add(m_IsShowPadFill, 1, wxGROW|wxALL, 5); + m_IsShowViaFill = new wxCheckBox( itemDialog1, VIAFILL_OPT, _("Fill &via"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); + m_IsShowViaFill->SetValue(false); + ColumnBoxSizer->Add(m_IsShowViaFill, 1, wxGROW|wxALL, 5); + m_IsShowPadNum = new wxCheckBox( itemDialog1, PADNUM_OPT, _("Show pad &number"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); m_IsShowPadNum->SetValue(false); if (WinEDA_FootprintDisplayOptionsFrame::ShowToolTips()) @@ -181,6 +186,7 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls() m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) ); m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) ); m_IsShowPadFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayPadFill) ); + m_IsShowViaFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayViaFill) ); m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) ); ////@end WinEDA_FootprintDisplayOptionsFrame content construction @@ -234,6 +240,7 @@ void WinEDA_FootprintDisplayOptionsFrame::UpdateObjectSettings(void) m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection(); m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue(); m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue(); + m_Parent->m_DisplayViaFill = m_IsShowViaFill->GetValue(); m_Parent->DrawPanel->Refresh(); ////@end WinEDA_FootprintDisplayOptionsFrame update settings } diff --git a/cvpcb/dialog_display_options.h b/cvpcb/dialog_display_options.h index c29fae8496..29937cfcb1 100644 --- a/cvpcb/dialog_display_options.h +++ b/cvpcb/dialog_display_options.h @@ -45,6 +45,7 @@ class wxBoxSizer; #define TEXT_SELECT 10002 #define PADFILL_OPT 10003 #define PADNUM_OPT 10004 +#define VIAFILL_OPT 10005 #define ID_STATICLINE1 10006 #define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER #define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_TITLE _("Display Options") @@ -115,6 +116,7 @@ public: wxRadioBox* m_TextDisplayOption; wxBoxSizer* ColumnBoxSizer; wxCheckBox* m_IsShowPadFill; + wxCheckBox* m_IsShowViaFill; wxCheckBox* m_IsShowPadNum; wxButton* m_CancelButton; ////@end WinEDA_FootprintDisplayOptionsFrame member variables diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 21899925d3..e1d48c55a8 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -272,6 +272,9 @@ void WinEDA_GerberFrame::SetToolbars() m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, !m_DisplayPadFill ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, + !m_DisplayViaFill ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, !m_DisplayPcbTrackFill ); diff --git a/gerbview/gerbview_config.h b/gerbview/gerbview_config.h index c3e676deb4..a2d781bafa 100644 --- a/gerbview/gerbview_config.h +++ b/gerbview/gerbview_config.h @@ -61,6 +61,14 @@ static PARAM_CFG_INT PadFillCfg TRUE /* Valeur par defaut */ ); +static PARAM_CFG_INT ViaFillCfg +( + INSETUP, + wxT("ViaFill"), /* identification */ + (int*)&DisplayOpt.DisplayViaFill, /* Adresse du parametre */ + TRUE /* Valeur par defaut */ +); + static PARAM_CFG_BOOL PadShowNumCfg // Affiche DCodes ( INSETUP, @@ -391,6 +399,7 @@ PARAM_CFG_BASE * ParamCfgList[] = & GerberScaleCfg, & SegmFillCfg, & PadFillCfg, + & ViaFillCfg, //TODO: Will adding this line break tha pcbnew file compatibility? & PadShowNumCfg, & ColorLayer0Cfg, & ColorLayer1Cfg, diff --git a/gerbview/lay2plot.cpp b/gerbview/lay2plot.cpp index 8507dd9219..395d096137 100644 --- a/gerbview/lay2plot.cpp +++ b/gerbview/lay2plot.cpp @@ -24,6 +24,7 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer) save_opt = DisplayOpt; DisplayOpt.DisplayPadFill = FILLED; + DisplayOpt.DisplayViaFill = FILLED; DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadIsol = 0; diff --git a/gerbview/options.cpp b/gerbview/options.cpp index eb96ff5f6f..1c160f2449 100644 --- a/gerbview/options.cpp +++ b/gerbview/options.cpp @@ -71,6 +71,18 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event ) DrawPanel->Refresh( TRUE ); break; + case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: + if( m_OptionsToolBar->GetToolState( id ) ) + { + DisplayOpt.DisplayViaFill = m_DisplayViaFill = false; + } + else + { + DisplayOpt.DisplayViaFill = m_DisplayViaFill = true; + } + DrawPanel->Refresh( TRUE ); + break; + case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH: if( m_OptionsToolBar->GetToolState( id ) ) { @@ -249,6 +261,7 @@ private: WinEDA_BasePcbFrame* m_Parent; wxRadioBox* m_OptDisplayLines; wxRadioBox* m_OptDisplayFlashes; + wxRadioBox* m_OptDisplayVias; //@@@@TODO: Does it belong here? wxRadioBox* m_OptDisplayPolygons; wxCheckBox* m_OptDisplayDCodes; wxRadioBox* m_OptDisplayDrawings; @@ -314,6 +327,16 @@ WinEDA_LookFrame::WinEDA_LookFrame( WinEDA_BasePcbFrame* parent, m_OptDisplayFlashes->SetSelection( 1 ); LeftBoxSizer->Add( m_OptDisplayFlashes, 0, wxGROW | wxALL, 5 ); + + m_OptDisplayVias = new wxRadioBox( this, -1, _( "Spots:" ), + wxDefaultPosition, wxDefaultSize, + 2, list_opt2, 1 ); + if( DisplayOpt.DisplayViaFill ) + m_OptDisplayVias->SetSelection( 1 ); + LeftBoxSizer->Add( m_OptDisplayVias, 0, wxGROW | wxALL, 5 ); + + + // Show Option Draw polygons m_OptDisplayPolygons = new wxRadioBox( this, -1, _( "Polygons:" ), wxDefaultPosition, wxDefaultSize, @@ -364,6 +387,12 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) else DisplayOpt.DisplayPadFill = false; + if( m_OptDisplayVias->GetSelection() == 1 ) + DisplayOpt.DisplayViaFill = true; + else + DisplayOpt.DisplayViaFill = false; + + if( m_OptDisplayPolygons->GetSelection() == 0 ) g_DisplayPolygonsModeSketch = 1; else @@ -374,6 +403,7 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection(); m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill; + m_Parent->m_DisplayViaFill = DisplayOpt.DisplayViaFill; m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; m_Parent->GetScreen()->SetRefreshReq(); diff --git a/gerbview/tool_gerber.cpp b/gerbview/tool_gerber.cpp index c96ec1d6e8..e1a6ae7400 100644 --- a/gerbview/tool_gerber.cpp +++ b/gerbview/tool_gerber.cpp @@ -362,6 +362,10 @@ create or update the left vertical toolbar (option toolbar wxBitmap( pad_sketch_xpm ), _( "Show Spots in Sketch Mode" ), wxITEM_CHECK ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, wxEmptyString, + wxBitmap( via_sketch_xpm ), + _( "Show Vias in Sketch Mode" ), wxITEM_CHECK ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString, wxBitmap( showtrack_xpm ), _( "Show Lines in Sketch Mode" ), wxITEM_CHECK ); diff --git a/gerbview/tracepcb.cpp b/gerbview/tracepcb.cpp index ffafbbfe28..73a813c965 100644 --- a/gerbview/tracepcb.cpp +++ b/gerbview/tracepcb.cpp @@ -34,9 +34,15 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl save_opt = DisplayOpt; if( printmasklayer & ALL_CU_LAYERS ) + { DisplayOpt.DisplayPadFill = true; + DisplayOpt.DisplayViaFill = true; + } else + { DisplayOpt.DisplayPadFill = false; + DisplayOpt.DisplayViaFill = false; + } DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadIsol = 0; diff --git a/include/bitmaps.h b/include/bitmaps.h index a3803f8303..53955a606e 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -359,6 +359,7 @@ extern const char* unlocked_xpm[]; extern const char* unzip_xpm[]; extern const char* update_module_board_xpm[]; extern const char* up_xpm[]; +extern const char* via_sketch_xpm[]; extern const char* viewlibs_icon_xpm[]; extern const char* warning_xpm[]; extern const char* web_support_xpm[]; diff --git a/include/id.h b/include/id.h index ab559dabf4..1bda3affbc 100644 --- a/include/id.h +++ b/include/id.h @@ -225,6 +225,7 @@ enum main_id ID_TB_OPTIONS_HIDDEN_PINS, ID_TB_OPTIONS_BUS_WIRES_ORIENT, ID_TB_OPTIONS_SHOW_PADS_SKETCH, + ID_TB_OPTIONS_SHOW_VIAS_SKETCH, ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, diff --git a/include/pcbstruct.h b/include/pcbstruct.h index 5eb7640012..dbf3d8587e 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -238,6 +238,7 @@ class DISPLAY_OPTIONS { public: bool DisplayPadFill; + bool DisplayViaFill; bool DisplayPadNum; bool DisplayPadNoConn; bool DisplayPadIsol; diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 4a0acda12b..c86f1d0056 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -51,6 +51,7 @@ class WinEDA_BasePcbFrame : public WinEDA_DrawFrame public: bool m_DisplayPadFill; // How show pads + bool m_DisplayViaFill; // How show vias bool m_DisplayPadNum; // show pads numbers int m_DisplayModEdge; // How show module drawings diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 44dc68a013..5d6af2c810 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -26,6 +26,7 @@ static const wxString UserGridSizeXEntry( wxT( "PcbUserGrid_X" ) ); static const wxString UserGridSizeYEntry( wxT( "PcbUserGrid_Y" ) ); static const wxString UserGridUnitsEntry( wxT( "PcbUserGrid_Unit" ) ); static const wxString DisplayPadFillEntry( wxT( "DiPadFi" ) ); +static const wxString DisplayViaFillEntry( wxT( "DiViaFi" ) ); static const wxString DisplayPadNumberEntry( wxT( "DiPadNu" ) ); static const wxString DisplayModuleEdgeEntry( wxT( "DiModEd" ) ); static const wxString DisplayModuleTextEntry( wxT( "DiModTx" ) ); @@ -58,6 +59,7 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father, m_Pcb = NULL; m_DisplayPadFill = true; // How to draw pads + m_DisplayViaFill = true; // How to draw vias m_DisplayPadNum = true; // show pads number m_DisplayModEdge = FILLED; // How to show module drawings @@ -383,6 +385,7 @@ void WinEDA_BasePcbFrame::LoadSettings() cfg->Read( m_FrameName + UserGridUnitsEntry, &m_UserGridUnits, ( long )INCHES ); cfg->Read( m_FrameName + DisplayPadFillEntry, &m_DisplayPadFill, true ); + cfg->Read( m_FrameName + DisplayViaFillEntry, &m_DisplayViaFill, true ); //TODO: Will adding this line break tha pcbnew file compatibility? cfg->Read( m_FrameName + DisplayPadNumberEntry, &m_DisplayPadNum, true ); cfg->Read( m_FrameName + DisplayModuleEdgeEntry, &m_DisplayModEdge, ( long )FILLED ); @@ -412,6 +415,7 @@ void WinEDA_BasePcbFrame::SaveSettings() cfg->Write( m_FrameName + UserGridSizeYEntry, m_UserGridSize.y ); cfg->Write( m_FrameName + UserGridUnitsEntry, ( long )m_UserGridUnits ); cfg->Write( m_FrameName + DisplayPadFillEntry, m_DisplayPadFill ); + cfg->Write( m_FrameName + DisplayViaFillEntry, m_DisplayViaFill ); //TODO: Will adding this line break tha pcbnew file compatibility? cfg->Write( m_FrameName + DisplayPadNumberEntry, m_DisplayPadNum ); cfg->Write( m_FrameName + DisplayModuleEdgeEntry, ( long )m_DisplayModEdge ); cfg->Write( m_FrameName + DisplayModuleTextEntry, ( long )m_DisplayModText ); diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index f5a9c53af9..2e5cd689ca 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -284,7 +284,7 @@ const char** BOARD_ITEM::MenuIcon() const break; case TYPE_VIA: - xpm = pad_sketch_xpm; + xpm = via_sketch_xpm; break; case TYPE_MARKER_PCB: diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 7e57164fcd..d2a758ffb4 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -733,6 +733,12 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi int rayon; int curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; + int fillvia = 0; + WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent; + PCB_SCREEN* screen = frame->GetScreen(); + if( frame->m_DisplayViaFill == FILLED ) + fillvia = 1; + GRSetDrawMode( DC, draw_mode ); color = g_DesignSettings.m_ViaColor[m_Shape]; @@ -770,7 +776,10 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi return; } - GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color ); + if( fillvia ) + GRFilledCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, 0, color, color ); + else + GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color ); int drill_rayon = GetDrillValue() / 2; int inner_rayon = rayon - panel->GetScreen()->Unscale( 2 ); @@ -786,8 +795,35 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi { if( drill_rayon < inner_rayon ) // We can show the via hole { - GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, - drill_rayon, color ); + if( fillvia ) + { + bool blackpenstate = false; + if( screen->m_IsPrinting ) + { + blackpenstate = GetGRForceBlackPenState(); + GRForceBlackPen( false ); + color = g_DrawBgColor; + } + else + color = BLACK; // or DARKGRAY; + + if( draw_mode != GR_XOR ) + GRSetDrawMode( DC, GR_COPY ); + else + GRSetDrawMode( DC, GR_XOR ); + + if( screen->Scale( drill_rayon ) > 1 ) /* draw hole if its size is enought */ + GRFilledCircle( &panel->m_ClipBox, DC, m_Start.x, + m_Start.y, drill_rayon, 0, color, color ); + + if( screen->m_IsPrinting ) + GRForceBlackPen( blackpenstate ); + } + else + { + GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, + drill_rayon, color ); + } } } } diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index 20f99a5c24..5672c36ed3 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -138,6 +138,7 @@ bool PCB_SCREEN::IsMicroViaAcceptable( void ) DISPLAY_OPTIONS::DISPLAY_OPTIONS() { DisplayPadFill = FILLED; + DisplayViaFill = FILLED; DisplayPadNum = true; DisplayPadNoConn = true; DisplayPadIsol = true; diff --git a/pcbnew/dialog_display_options.cpp b/pcbnew/dialog_display_options.cpp index f5046f2f8e..d05db2bfd9 100644 --- a/pcbnew/dialog_display_options.cpp +++ b/pcbnew/dialog_display_options.cpp @@ -83,6 +83,11 @@ void Dialog_Display_Options::init() else m_OptDisplayPads->SetSelection(0); + if ( DisplayOpt.DisplayViaFill ) + m_OptDisplayVias->SetSelection(1); + else + m_OptDisplayVias->SetSelection(0); + m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1); m_OptDisplayViaHole->SetSelection( DisplayOpt.m_DisplayViaMode ); @@ -149,7 +154,13 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event) else DisplayOpt.DisplayPadFill = false; + if (m_OptDisplayVias->GetSelection() == 1 ) + DisplayOpt.DisplayViaFill = true; + else + DisplayOpt.DisplayViaFill = false; + m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill; + m_Parent->m_DisplayViaFill = DisplayOpt.DisplayViaFill; DisplayOpt.DisplayPadIsol = m_OptDisplayPadClearence->GetValue(); diff --git a/pcbnew/dialog_display_options_base.cpp b/pcbnew/dialog_display_options_base.cpp index 58c8b6981a..c3a8766a58 100644 --- a/pcbnew/dialog_display_options_base.cpp +++ b/pcbnew/dialog_display_options_base.cpp @@ -87,6 +87,10 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow m_OptDisplayPads->SetSelection( 1 ); bRModuleSizer->Add( m_OptDisplayPads, 0, wxALL|wxEXPAND, 5 ); + m_OptDisplayVias = new wxRadioBox( this, ID_VIAS_SHAPES, _("Via Shapes:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayPadsNChoices, m_OptDisplayPadsChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayVias->SetSelection( 1 ); + bRModuleSizer->Add( m_OptDisplayVias, 0, wxALL|wxEXPAND, 5 ); + m_OptDisplayPadClearence = new wxCheckBox( this, wxID_ANY, _("Show pad clearance"), wxDefaultPosition, wxDefaultSize, 0 ); bRModuleSizer->Add( m_OptDisplayPadClearence, 0, wxALL, 5 ); diff --git a/pcbnew/dialog_display_options_base.h b/pcbnew/dialog_display_options_base.h index 9bd3fa7883..73930adb91 100644 --- a/pcbnew/dialog_display_options_base.h +++ b/pcbnew/dialog_display_options_base.h @@ -40,6 +40,7 @@ class DialogDisplayOptions_base : public wxDialog ID_EDGES_MODULES, ID_TEXT_MODULES, ID_PADS_SHAPES, + ID_VIAS_SHAPES }; wxRadioBox* m_OptDisplayTracks; @@ -49,6 +50,7 @@ class DialogDisplayOptions_base : public wxDialog wxRadioBox* m_OptDisplayModEdges; wxRadioBox* m_OptDisplayModTexts; wxRadioBox* m_OptDisplayPads; + wxRadioBox* m_OptDisplayVias; wxCheckBox* m_OptDisplayPadClearence; wxCheckBox* m_OptDisplayPadNumber; wxCheckBox* m_OptDisplayPadNoConn; diff --git a/pcbnew/dialog_general_options.cpp b/pcbnew/dialog_general_options.cpp index 2ac7e21b79..e8648b2880 100644 --- a/pcbnew/dialog_general_options.cpp +++ b/pcbnew/dialog_general_options.cpp @@ -270,6 +270,18 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) DrawPanel->Refresh( ); break; + case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: + if( m_OptionsToolBar->GetToolState( id ) ) + { + m_DisplayViaFill = DisplayOpt.DisplayViaFill = false; + } + else + { + m_DisplayViaFill = DisplayOpt.DisplayViaFill = true; + } + DrawPanel->Refresh( ); + break; + case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH: m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !m_OptionsToolBar->GetToolState( id ); diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index e915f8aa79..433f21c1ca 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -230,6 +230,7 @@ this file again.")); m_DisplayModText = DisplayOpt.DisplayModText; m_DisplayModEdge = DisplayOpt.DisplayModEdge; m_DisplayPadFill = DisplayOpt.DisplayPadFill; + m_DisplayViaFill = DisplayOpt.DisplayViaFill; ReadPcbFile( source, false ); } diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 8baffdb919..b8c7b48c14 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -31,7 +31,7 @@ const wxString ModExportFileExtension( wxT( "emp" ) ); -#define ModExportFileWildcard _( "Kicad foot print export files (*.emp)|*.emp" ) +static const wxString ModExportFileWildcard( _( "Kicad foot print export files (*.emp)|*.emp" ) ); /* Fonctions locales */ diff --git a/pcbnew/modeditoptions.cpp b/pcbnew/modeditoptions.cpp index c93c0a77aa..bf24ea4135 100644 --- a/pcbnew/modeditoptions.cpp +++ b/pcbnew/modeditoptions.cpp @@ -62,6 +62,11 @@ wxClientDC dc(DrawPanel); DrawPanel->ReDraw(&dc, TRUE); break; + case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: + m_DisplayViaFill = ! m_OptionsToolBar->GetToolState(id); + DrawPanel->ReDraw(&dc, TRUE); + break; + case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH: m_DisplayModText = m_OptionsToolBar->GetToolState(id) ? SKETCH : FILLED; diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 19fb207469..60a2f8fd61 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -347,6 +347,13 @@ void WinEDA_ModuleEditFrame::SetToolbars() m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR, m_CursorShape ); + + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, + !m_DisplayViaFill ); + m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, + m_DisplayViaFill ? + _( "Show Vias Sketch mode" ) : + _( "Show vias filled mode" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, !m_DisplayPadFill ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH, diff --git a/pcbnew/pcbcfg.h b/pcbnew/pcbcfg.h index ece1a63b62..d22ea9db0e 100644 --- a/pcbnew/pcbcfg.h +++ b/pcbnew/pcbcfg.h @@ -218,6 +218,14 @@ static PARAM_CFG_BOOL PadFillCfg TRUE /* Default value */ ); +static PARAM_CFG_BOOL ViaFillCfg +( + INSETUP, + wxT( "ViaFill" ), /* Keyword */ + &DisplayOpt.DisplayViaFill, /* Parameter address */ + TRUE /* Default value */ +); + static PARAM_CFG_BOOL PadAfficheGardeCfg ( INSETUP, @@ -812,6 +820,7 @@ PARAM_CFG_BASE* ParamCfgList[] = &SegmFillCfg, &TrackDisplayClearanceCfg, &PadFillCfg, + &ViaFillCfg, //TODO: Will adding this line break tha pcbnew file compatibility? &PadAfficheGardeCfg, &PadShowNumCfg, &AfficheContourModuleCfg, diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index f5579acd53..1a3c5fad0d 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -234,6 +234,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; m_DisplayPadFill = DisplayOpt.DisplayPadFill; + m_DisplayViaFill = DisplayOpt.DisplayViaFill; m_DisplayPadNum = DisplayOpt.DisplayPadNum; m_DisplayModEdge = DisplayOpt.DisplayModEdge; @@ -369,3 +370,4 @@ void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event ) GetScreen()->SetModify(); } } + diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index 909ede91de..e91e49cced 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -35,10 +35,18 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa save_opt = DisplayOpt; if( aPrintMaskLayer & ALL_CU_LAYERS ) + { DisplayOpt.DisplayPadFill = true; + DisplayOpt.DisplayViaFill = true; + } else + { DisplayOpt.DisplayPadFill = false; + DisplayOpt.DisplayViaFill = false; + } + frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill; + frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill; frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum = false; DisplayOpt.DisplayPadNoConn = false; DisplayOpt.DisplayPadIsol = false; @@ -154,6 +162,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa DisplayOpt = save_opt; frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill; + frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill; frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum; } diff --git a/pcbnew/tool_modedit.cpp b/pcbnew/tool_modedit.cpp index 7c6b4e83aa..f6f6672986 100644 --- a/pcbnew/tool_modedit.cpp +++ b/pcbnew/tool_modedit.cpp @@ -229,6 +229,10 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar() wxBitmap( pad_sketch_xpm ), _( "Show Pads Sketch" ) ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, wxEmptyString, + wxBitmap( via_sketch_xpm ), + _( "Show Vias Sketch" ) ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString, wxBitmap( text_sketch_xpm ), _( "Show Texts Sketch" ) ); diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index ade8be7ae4..ba1c4cc1cf 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -367,6 +367,10 @@ void WinEDA_PcbFrame::ReCreateOptToolbar() wxBitmap( pad_sketch_xpm ), _( "Show Pads Sketch" ), wxITEM_CHECK ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, wxEmptyString, + wxBitmap( via_sketch_xpm ), + _( "Show Vias Sketch" ), wxITEM_CHECK ); + m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, wxEmptyString, wxBitmap( showtrack_xpm ), _( "Show Tracks Sketch" ), wxITEM_CHECK ); diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 9ae44d7729..4f0782480d 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -195,13 +195,13 @@ void WinEDA_PcbFrame::SetToolbars() DisplayOpt.DisplayPolarCood ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD, DisplayOpt.DisplayPolarCood ? - _( "Polar Coords not show" ) : - _( "Display Polar Coords" ) ); + _( "Polar coords not show" ) : + _( "Display polar coords" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID, m_Draw_Grid ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID, - m_Draw_Grid ? _( "Grid not show" ) : _( "Show Grid" ) ); + m_Draw_Grid ? _( "Grid not show" ) : _( "Show grid" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR, m_CursorShape ); @@ -210,51 +210,60 @@ void WinEDA_PcbFrame::SetToolbars() g_Show_Ratsnest ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_RATSNEST, g_Show_Ratsnest ? - _( "Hide General ratsnest" ) : - _( "Show General ratsnest" ) ); + _( "Hide general ratsnest" ) : + _( "Show general ratsnest" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, g_Show_Module_Ratsnest ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_RATSNEST, g_Show_Module_Ratsnest ? - _( "Hide Module ratsnest" ) : - _( "Show Module ratsnest" ) ); + _( "Hide module ratsnest" ) : + _( "Show module ratsnest" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_AUTO_DEL_TRACK, g_AutoDeleteOldTrack ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_AUTO_DEL_TRACK, g_AutoDeleteOldTrack ? - _( "Disable Auto Delete old Track" ) : - _( "Enable Auto Delete old Track" ) ); + _( "Disable auto delete old track" ) : + _( "Enable auto delete old track" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, !m_DisplayPadFill ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH, m_DisplayPadFill ? - _( "Show Pads Sketch mode" ) : + _( "Show pads sketch mode" ) : _( "Show pads filled mode" ) ); + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, + !m_DisplayViaFill ); + + m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_VIAS_SKETCH, + m_DisplayViaFill ? + _( "Show vias sketch mode" ) : + _( "Show vias filled mode" ) ); + + m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, !m_DisplayPcbTrackFill ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_TRACKS_SKETCH, m_DisplayPcbTrackFill ? - _( "Show Tracks Sketch mode" ) : - _( "Show Tracks filled mode" ) ); + _( "Show tracks sketch mode" ) : + _( "Show tracks filled mode" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, DisplayOpt.ContrastModeDisplay ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, DisplayOpt.ContrastModeDisplay ? - _( "Normal Contrast Mode Display" ) : - _( "High Contrast Mode Display" ) ); + _( "Normal contrast mode display" ) : + _( "High contrast mode display" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE, g_ModuleTextNOVColor & ITEM_NOT_SHOW ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_INVISIBLE_TEXT_MODE, g_ModuleTextNOVColor & (ITEM_NOT_SHOW) ? - _( "Show Invisible Text" ) : - _( "Hide Invisible Text" ) ); + _( "Show invisible text" ) : + _( "Hide invisible text" ) ); m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, m_AuxVToolBar ? true : false ); }