diff --git a/pcbnew/dialogs/panel_pcbnew_display_options.cpp b/pcbnew/dialogs/panel_pcbnew_display_options.cpp index 1da24dc32f..0e0a086abc 100644 --- a/pcbnew/dialogs/panel_pcbnew_display_options.cpp +++ b/pcbnew/dialogs/panel_pcbnew_display_options.cpp @@ -67,6 +67,7 @@ bool PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataToWindow() m_OptDisplayPadNumber->SetValue( displ_opts->m_DisplayPadNum ); m_OptDisplayPadNoConn->SetValue( m_frame->IsElementVisible( LAYER_NO_CONNECTS ) ); m_ShowNetNamesOption->SetSelection( displ_opts->m_DisplayNetNamesMode ); + m_OptDisplayCurvedRatsnestLines->SetValue( displ_opts->m_DisplayRatsnestLinesCurved ); m_galOptsPanel->TransferDataToWindow(); @@ -91,6 +92,8 @@ bool PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow() displ_opts->m_DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection(); + displ_opts->m_DisplayRatsnestLinesCurved = m_OptDisplayCurvedRatsnestLines->GetValue(); + m_galOptsPanel->TransferDataFromWindow(); // Apply changes to the GAL diff --git a/pcbnew/dialogs/panel_pcbnew_display_options_base.cpp b/pcbnew/dialogs/panel_pcbnew_display_options_base.cpp index f94e489303..61014a2025 100644 --- a/pcbnew/dialogs/panel_pcbnew_display_options_base.cpp +++ b/pcbnew/dialogs/panel_pcbnew_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -9,68 +9,77 @@ /////////////////////////////////////////////////////////////////////////// -PANEL_PCBNEW_DISPLAY_OPTIONS_BASE::PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +PANEL_PCBNEW_DISPLAY_OPTIONS_BASE::PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) { wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bupperSizer; bupperSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_galOptionsSizer = new wxBoxSizer( wxVERTICAL ); - - + + bupperSizer->Add( m_galOptionsSizer, 1, wxEXPAND, 5 ); - + wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); - + wxStaticBoxSizer* sbAnnotations; sbAnnotations = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Annotations") ), wxVERTICAL ); - + wxString m_ShowNetNamesOptionChoices[] = { _("Do not show"), _("Show on pads"), _("Show on tracks"), _("Show on pads and tracks") }; int m_ShowNetNamesOptionNChoices = sizeof( m_ShowNetNamesOptionChoices ) / sizeof( wxString ); m_ShowNetNamesOption = new wxRadioBox( sbAnnotations->GetStaticBox(), wxID_ANY, _("Net Names"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS ); m_ShowNetNamesOption->SetSelection( 0 ); m_ShowNetNamesOption->SetToolTip( _("Show or hide net names on pads and/or tracks.") ); - + sbAnnotations->Add( m_ShowNetNamesOption, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_OptDisplayPadNumber = new wxCheckBox( sbAnnotations->GetStaticBox(), wxID_ANY, _("Show pad numbers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_OptDisplayPadNumber->SetValue(true); + m_OptDisplayPadNumber->SetValue(true); sbAnnotations->Add( m_OptDisplayPadNumber, 0, wxALL, 10 ); - + m_OptDisplayPadNoConn = new wxCheckBox( sbAnnotations->GetStaticBox(), wxID_ANY, _("Show pad indicator"), wxDefaultPosition, wxDefaultSize, 0 ); - m_OptDisplayPadNoConn->SetValue(true); + m_OptDisplayPadNoConn->SetValue(true); sbAnnotations->Add( m_OptDisplayPadNoConn, 0, wxBOTTOM|wxLEFT|wxRIGHT, 10 ); - - + + bRightSizer->Add( sbAnnotations, 0, wxEXPAND|wxBOTTOM, 5 ); - + wxStaticBoxSizer* sbClearance; sbClearance = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Clearance Outlines") ), wxVERTICAL ); - + wxString m_OptDisplayTracksClearanceChoices[] = { _("Do not show"), _("Show when creating tracks"), _("Show with via clearance at end"), _("Show when creating and editing tracks"), _("Show always") }; int m_OptDisplayTracksClearanceNChoices = sizeof( m_OptDisplayTracksClearanceChoices ) / sizeof( wxString ); m_OptDisplayTracksClearance = new wxRadioBox( sbClearance->GetStaticBox(), ID_SHOW_CLEARANCE, _("Track Clearance"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksClearanceNChoices, m_OptDisplayTracksClearanceChoices, 1, wxRA_SPECIFY_COLS ); m_OptDisplayTracksClearance->SetSelection( 2 ); m_OptDisplayTracksClearance->SetToolTip( _("Show or hide the track and via clearance area. If \"New track\" is selected, track clearance area is shown only when creating the track.") ); - + sbClearance->Add( m_OptDisplayTracksClearance, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_OptDisplayPadClearence = new wxCheckBox( sbClearance->GetStaticBox(), wxID_ANY, _("Show pad clearance"), wxDefaultPosition, wxDefaultSize, 0 ); sbClearance->Add( m_OptDisplayPadClearence, 0, wxALL, 10 ); - - - bRightSizer->Add( sbClearance, 1, wxEXPAND|wxTOP, 5 ); - - + + + bRightSizer->Add( sbClearance, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + + wxStaticBoxSizer* sbGeneral; + sbGeneral = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General") ), wxVERTICAL ); + + m_OptDisplayCurvedRatsnestLines = new wxCheckBox( sbGeneral->GetStaticBox(), wxID_ANY, _("Show ratsnest with curved lines"), wxDefaultPosition, wxDefaultSize, 0 ); + sbGeneral->Add( m_OptDisplayCurvedRatsnestLines, 0, wxALL, 10 ); + + + bRightSizer->Add( sbGeneral, 0, wxEXPAND|wxTOP, 5 ); + + bupperSizer->Add( bRightSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - + + bMainSizer->Add( bupperSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); diff --git a/pcbnew/dialogs/panel_pcbnew_display_options_base.fbp b/pcbnew/dialogs/panel_pcbnew_display_options_base.fbp index 696a68dcef..7778a64871 100644 --- a/pcbnew/dialogs/panel_pcbnew_display_options_base.fbp +++ b/pcbnew/dialogs/panel_pcbnew_display_options_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 source_name @@ -14,11 +14,12 @@ panel_pcbnew_display_options_base 1000 none + 1 PanelPcbnewDisplayOptions - + . - + 1 1 1 @@ -29,57 +30,27 @@ 0 wxAUI_MGR_DEFAULT - - + + 1 1 impl_virtual - - + + 0 wxID_ANY - - + + PANEL_PCBNEW_DISPLAY_OPTIONS_BASE - + -1,-1 ; forward_declare - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + bMainSizer wxVERTICAL none @@ -88,7 +59,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bupperSizer wxHORIZONTAL none @@ -97,7 +68,7 @@ wxEXPAND 1 - + m_galOptionsSizer wxVERTICAL protected @@ -108,7 +79,7 @@ wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 - + bRightSizer wxVERTICAL none @@ -119,12 +90,11 @@ wxID_ANY Annotations - + sbAnnotations wxVERTICAL 1 none - 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT @@ -134,85 +104,61 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Do not show" "Show on pads" "Show on tracks" "Show on pads and tracks" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Net Names 1 - + 0 - - + + 0 - + 1 m_ShowNetNamesOption 1 - - + + protected 1 - + Resizable 0 1 - + wxRA_SPECIFY_COLS - + 0 Show or hide net names on pads and/or tracks. - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -224,83 +170,59 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Show pad numbers - + 0 - - + + 0 - + 1 m_OptDisplayPadNumber 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -312,100 +234,75 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Show pad <no net> indicator - + 0 - - + + 0 - + 1 m_OptDisplayPadNoConn 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 5 - wxEXPAND|wxTOP - 1 + wxBOTTOM|wxEXPAND|wxTOP + 0 wxID_ANY Clearance Outlines - + sbClearance wxVERTICAL 1 none - 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT @@ -415,85 +312,61 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Do not show" "Show when creating tracks" "Show with via clearance at end" "Show when creating and editing tracks" "Show always" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 ID_SHOW_CLEARANCE Track Clearance 1 - + 0 - - + + 0 - + 1 m_OptDisplayTracksClearance 1 - - + + protected 1 - + Resizable 2 1 - + wxRA_SPECIFY_COLS - + 0 Show or hide the track and via clearance area. If "New track" is selected, track clearance area is shown only when creating the track. - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -505,83 +378,137 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Show pad clearance - + 0 - - + + 0 - + 1 m_OptDisplayPadClearence 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + 5 + wxEXPAND|wxTOP + 0 + + wxID_ANY + General + + sbGeneral + wxVERTICAL + 1 + none + + 10 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show ratsnest with curved lines + + 0 + + + 0 + + 1 + m_OptDisplayCurvedRatsnestLines + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + diff --git a/pcbnew/dialogs/panel_pcbnew_display_options_base.h b/pcbnew/dialogs/panel_pcbnew_display_options_base.h index 63f79d57a4..ac68a7f593 100644 --- a/pcbnew/dialogs/panel_pcbnew_display_options_base.h +++ b/pcbnew/dialogs/panel_pcbnew_display_options_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __PANEL_PCBNEW_DISPLAY_OPTIONS_BASE_H__ -#define __PANEL_PCBNEW_DISPLAY_OPTIONS_BASE_H__ +#pragma once #include #include @@ -27,28 +26,28 @@ /////////////////////////////////////////////////////////////////////////////// /// Class PANEL_PCBNEW_DISPLAY_OPTIONS_BASE /////////////////////////////////////////////////////////////////////////////// -class PANEL_PCBNEW_DISPLAY_OPTIONS_BASE : public wxPanel +class PANEL_PCBNEW_DISPLAY_OPTIONS_BASE : public wxPanel { private: - + protected: enum { ID_SHOW_CLEARANCE = 1000 }; - + wxBoxSizer* m_galOptionsSizer; wxRadioBox* m_ShowNetNamesOption; wxCheckBox* m_OptDisplayPadNumber; wxCheckBox* m_OptDisplayPadNoConn; wxRadioBox* m_OptDisplayTracksClearance; wxCheckBox* m_OptDisplayPadClearence; - + wxCheckBox* m_OptDisplayCurvedRatsnestLines; + public: - - PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + + PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_PCBNEW_DISPLAY_OPTIONS_BASE(); - + }; -#endif //__PANEL_PCBNEW_DISPLAY_OPTIONS_BASE_H__ diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 48410ee668..32612f6850 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -643,6 +643,10 @@ void prepareViewMenu( wxMenu* aParentMenu, bool aUseGal ) _( "Show Ratsnest" ), _( "Show board ratsnest" ), KiBitmap( general_ratsnest_xpm ), wxITEM_CHECK ); + AddMenuItem( aParentMenu, ID_TB_OPTIONS_CURVED_RATSNEST_LINES, + _( "Curved Ratsnest Lines" ), + _( "Show ratsnest with curved lines" ), + KiBitmap( curved_ratsnest_xpm ), wxITEM_CHECK ); aParentMenu->AppendSeparator(); diff --git a/pcbnew/tool_pcb_editor.cpp b/pcbnew/tool_pcb_editor.cpp index e950f58cca..29187874fa 100644 --- a/pcbnew/tool_pcb_editor.cpp +++ b/pcbnew/tool_pcb_editor.cpp @@ -387,6 +387,10 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar() m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_RATSNEST, wxEmptyString, KiScaledBitmap( general_ratsnest_xpm, this ), _( "Show board ratsnest" ), wxITEM_CHECK ); + m_optionsToolBar->AddTool( ID_TB_OPTIONS_CURVED_RATSNEST_LINES, wxEmptyString, + KiScaledBitmap( curved_ratsnest_xpm, this ), + _( "Show ratsnest with curved lines" ), + wxITEM_CHECK ); KiScaledSeparator( m_optionsToolBar, this ); m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_ZONES, wxEmptyString, KiScaledBitmap( show_zone_xpm, this ), @@ -416,10 +420,6 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar() KiScaledBitmap( contrast_mode_xpm, this ), _( "Enable high contrast display mode" ), wxITEM_CHECK ); - m_optionsToolBar->AddTool( ID_TB_OPTIONS_CURVED_RATSNEST_LINES, wxEmptyString, - KiScaledBitmap( curved_ratsnest_xpm, this ), - _( "Show ratsnest lines with curved lines" ), - wxITEM_CHECK ); // Tools to show/hide toolbars: KiScaledSeparator( m_optionsToolBar, this ); @@ -842,11 +842,9 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) } case ID_TB_OPTIONS_CURVED_RATSNEST_LINES: - { displ_opts->m_DisplayRatsnestLinesCurved = !state; m_canvas->Refresh(); break; - } case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE: m_show_microwave_tools = state; diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 2fa53c2abb..50278d4634 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -153,8 +153,8 @@ void PCB_EDIT_FRAME::OnUpdateCurvedRatsnest( wxUpdateUIEvent& aEvent ) aEvent.Check( displ_opts->m_DisplayRatsnestLinesCurved ); m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_CURVED_RATSNEST_LINES, !displ_opts->m_DisplayRatsnestLinesCurved ? - _( "Show airwires as curves" ) : - _( "Show airwires as straight lines" ) ); + _( "Show ratsnest with curved lines" ) : + _( "Show ratsnest with straight lines" ) ); }