Commit 2eaa28f0 authored by charras's avatar charras

Pcbnew: some enhancements

parent e5cbb935
......@@ -4,7 +4,7 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-mar-16 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2009-mar-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++pcbnew:
in DRC: added test pads to holes.
......
......@@ -364,18 +364,18 @@ void GRSetDrawMode( wxDC* DC, int draw_mode )
{
if( draw_mode & GR_OR )
#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS
DC->SetLogicalFunction( wxCOPY );
#else
DC->SetLogicalFunction( wxOR );
#endif
else if( draw_mode & GR_XOR )
DC->SetLogicalFunction( wxXOR );
else if( draw_mode & GR_NXOR )
#if defined (__WXMAC__) && wxMAC_USE_CORE_GRAPHICS
DC->SetLogicalFunction( wxXOR );
#else
DC->SetLogicalFunction( wxEQUIV );
#endif
else
DC->SetLogicalFunction( wxCOPY );
}
......
......@@ -3,7 +3,7 @@
#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION
#define BUILD_VERSION wxT("(20090332-unstable)")
#define BUILD_VERSION wxT("(20090325-unstable)")
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
......
......@@ -287,6 +287,12 @@ public:
bool DisplayPolarCood;
int DisplayZonesMode;
int DisplayNetNamesMode; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads
*/
bool Show_Modules_Cmp;
bool Show_Modules_Cu;
......
No preview for this file type
This diff is collapsed.
......@@ -163,6 +163,17 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
}
}
// if Contrast mode and a technical layer active, show pads on this layer
// so we can see pads on paste or solder layer
if( DisplayOpt.ContrastModeDisplay && screen->m_Active_Layer > LAST_COPPER_LAYER )
{
if( IsOnLayer( screen->m_Active_Layer ) )
color = g_DesignSettings.m_LayerColor[screen->m_Active_Layer];
else
color = DARKDARKGRAY;
}
if( draw_mode & GR_SURBRILL )
{
if( draw_mode & GR_AND )
......@@ -393,13 +404,23 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
}
/* Draw the pad number */
bool display_padnum = true;
if( frame && !frame->m_DisplayPadNum )
display_padnum = false;
bool display_netname = true;
if( (DisplayOpt.DisplayNetNamesMode == 0) || (DisplayOpt.DisplayNetNamesMode == 2) )
display_netname = false;
if( !display_padnum && !display_netname )
return;
wxPoint tpos0 = wxPoint( ux0, uy0 ); // Position of the centre of text
wxPoint tpos = tpos0;
wxSize AreaSize; // size of text area, normalized to AreaSize.y < AreaSize.x
int shortname_len = m_ShortNetname.Len();
if( ! display_netname )
shortname_len = 0;
if( GetShape() == PAD_CIRCLE )
angle = 0;
AreaSize = m_Size;
......@@ -424,16 +445,20 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
NORMALIZE_ANGLE_90( t_angle );
/* Note: in next calculations, texte size is calculated for 3 or more chars.
Of course, pads numbers and nets names can have less than 3 chars.
but after some tries, i found this is gives the best look
* Of course, pads numbers and nets names can have less than 3 chars.
* but after some tries, i found this is gives the best look
*/
#define MIN_CHAR_COUNT 3
wxString buffer;
int tsize;
if( display_padnum )
{
ReturnStringPadName( buffer );
int numpad_len = buffer.Len();
numpad_len = MAX( numpad_len, MIN_CHAR_COUNT);
numpad_len = MAX( numpad_len, MIN_CHAR_COUNT );
int tsize = min( AreaSize.y, AreaSize.x / numpad_len );
tsize = min( AreaSize.y, AreaSize.x / numpad_len );
#define CHAR_SIZE_MIN 5
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable when size too small.
{
......@@ -443,16 +468,19 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
WHITE, buffer, t_angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 );
}
}
// display the short netnam, if exists
if (shortname_len == 0 )
// display the short netname, if exists
if( shortname_len == 0 )
return;
shortname_len = MAX( shortname_len, MIN_CHAR_COUNT);
shortname_len = MAX( shortname_len, MIN_CHAR_COUNT );
tsize = min( AreaSize.y, AreaSize.x / shortname_len );
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too small.
{
tpos = tpos0;
if ( display_padnum )
tpos.y += AreaSize.y / 2;
RotatePoint( &tpos, wxPoint( ux0, uy0 ), angle );
......@@ -462,4 +490,3 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 );
}
}
......@@ -650,6 +650,9 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( Type() == TYPE_ZONE )
return;
if ( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 )
return;
#define THRESHOLD 10
if( (m_End.x - m_Start.x) != 0 && (m_End.y - m_Start.y) != 0 )
return;
......@@ -821,6 +824,8 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
// Display the short netname:
if( GetNet() == 0 )
return;
if ( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 )
return;
EQUIPOT* net = ( (BOARD*) GetParent() )->FindNet( GetNet() );
if( net == NULL )
return;
......
......@@ -146,9 +146,13 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS()
m_DisplayViaMode = VIA_HOLE_NOT_SHOW;
DisplayPolarCood = TRUE;
DisplayZonesMode = 0; // 0 = Show filled areas outlines in zones,
// 1 = do not show filled areas outlines
// 2 = show outlines of filled areas
DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones,
* 1 = do not show filled areas outlines
* 2 = show outlines of filled areas */
DisplayNetNamesMode = 3; /* 0 do not show netnames,
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads */
Show_Modules_Cmp = TRUE;
Show_Modules_Cu = TRUE;
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Feb 8 2009)
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -22,25 +22,44 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
wxString m_OptDisplayTracksChoices[] = { _("Sketch"), _("Filled") };
int m_OptDisplayTracksNChoices = sizeof( m_OptDisplayTracksChoices ) / sizeof( wxString );
m_OptDisplayTracks = new wxRadioBox( this, wxID_DISPLAY_TRACK, _("Tracks:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksNChoices, m_OptDisplayTracksChoices, 1, wxRA_SPECIFY_COLS );
m_OptDisplayTracks->SetSelection( 0 );
m_OptDisplayTracks->SetSelection( 1 );
m_OptDisplayTracks->SetToolTip( _("Select how tracks are displayed") );
sLeftBoxSizer->Add( m_OptDisplayTracks, 0, wxALL|wxEXPAND, 5 );
wxString m_OptDisplayTracksClearanceChoices[] = { _("Always"), _("New track"), _("Never") };
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->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 );
wxString m_OptDisplayViaHoleChoices[] = { _("Never"), _("defined holes"), _("Always") };
wxString m_OptDisplayViaHoleChoices[] = { _("Never"), _("Defined Holes"), _("Always") };
int m_OptDisplayViaHoleNChoices = sizeof( m_OptDisplayViaHoleChoices ) / sizeof( wxString );
m_OptDisplayViaHole = new wxRadioBox( this, ID_VIAS_HOLES, _("Show Via Holes:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayViaHoleNChoices, m_OptDisplayViaHoleChoices, 1, wxRA_SPECIFY_COLS );
m_OptDisplayViaHole->SetSelection( 1 );
m_OptDisplayViaHole->SetToolTip( _("Show (or not) via holes.\nIf Defined Holes is selected, only the non default size holes are shown") );
sLeftBoxSizer->Add( m_OptDisplayViaHole, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sLeftBoxSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( sLeftBoxSizer, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbMiddleLeftSizer;
sbMiddleLeftSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Names:") ), wxVERTICAL );
wxString m_ShowNetNamesOptionChoices[] = { _("Do Not Show"), _("On Pads"), _("OnTracks"), _("On Pads and Tracks") };
int m_ShowNetNamesOptionNChoices = sizeof( m_ShowNetNamesOptionChoices ) / sizeof( wxString );
m_ShowNetNamesOption = new wxRadioBox( this, wxID_ANY, _("Show Net Names:"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS );
m_ShowNetNamesOption->SetSelection( 3 );
m_ShowNetNamesOption->SetToolTip( _("Show or not net names on pads and/or tracks") );
wxStaticBoxSizer* sMiddleSizer;
sMiddleSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprints:") ), wxHORIZONTAL );
sbMiddleLeftSizer->Add( m_ShowNetNamesOption, 0, wxALL, 5 );
bMainSizer->Add( sbMiddleLeftSizer, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sMiddleRightSizer;
sMiddleRightSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprints:") ), wxHORIZONTAL );
wxBoxSizer* bLModuleSizer;
bLModuleSizer = new wxBoxSizer( wxVERTICAL );
......@@ -57,7 +76,7 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
m_OptDisplayModTexts->SetSelection( 1 );
bLModuleSizer->Add( m_OptDisplayModTexts, 0, wxALL|wxEXPAND, 5 );
sMiddleSizer->Add( bLModuleSizer, 0, 0, 5 );
sMiddleRightSizer->Add( bLModuleSizer, 0, 0, 5 );
wxStaticBoxSizer* bRModuleSizer;
bRModuleSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Options:") ), wxVERTICAL );
......@@ -69,19 +88,22 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
bRModuleSizer->Add( m_OptDisplayPads, 0, wxALL|wxEXPAND, 5 );
m_OptDisplayPadClearence = new wxCheckBox( this, wxID_ANY, _("Show Pad Clearance"), wxDefaultPosition, wxDefaultSize, 0 );
bRModuleSizer->Add( m_OptDisplayPadClearence, 0, wxALL, 5 );
m_OptDisplayPadNumber = new wxCheckBox( this, wxID_ANY, _("Show Pad Number"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptDisplayPadNumber->SetValue(true);
bRModuleSizer->Add( m_OptDisplayPadNumber, 0, wxALL, 5 );
m_OptDisplayPadNoConn = new wxCheckBox( this, wxID_ANY, _("Show Pad NoConnect"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptDisplayPadNoConn->SetValue(true);
bRModuleSizer->Add( m_OptDisplayPadNoConn, 0, wxALL, 5 );
sMiddleSizer->Add( bRModuleSizer, 0, 0, 5 );
sMiddleRightSizer->Add( bRModuleSizer, 0, 0, 5 );
bMainSizer->Add( sMiddleSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( sMiddleRightSizer, 0, wxEXPAND|wxALL, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
......@@ -116,7 +138,7 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow
bRightSizer->Add( m_buttonCANCEL, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bRightSizer, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Feb 8 2009)
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -45,6 +45,7 @@ class DialogDisplayOptions_base : public wxDialog
wxRadioBox* m_OptDisplayTracks;
wxRadioBox* m_OptDisplayTracksClearance;
wxRadioBox* m_OptDisplayViaHole;
wxRadioBox* m_ShowNetNamesOption;
wxRadioBox* m_OptDisplayModEdges;
wxRadioBox* m_OptDisplayModTexts;
wxRadioBox* m_OptDisplayPads;
......@@ -58,13 +59,12 @@ class DialogDisplayOptions_base : public wxDialog
wxButton* m_buttonCANCEL;
// Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DialogDisplayOptions_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 559,303 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DialogDisplayOptions_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 731,331 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DialogDisplayOptions_base();
};
......
......@@ -165,6 +165,7 @@ void Dialog_Display_Options::init()
m_OptDisplayPadNumber->SetValue( DisplayOpt.DisplayPadNum );
m_OptDisplayPadNoConn->SetValue( DisplayOpt.DisplayPadNoConn );
m_OptDisplayDrawings->SetSelection( DisplayOpt.DisplayDrawItems );
m_ShowNetNamesOption->SetSelection( DisplayOpt.DisplayNetNamesMode);
if( GetSizer() )
{
......@@ -229,6 +230,8 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event)
DisplayOpt.DisplayPadNoConn = m_OptDisplayPadNoConn->GetValue();
DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection();
DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection();
m_Parent->DrawPanel->Refresh(TRUE);
......
......@@ -174,8 +174,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( library_xpm );
configmenu->Append( item );
item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors" ),
_( "Select colors and display for board items" ) );
item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors and Visibility" ),
_( "Select colors and visibilty of layers and some items" ) );
item->SetBitmap( palette_xpm );
configmenu->Append( item );
......@@ -185,7 +185,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
configmenu->Append( item );
item = new wxMenuItem( configmenu, ID_PCB_LOOK_SETUP, _( "&Display" ),
_( "Select what items are displayed" ) );
_( "Select how items (pads, tracks texts ... ) are displayed" ) );
item->SetBitmap( display_options_xpm );
configmenu->Append( item );
......
......@@ -104,6 +104,16 @@ static PARAM_CFG_INT ViaShowHoleCfg
OPT_VIA_HOLE_END - 1 /* Min and max values*/
);
static PARAM_CFG_INT ShowNetNamesModeCfg
(
INSETUP,
wxT( "ShowNetNamesMode" ), /* Keyword */
&DisplayOpt.DisplayNetNamesMode, /* Parameter address */
3, /* Default value */
0, /* Min and max values*/
3 /* Min and max values*/
);
static PARAM_CFG_INT TrackClearenceCfg
(
wxT( "Isol" ), /* Keyword */
......@@ -788,7 +798,7 @@ static PARAM_CFG_BOOL TwoSegmentTrackBuildCfg
/* parameters in this list will be saved on request (when saving config).
*/
*/
PARAM_CFG_BASE* ParamCfgList[] =
{
&UserLibDirBufCfg,
......@@ -802,6 +812,7 @@ PARAM_CFG_BASE* ParamCfgList[] =
&MicroViaDiametreCfg,
&MicroViaDrillCfg,
&ViaShowHoleCfg,
&ShowNetNamesModeCfg,
&TrackClearenceCfg,
&LayerCountCfg,
&TrackWidthCfg,
......
......@@ -156,7 +156,7 @@ void WinEDA_SetColorsFrame::CreateControls()
MainBoxSizer->Add(FlexColumnBoxSizer, 1, wxGROW|wxLEFT|wxBOTTOM, 5);
// Add a text string to identify the controls within this column.
Label = new wxStaticText( this, wxID_STATIC, laytool_index[cln]->m_Name,
Label = new wxStaticText( this, wxID_STATIC, wxGetTranslation(laytool_index[cln]->m_Name),
wxDefaultPosition, wxDefaultSize, 0 );
// Make this text string bold (so that it stands out better).
......@@ -209,15 +209,17 @@ void WinEDA_SetColorsFrame::CreateControls()
RowBoxSizer->Add(BUTT_SIZE_X, BUTT_SIZE_Y, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5);
}
// Note: When setting texts, we must call wxGetTranslation( ) for all statically created texts
// if we want them translated
if( laytool_list[lyr]->m_LayerNumber >= 0 )
{
if( laytool_list[lyr]->m_Title == wxT( "*" ) )
msg = g_ViaType_Name[laytool_list[lyr]->m_LayerNumber];
msg = wxGetTranslation( g_ViaType_Name[laytool_list[lyr]->m_LayerNumber]);
else
msg = m_Parent->GetBoard()->GetLayerName( laytool_list[lyr]->m_LayerNumber );
}
else
msg = wxGetTranslation( laytool_list[lyr]->m_Title.GetData() );
msg = wxGetTranslation( laytool_list[lyr]->m_Title );
CheckBox = new wxCheckBox( this, ID_COLOR_CHECKBOX_ONOFF, msg,
wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
......
......@@ -324,7 +324,7 @@ static ColorButton Layer_29_Butt =
static ButtonIndex Msg_Others_Items =
{
wxT( "Others" ), // Title
_( "Others" ), // Title
43 // Index to last bitmap button in group
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment