From 360eda0f3ce835a363bb57c2ed0f3eeb0e718b8a Mon Sep 17 00:00:00 2001 From: charras Date: Thu, 18 Jun 2009 17:32:27 +0000 Subject: [PATCH] Pcbnew: Added: Option to show the via area while creating a new track. Useful in compact designs to know hos to place a via during track creation. --- CHANGELOG.txt | 2 + include/id.h | 2 +- include/wxPcbStruct.h | 1 + pcbnew/CMakeLists.txt | 1 + pcbnew/dialog_display_options.cpp | 160 +++++++++++++++++++++++++ pcbnew/dialog_display_options_base.cpp | 4 +- pcbnew/dialog_display_options_base.fbp | 4 +- pcbnew/dialog_drc_base.cpp | 6 +- pcbnew/dialog_drc_base.fbp | 6 +- pcbnew/dialog_general_options.cpp | 123 ------------------- pcbnew/dialog_general_options.h | 14 --- pcbnew/editrack.cpp | 18 ++- pcbnew/menubarpcb.cpp | 2 +- pcbnew/pcbcfg.cpp | 1 - pcbnew/pcbcfg.h | 6 +- pcbnew/pcbframe.cpp | 5 +- pcbnew/pcbnew.cpp | 2 +- pcbnew/pcbnew.h | 84 +++++++------ 18 files changed, 245 insertions(+), 196 deletions(-) create mode 100644 pcbnew/dialog_display_options.cpp diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7750c9c1af..c35ea6f2bc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,8 @@ email address. ================================================================================ ++Pcbnew: Added: in DRC tests: tests for vias min size and tracks min width. + Added: Option to show the via area while creating a new track. + Useful in compact designs to know hos to place a via during track creation. 2009-june-11 UPDATE Jean-Pierre Charras ================================================================================ diff --git a/include/id.h b/include/id.h index 4515de0a3a..cb71fd6381 100644 --- a/include/id.h +++ b/include/id.h @@ -713,7 +713,7 @@ enum main_id { ID_PCB_GEN_POS_MODULES_FILE, ID_PCB_GEN_DRILL_FILE, - ID_PCB_LOOK_SETUP, + ID_PCB_DISPLAY_OPTIONS_SETUP, ID_PCB_TRACK_SIZE_SETUP, ID_PCB_PAD_SETUP, diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 77b96b95f7..ecf184a638 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -455,6 +455,7 @@ public: void SetToolbars(); void Process_Settings( wxCommandEvent& event ); void InstallPcbOptionsFrame( const wxPoint& pos, wxDC* DC, int id ); + void InstallDisplayOptionsDialog( wxCommandEvent& aEvent ); void InstallPcbGlobalDeleteFrame( const wxPoint& pos ); void GenModulesPosition( wxCommandEvent& event ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index aaadd37dca..2d06707b1c 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -32,6 +32,7 @@ set(PCBNEW_SRCS deltrack.cpp dialog_copper_zones.cpp dialog_copper_zones_base.cpp + dialog_display_options.cpp dialog_display_options_base.cpp dialog_drc_base.cpp dialog_drc.cpp diff --git a/pcbnew/dialog_display_options.cpp b/pcbnew/dialog_display_options.cpp new file mode 100644 index 0000000000..8ca805407b --- /dev/null +++ b/pcbnew/dialog_display_options.cpp @@ -0,0 +1,160 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: dialog_general_options.cpp +// Author: jean-pierre Charras +///////////////////////////////////////////////////////////////////////////// +/* functions relatives to the dialog opened from the main menu : + Prefernces/display +*/ +#include "fctsys.h" +#include "common.h" +#include "class_drawpanel.h" +#include "confirm.h" +#include "pcbnew.h" + +#include "id.h" + +#include "dialog_display_options_base.h" + + +class Dialog_Display_Options : public DialogDisplayOptions_base +{ +private: + WinEDA_BasePcbFrame* m_Parent; + + void init(); + +public: + Dialog_Display_Options( WinEDA_BasePcbFrame* parent ); + ~Dialog_Display_Options( ) { }; + void OnOkClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); +}; + + +void WinEDA_PcbFrame::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) +{ + Dialog_Display_Options* DisplayOptionsDialog = + new Dialog_Display_Options( this ); + + DisplayOptionsDialog->ShowModal(); + DisplayOptionsDialog->Destroy(); +} + + +/*******************************************************************************/ +Dialog_Display_Options::Dialog_Display_Options( WinEDA_BasePcbFrame* parent ) : + DialogDisplayOptions_base(parent) +/*******************************************************************************/ +{ + m_Parent = parent; + + init(); +} + +/****************************************************************/ +void Dialog_Display_Options::init() +/****************************************************************/ +{ + SetFocus(); + + if ( DisplayOpt.DisplayPcbTrackFill ) + m_OptDisplayTracks->SetSelection(1); + + if ( DisplayOpt.DisplayTrackIsol ) + m_OptDisplayTracksClearance->SetSelection(3); + else if ( g_ShowClearanceWhenTrackCreation == 1) + m_OptDisplayTracksClearance->SetSelection(1); + else if ( g_ShowClearanceWhenTrackCreation == 2) + m_OptDisplayTracksClearance->SetSelection(2); + else m_OptDisplayTracksClearance->SetSelection(0); + + if ( DisplayOpt.DisplayPadFill ) + m_OptDisplayPads->SetSelection(1); + else + m_OptDisplayPads->SetSelection(0); + + m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1); + + m_OptDisplayViaHole->SetSelection( DisplayOpt.m_DisplayViaMode ); + m_OptDisplayModTexts->SetSelection( DisplayOpt.DisplayModText ); + m_OptDisplayModEdges->SetSelection( DisplayOpt.DisplayModEdge ); + m_OptDisplayPadClearence->SetValue( DisplayOpt.DisplayPadIsol ); + m_OptDisplayPadNumber->SetValue( DisplayOpt.DisplayPadNum ); + m_OptDisplayPadNoConn->SetValue( DisplayOpt.DisplayPadNoConn ); + m_OptDisplayDrawings->SetSelection( DisplayOpt.DisplayDrawItems ); + m_ShowNetNamesOption->SetSelection( DisplayOpt.DisplayNetNamesMode); + + if( GetSizer() ) + { + GetSizer()->SetSizeHints( this ); + } +} + +/*****************************************************************/ +void Dialog_Display_Options::OnCancelClick( wxCommandEvent& event ) +/*****************************************************************/ +{ + event.Skip(); +} + +/*************************************************************************/ +void Dialog_Display_Options::OnOkClick(wxCommandEvent& event) +/*************************************************************************/ +/* Update variables with new options +*/ +{ + if ( m_Show_Page_Limits->GetSelection() == 0 ) g_ShowPageLimits = TRUE; + else g_ShowPageLimits = FALSE; + + if ( m_OptDisplayTracks->GetSelection() == 1) + DisplayOpt.DisplayPcbTrackFill = TRUE; + else DisplayOpt.DisplayPcbTrackFill = FALSE; + + m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; + DisplayOpt.m_DisplayViaMode = m_OptDisplayViaHole->GetSelection(); + + switch ( m_OptDisplayTracksClearance->GetSelection() ) + { + case 3: + DisplayOpt.DisplayTrackIsol = TRUE; + g_ShowClearanceWhenTrackCreation = 1; + break; + case 1: + DisplayOpt.DisplayTrackIsol = FALSE; + g_ShowClearanceWhenTrackCreation = 1; + break; + case 2: + DisplayOpt.DisplayTrackIsol = FALSE; + g_ShowClearanceWhenTrackCreation = 2; + break; + case 0: + DisplayOpt.DisplayTrackIsol = FALSE; + g_ShowClearanceWhenTrackCreation = 0; + break; + } + + m_Parent->m_DisplayModText = DisplayOpt.DisplayModText = + m_OptDisplayModTexts->GetSelection(); + m_Parent->m_DisplayModEdge = DisplayOpt.DisplayModEdge = + m_OptDisplayModEdges->GetSelection(); + + if (m_OptDisplayPads->GetSelection() == 1 ) + DisplayOpt.DisplayPadFill = true; + else + DisplayOpt.DisplayPadFill = false; + + m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill; + + DisplayOpt.DisplayPadIsol = m_OptDisplayPadClearence->GetValue(); + + m_Parent->m_DisplayPadNum = DisplayOpt.DisplayPadNum = m_OptDisplayPadNumber->GetValue(); + + DisplayOpt.DisplayPadNoConn = m_OptDisplayPadNoConn->GetValue(); + + DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection(); + DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection(); + + m_Parent->DrawPanel->Refresh(TRUE); + + EndModal(1); +} diff --git a/pcbnew/dialog_display_options_base.cpp b/pcbnew/dialog_display_options_base.cpp index 444c0e1d56..58c8b6981a 100644 --- a/pcbnew/dialog_display_options_base.cpp +++ b/pcbnew/dialog_display_options_base.cpp @@ -27,10 +27,10 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow sLeftBoxSizer->Add( m_OptDisplayTracks, 0, wxALL|wxEXPAND, 5 ); - wxString m_OptDisplayTracksClearanceChoices[] = { _("Always"), _("New track"), _("Never") }; + wxString m_OptDisplayTracksClearanceChoices[] = { _("Never"), _("New track"), _("New track with via area"), _("Always") }; int m_OptDisplayTracksClearanceNChoices = sizeof( m_OptDisplayTracksClearanceChoices ) / sizeof( wxString ); m_OptDisplayTracksClearance = new wxRadioBox( this, ID_SHOW_CLEARANCE, _("Show Tracks Clearance:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksClearanceNChoices, m_OptDisplayTracksClearanceChoices, 1, wxRA_SPECIFY_COLS ); - m_OptDisplayTracksClearance->SetSelection( 1 ); + m_OptDisplayTracksClearance->SetSelection( 0 ); m_OptDisplayTracksClearance->SetToolTip( _("Show( or not) tracks clearance area.\nIf New track is selected, track clearance area is shown only when creating the track.") ); sLeftBoxSizer->Add( m_OptDisplayTracksClearance, 0, wxALL|wxEXPAND, 5 ); diff --git a/pcbnew/dialog_display_options_base.fbp b/pcbnew/dialog_display_options_base.fbp index b3bc577acd..5bfbedcea8 100644 --- a/pcbnew/dialog_display_options_base.fbp +++ b/pcbnew/dialog_display_options_base.fbp @@ -147,7 +147,7 @@ 0 - "Always" "New track" "Never" + "Never" "New track" "New track with via area" "Always" 1 @@ -161,7 +161,7 @@ m_OptDisplayTracksClearance protected - 1 + 0 wxRA_SPECIFY_COLS diff --git a/pcbnew/dialog_drc_base.cpp b/pcbnew/dialog_drc_base.cpp index cdf574672b..bcc06a6f31 100644 --- a/pcbnew/dialog_drc_base.cpp +++ b/pcbnew/dialog_drc_base.cpp @@ -55,7 +55,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i m_TrackMinWidthTitle ->Wrap( -1 ); fgMinValuesSizer->Add( m_TrackMinWidthTitle - , 0, wxALL|wxALIGN_RIGHT, 5 ); + , 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_SetTrackMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_SetTrackMinWidthCtrl->SetToolTip( _("In the clearance units, enter the clearance distance") ); @@ -64,7 +64,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i m_MicroViaMinTitle = new wxStaticText( this, wxID_ANY, _("MicroVia Min Size"), wxDefaultPosition, wxDefaultSize, 0 ); m_MicroViaMinTitle->Wrap( -1 ); - fgMinValuesSizer->Add( m_MicroViaMinTitle, 0, wxALL|wxALIGN_RIGHT, 5 ); + fgMinValuesSizer->Add( m_MicroViaMinTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_SetMicroViakMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_SetMicroViakMinSizeCtrl->SetToolTip( _("In the clearance units, enter the clearance distance") ); @@ -119,7 +119,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i sbSizer3->Add( m_UnconnectedTestCtrl, 0, wxALL, 5 ); - sbSizerOptions->Add( sbSizer3, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizerOptions->Add( sbSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_CommandSizer->Add( sbSizerOptions, 1, 0, 5 ); diff --git a/pcbnew/dialog_drc_base.fbp b/pcbnew/dialog_drc_base.fbp index 8cbe5bf892..56e96da1b3 100644 --- a/pcbnew/dialog_drc_base.fbp +++ b/pcbnew/dialog_drc_base.fbp @@ -335,7 +335,7 @@ 5 - wxALL|wxALIGN_RIGHT + wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT 0 @@ -441,7 +441,7 @@ 5 - wxALL|wxALIGN_RIGHT + wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT 0 @@ -724,7 +724,7 @@ 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxALL 0 wxID_ANY diff --git a/pcbnew/dialog_general_options.cpp b/pcbnew/dialog_general_options.cpp index 2076523fe0..8eaf008ee9 100644 --- a/pcbnew/dialog_general_options.cpp +++ b/pcbnew/dialog_general_options.cpp @@ -15,7 +15,6 @@ #include "id.h" #include "dialog_general_options_BoardEditor_base.h" -#include "dialog_display_options_base.h" #include "dialog_general_options.h" #include "dialog_track_options.h" @@ -128,118 +127,6 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) } -/*******************************************************************************/ -Dialog_Display_Options::Dialog_Display_Options( WinEDA_BasePcbFrame* parent ) : - DialogDisplayOptions_base(parent) -/*******************************************************************************/ -{ - m_Parent = parent; - - init(); -} - -/****************************************************************/ -void Dialog_Display_Options::init() -/****************************************************************/ -{ - SetFocus(); - - if ( DisplayOpt.DisplayPcbTrackFill ) - m_OptDisplayTracks->SetSelection(1); - if ( DisplayOpt.DisplayTrackIsol ) - m_OptDisplayTracksClearance->SetSelection(0); - else if ( g_ShowIsolDuringCreateTrack ) - m_OptDisplayTracksClearance->SetSelection(1); - else m_OptDisplayTracksClearance->SetSelection(2); - - if ( DisplayOpt.DisplayPadFill ) - m_OptDisplayPads->SetSelection(1); - else - m_OptDisplayPads->SetSelection(0); - - m_Show_Page_Limits->SetSelection( g_ShowPageLimits ? 0 : 1); - - m_OptDisplayViaHole->SetSelection( DisplayOpt.m_DisplayViaMode ); - m_OptDisplayModTexts->SetSelection( DisplayOpt.DisplayModText ); - m_OptDisplayModEdges->SetSelection( DisplayOpt.DisplayModEdge ); - m_OptDisplayPadClearence->SetValue( DisplayOpt.DisplayPadIsol ); - m_OptDisplayPadNumber->SetValue( DisplayOpt.DisplayPadNum ); - m_OptDisplayPadNoConn->SetValue( DisplayOpt.DisplayPadNoConn ); - m_OptDisplayDrawings->SetSelection( DisplayOpt.DisplayDrawItems ); - m_ShowNetNamesOption->SetSelection( DisplayOpt.DisplayNetNamesMode); - - if( GetSizer() ) - { - GetSizer()->SetSizeHints( this ); - } -} - -/*****************************************************************/ -void Dialog_Display_Options::OnCancelClick( wxCommandEvent& event ) -/*****************************************************************/ -{ - event.Skip(); -} - -/*************************************************************************/ -void Dialog_Display_Options::OnOkClick(wxCommandEvent& event) -/*************************************************************************/ -/* Update variables with new options -*/ -{ - if ( m_Show_Page_Limits->GetSelection() == 0 ) g_ShowPageLimits = TRUE; - else g_ShowPageLimits = FALSE; - - if ( m_OptDisplayTracks->GetSelection() == 1) - DisplayOpt.DisplayPcbTrackFill = TRUE; - else DisplayOpt.DisplayPcbTrackFill = FALSE; - - m_Parent->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; - DisplayOpt.m_DisplayViaMode = m_OptDisplayViaHole->GetSelection(); - - switch ( m_OptDisplayTracksClearance->GetSelection() ) - { - case 0: - DisplayOpt.DisplayTrackIsol = TRUE; - g_ShowIsolDuringCreateTrack = TRUE; - break; - case 1: - DisplayOpt.DisplayTrackIsol = FALSE; - g_ShowIsolDuringCreateTrack = TRUE; - break; - case 2: - DisplayOpt.DisplayTrackIsol = FALSE; - g_ShowIsolDuringCreateTrack = FALSE; - break; - } - - m_Parent->m_DisplayModText = DisplayOpt.DisplayModText = - m_OptDisplayModTexts->GetSelection(); - m_Parent->m_DisplayModEdge = DisplayOpt.DisplayModEdge = - m_OptDisplayModEdges->GetSelection(); - - if (m_OptDisplayPads->GetSelection() == 1 ) - DisplayOpt.DisplayPadFill = true; - else - DisplayOpt.DisplayPadFill = false; - - m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill; - - DisplayOpt.DisplayPadIsol = m_OptDisplayPadClearence->GetValue(); - - m_Parent->m_DisplayPadNum = DisplayOpt.DisplayPadNum = m_OptDisplayPadNumber->GetValue(); - - DisplayOpt.DisplayPadNoConn = m_OptDisplayPadNoConn->GetValue(); - - DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection(); - DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection(); - - m_Parent->DrawPanel->Refresh(TRUE); - - EndModal(1); -} - - #include "dialog_graphic_items_options.cpp" /*****************************************************************/ @@ -269,16 +156,6 @@ void WinEDA_PcbFrame::InstallPcbOptionsFrame( const wxPoint& pos, } break; - case ID_PCB_LOOK_SETUP: - { - Dialog_Display_Options* DisplayOptionsDialog = - new Dialog_Display_Options( this ); - - DisplayOptionsDialog->ShowModal(); - DisplayOptionsDialog->Destroy(); - } - break; - case ID_OPTIONS_SETUP: { Dialog_GeneralOptions* OptionsFrame = diff --git a/pcbnew/dialog_general_options.h b/pcbnew/dialog_general_options.h index d91e78773c..58cd868b92 100644 --- a/pcbnew/dialog_general_options.h +++ b/pcbnew/dialog_general_options.h @@ -19,18 +19,4 @@ public: }; -class Dialog_Display_Options : public DialogDisplayOptions_base -{ -private: - WinEDA_BasePcbFrame* m_Parent; - - void init(); - -public: - Dialog_Display_Options( WinEDA_BasePcbFrame* parent ); - ~Dialog_Display_Options( ) { }; - void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); -}; - #endif // __dialog_general_options_h diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index ad78c4c87a..3fd947b2ff 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -674,7 +674,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase DisplayOpt.DisplayPcbTrackFill = true; IsolTmp = DisplayOpt.DisplayTrackIsol; - if( g_ShowIsolDuringCreateTrack ) + if( g_ShowClearanceWhenTrackCreation ) DisplayOpt.DisplayTrackIsol = TRUE; /* efface ancienne position si elle a ete deja dessinee */ @@ -682,6 +682,14 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase { Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR ); ( (WinEDA_BasePcbFrame*) (panel->m_Parent) )->trace_ratsnest_pad( DC ); + if( g_ShowClearanceWhenTrackCreation > 1 ) // Show the via area + { + int color = g_DesignSettings.m_LayerColor[g_CurrentTrackSegment->GetLayer()]; + GRCircle( &panel->m_ClipBox, DC, g_CurrentTrackSegment->m_End.x, + g_CurrentTrackSegment->m_End.y, + (g_DesignSettings.m_CurrentViaSize/2) + g_DesignSettings.m_TrackClearence, + color ); + } } // MacOSX seems to need this. @@ -734,6 +742,14 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase D( g_CurrentTrackList.VerifyListIntegrity(); ); Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR ); + if( g_ShowClearanceWhenTrackCreation > 1 ) // Show the via area + { + int color = g_DesignSettings.m_LayerColor[g_CurrentTrackSegment->GetLayer()]; + GRCircle( &panel->m_ClipBox, DC, g_CurrentTrackSegment->m_End.x, + g_CurrentTrackSegment->m_End.y, + (g_DesignSettings.m_CurrentViaSize/2) + g_DesignSettings.m_TrackClearence, + color ); + } DisplayOpt.DisplayTrackIsol = IsolTmp; DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; diff --git a/pcbnew/menubarpcb.cpp b/pcbnew/menubarpcb.cpp index 26cba42872..8b5e7a0abc 100644 --- a/pcbnew/menubarpcb.cpp +++ b/pcbnew/menubarpcb.cpp @@ -184,7 +184,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( preference_xpm ); configmenu->Append( item ); - item = new wxMenuItem( configmenu, ID_PCB_LOOK_SETUP, _( "&Display" ), + item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "&Display" ), _( "Select how items (pads, tracks texts ... ) are displayed" ) ); item->SetBitmap( display_options_xpm ); configmenu->Append( item ); diff --git a/pcbnew/pcbcfg.cpp b/pcbnew/pcbcfg.cpp index 8a71e5a047..0890897fd8 100644 --- a/pcbnew/pcbcfg.cpp +++ b/pcbnew/pcbcfg.cpp @@ -52,7 +52,6 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event ) break; case ID_PCB_TRACK_SIZE_SETUP: - case ID_PCB_LOOK_SETUP: case ID_OPTIONS_SETUP: case ID_PCB_DRAWINGS_WIDTHS_SETUP: InstallPcbOptionsFrame( pos, &dc, id ); diff --git a/pcbnew/pcbcfg.h b/pcbnew/pcbcfg.h index ea0ded673d..d085d93e9a 100644 --- a/pcbnew/pcbcfg.h +++ b/pcbnew/pcbcfg.h @@ -194,12 +194,12 @@ static PARAM_CFG_BOOL SegmFillCfg TRUE /* Default value */ ); -static PARAM_CFG_BOOL NewTrackAfficheGardeCfg +static PARAM_CFG_INT NewTrackAfficheGardeCfg ( INSETUP, wxT( "NewAffG" ), /* Keyword */ - &g_ShowIsolDuringCreateTrack, /* Parameter address */ - TRUE /* Default value */ + &g_ShowClearanceWhenTrackCreation, /* Parameter address */ + 1 /* Default value */ ); static PARAM_CFG_BOOL TrackAfficheGardeCfg diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index ee3e7b5777..6649883375 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -85,9 +85,10 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_MENU( ID_PCB_TRACK_SIZE_SETUP, WinEDA_PcbFrame::Process_Config ) EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, WinEDA_PcbFrame::Process_Config ) EVT_MENU( ID_PCB_PAD_SETUP, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_PCB_LOOK_SETUP, WinEDA_PcbFrame::Process_Config ) - EVT_MENU( ID_CONFIG_SAVE, WinEDA_PcbFrame::Process_Config ) + EVT_MENU( ID_CONFIG_SAVE, WinEDA_PcbFrame::Process_Config ) EVT_MENU( ID_CONFIG_READ, WinEDA_PcbFrame::Process_Config ) + EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, WinEDA_PcbFrame::InstallDisplayOptionsDialog ) + EVT_MENU( ID_PCB_USER_GRID_SETUP, WinEDA_PcbFrame::Process_Special_Functions ) diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 09cc34e93e..a594aa49ec 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -33,7 +33,7 @@ bool g_Show_Ratsnest; bool g_Show_Module_Ratsnest; bool g_Show_Pads_Module_in_Move = TRUE; bool g_Raccord_45_Auto = TRUE; -bool g_ShowIsolDuringCreateTrack; +int g_ShowClearanceWhenTrackCreation = 1; bool Track_45_Only; bool Segments_45_Only; bool g_TwoSegmentTrackBuild = TRUE; diff --git a/pcbnew/pcbnew.h b/pcbnew/pcbnew.h index 2b734c5857..a22fbdd2d5 100644 --- a/pcbnew/pcbnew.h +++ b/pcbnew/pcbnew.h @@ -12,23 +12,23 @@ /* Flag used in locate functions * the locate ref point is the on grid cursor or the off grid mouse cursor */ -#define CURSEUR_ON_GRILLE (0 << 0) -#define CURSEUR_OFF_GRILLE (1 << 0) +#define CURSEUR_ON_GRILLE (0 << 0) +#define CURSEUR_OFF_GRILLE (1 << 0) -#define IGNORE_LOCKED (1 << 1) ///< if module is locked, do not select for single module operation -#define MATCH_LAYER (1 << 2) ///< if module not on current layer, do not select -#define VISIBLE_ONLY (1 << 3) ///< if module not on a visible layer, do not select +#define IGNORE_LOCKED (1 << 1) ///< if module is locked, do not select for single module operation +#define MATCH_LAYER (1 << 2) ///< if module not on current layer, do not select +#define VISIBLE_ONLY (1 << 3) ///< if module not on a visible layer, do not select #define START 0 /* Flag used in locale routines */ #define END 1 -#define DIM_ANCRE_MODULE 3 /* Anchor size (footprint centre) */ -#define DIM_ANCRE_TEXTE 2 /* Anchor size (Text centre) */ +#define DIM_ANCRE_MODULE 3 /* Anchor size (footprint centre) */ +#define DIM_ANCRE_TEXTE 2 /* Anchor size (Text centre) */ -#define TEXTS_MIN_SIZE 50 // Min size in pcbnew units value (50 * 0.0001 mils) -#define TEXTS_MAX_SIZE 100000 // Min size in pcbnew units value (1 inch) ) -#define TEXTS_MAX_WIDTH 5000 // Max width in pcbnew units value (0.5 inches) +#define TEXTS_MIN_SIZE 50 // Min size in pcbnew units value (50 * 0.0001 mils) +#define TEXTS_MAX_SIZE 100000 // Min size in pcbnew units value (1 inch) ) +#define TEXTS_MAX_WIDTH 5000 // Max width in pcbnew units value (0.5 inches) /* Used in Zoom menu */ #define ZOOM_PLUS -1 @@ -46,15 +46,20 @@ /* variables */ -extern bool Drc_On; -extern bool g_AutoDeleteOldTrack; -extern bool g_No_Via_Route; -extern bool g_Drag_Pistes_On; -extern bool g_Show_Ratsnest; -extern bool g_Show_Module_Ratsnest; -extern bool g_Show_Pads_Module_in_Move; -extern bool g_Raccord_45_Auto; -extern bool g_ShowIsolDuringCreateTrack; +extern bool Drc_On; +extern bool g_AutoDeleteOldTrack; +extern bool g_No_Via_Route; +extern bool g_Drag_Pistes_On; +extern bool g_Show_Ratsnest; +extern bool g_Show_Module_Ratsnest; +extern bool g_Show_Pads_Module_in_Move; +extern bool g_Raccord_45_Auto; +extern int g_ShowClearanceWhenTrackCreation; /* = 0 , 1 or 2 + * 0 = do not show clearance + * 1 = show track clearance + * 2 = show clearance + via area + * (useful to know what clearance area is neede if we want to put a via on terminal track point) + */ extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint libraries filesnames @@ -65,7 +70,8 @@ extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint li * @param layer One of the two allowed layers for modules: CMP_N or COPPER_LAYER_N * @return bool - true if the layer is visible, else false. */ -bool inline IsModuleLayerVisible( int layer ) { +bool inline IsModuleLayerVisible( int layer ) +{ if( layer==CMP_N ) return DisplayOpt.Show_Modules_Cmp; @@ -77,36 +83,36 @@ bool inline IsModuleLayerVisible( int layer ) { } -extern bool Track_45_Only; -extern bool Segments_45_Only; -extern wxString g_Shapes3DExtBuffer; -extern wxString g_DocModulesFileName; +extern bool Track_45_Only; +extern bool Segments_45_Only; +extern wxString g_Shapes3DExtBuffer; +extern wxString g_DocModulesFileName; /* Variables used in footprint handling */ -extern int Angle_Rot_Module; -extern wxSize ModuleTextSize; /* Default footprint texts size */ -extern int ModuleTextWidth; -extern int ModuleSegmentWidth; +extern int Angle_Rot_Module; +extern wxSize ModuleTextSize; /* Default footprint texts size */ +extern int ModuleTextWidth; +extern int ModuleSegmentWidth; /* Layer pair for auto routing and switch layers by hotkey */ -extern int Route_Layer_TOP; -extern int Route_Layer_BOTTOM; +extern int Route_Layer_TOP; +extern int Route_Layer_BOTTOM; -extern int g_MaxLinksShowed; // Max count links showed in routing -extern bool g_TwoSegmentTrackBuild; +extern int g_MaxLinksShowed; // Max count links showed in routing +extern bool g_TwoSegmentTrackBuild; -extern int g_MagneticPadOption; -extern int g_MagneticTrackOption; +extern int g_MagneticPadOption; +extern int g_MagneticTrackOption; /* Variables to handle hightlight nets */ -extern bool g_HightLigt_Status; -extern int g_HightLigth_NetCode; +extern bool g_HightLigt_Status; +extern int g_HightLigth_NetCode; -extern PCB_SCREEN* ScreenModule; /* Ecran de l'editeur de modules */ +extern PCB_SCREEN* ScreenModule; /* Ecran de l'editeur de modules */ -extern wxPoint g_Offset_Module; /* Offset de trace du modul en depl */ +extern wxPoint g_Offset_Module; /* Offset de trace du modul en depl */ -extern wxString g_Current_PadName; // Last used pad name (pad num) +extern wxString g_Current_PadName; // Last used pad name (pad num) enum MagneticPadOptionValues {