Commit 814f4e43 authored by jean-pierre charras's avatar jean-pierre charras

Code cleaning. Also fix gcc 4.5 compil warnings.

parents 4451dd3a f01653fc
...@@ -54,14 +54,14 @@ static const wxFileTypeInfo EDAfallbacks[] = ...@@ -54,14 +54,14 @@ static const wxFileTypeInfo EDAfallbacks[] =
wxT( "wxhtml %s" ), wxT( "wxhtml %s" ),
wxT( "html document (from Kicad)" ), wxT( "html document (from Kicad)" ),
wxT( "htm" ), wxT( "htm" ),
wxT( "html" ),NULL ), wxT( "html" ),wxNullPtr ),
wxFileTypeInfo( wxT( "application/sch" ), wxFileTypeInfo( wxT( "application/sch" ),
wxT( "eeschema %s" ), wxT( "eeschema %s" ),
wxT( "eeschema -p %s" ), wxT( "eeschema -p %s" ),
wxT( "sch document (from Kicad)" ), wxT( "sch document (from Kicad)" ),
wxT( "sch" ), wxT( "sch" ),
wxT( "SCH" ), NULL ), wxT( "SCH" ), wxNullPtr ),
// must terminate the table with this! // must terminate the table with this!
wxFileTypeInfo() wxFileTypeInfo()
......
...@@ -318,12 +318,12 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDc, const wxPoint& aO ...@@ -318,12 +318,12 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDc, const wxPoint& aO
if( drawItem.Type() == COMPONENT_FIELD_DRAW_TYPE ) if( drawItem.Type() == COMPONENT_FIELD_DRAW_TYPE )
{ {
drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, NULL, aTransform ); drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, (void*) NULL, aTransform );
} }
// Now, draw only the background for items with // Now, draw only the background for items with
// m_Fill == FILLED_WITH_BG_BODYCOLOR: // m_Fill == FILLED_WITH_BG_BODYCOLOR:
drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, false, aTransform ); drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, (void*) false, aTransform );
} }
} }
......
...@@ -151,8 +151,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -151,8 +151,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
DrawGraphicText( panel, DC, textpos, color, fulltext, DrawGraphicText( panel, DC, textpos, color, fulltext,
orient, orient,
m_Size, hjustify, vjustify, m_Size, hjustify, vjustify,
LineWidth, m_Italic, LineWidth, m_Italic, m_Bold );
m_Bold, false );
} }
/* Enable this to draw the bounding box around the text field to validate /* Enable this to draw the bounding box around the text field to validate
......
...@@ -584,7 +584,7 @@ void SCH_SHEET::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -584,7 +584,7 @@ void SCH_SHEET::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
(EDA_Colors) txtcolor, Text, name_orientation, (EDA_Colors) txtcolor, Text, name_orientation,
wxSize( m_SheetNameSize, m_SheetNameSize ), wxSize( m_SheetNameSize, m_SheetNameSize ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth,
false, false, false ); false, false );
/* Draw text : FileName */ /* Draw text : FileName */
if( aColor >= 0 ) if( aColor >= 0 )
...@@ -596,7 +596,7 @@ void SCH_SHEET::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -596,7 +596,7 @@ void SCH_SHEET::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
(EDA_Colors) txtcolor, Text, name_orientation, (EDA_Colors) txtcolor, Text, name_orientation,
wxSize( m_FileNameSize, m_FileNameSize ), wxSize( m_FileNameSize, m_FileNameSize ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth,
false, false, false ); false, false );
/* Draw text : SheetLabel */ /* Draw text : SheetLabel */
......
...@@ -205,7 +205,7 @@ void Show_Items_DCode_Value( WinEDA_DrawPanel* aPanel, wxDC* aDC, BOARD* aPcb, i ...@@ -205,7 +205,7 @@ void Show_Items_DCode_Value( WinEDA_DrawPanel* aPanel, wxDC* aDC, BOARD* aPcb, i
pos, (EDA_Colors) color, Line, pos, (EDA_Colors) color, Line,
orient, wxSize( width, width ), orient, wxSize( width, width ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,
0, false, false, false ); 0, false, false );
} }
} }
......
...@@ -1088,10 +1088,9 @@ public: ...@@ -1088,10 +1088,9 @@ public:
* When such a bad segment is found, mark it as needing to be removed. * When such a bad segment is found, mark it as needing to be removed.
* and remove all tracks having at least one flagged segment. * and remove all tracks having at least one flagged segment.
* @param aDC = the current device context (can be NULL) * @param aDC = the current device context (can be NULL)
* @param aDisplayActivity = true to display activity on the frame status bar and message panel
* @return true if any change is made * @return true if any change is made
*/ */
bool RemoveMisConnectedTracks( wxDC* aDC, bool aDisplayActivity ); bool RemoveMisConnectedTracks( wxDC* aDC );
// Autoplacement: // Autoplacement:
......
...@@ -35,7 +35,6 @@ set(PCBNEW_SRCS ...@@ -35,7 +35,6 @@ set(PCBNEW_SRCS
build_BOM_from_board.cpp build_BOM_from_board.cpp
class_pcb_layer_widget.cpp class_pcb_layer_widget.cpp
clean.cpp clean.cpp
# cleaningoptions_dialog.cpp
connect.cpp connect.cpp
controle.cpp controle.cpp
dimension.cpp dimension.cpp
...@@ -43,6 +42,8 @@ set(PCBNEW_SRCS ...@@ -43,6 +42,8 @@ set(PCBNEW_SRCS
debug_kbool_key_file_fct.cpp debug_kbool_key_file_fct.cpp
deltrack.cpp deltrack.cpp
dialogs/dialog_block_options_base.cpp dialogs/dialog_block_options_base.cpp
dialogs/dialog_cleaning_options_base.cpp
dialogs/dialog_cleaning_options.cpp
dialog_copper_zones.cpp dialog_copper_zones.cpp
dialog_copper_zones_base.cpp dialog_copper_zones_base.cpp
dialog_design_rules.cpp dialog_design_rules.cpp
......
...@@ -590,8 +590,7 @@ void D_PAD::DrawShape( EDA_Rect* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) ...@@ -590,8 +590,7 @@ void D_PAD::DrawShape( EDA_Rect* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
tsize = (int) ( tsize * 0.8 ); tsize = (int) ( tsize * 0.8 );
DrawGraphicText( aDrawInfo.m_DrawPanel, aDC, tpos, WHITE, buffer, t_angle, DrawGraphicText( aDrawInfo.m_DrawPanel, aDC, tpos, WHITE, buffer, t_angle,
wxSize( tsize, tsize ), GR_TEXT_HJUSTIFY_CENTER, wxSize( tsize, tsize ), GR_TEXT_HJUSTIFY_CENTER,
GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false, GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false );
false );
} }
} }
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////
// Name: cleaningoptions_dialog.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 14:24:54
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 14:24:54
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "cleaningoptions_dialog.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "cleaningoptions_dialog.h"
////@begin XPM images
////@end XPM images
/*!
* WinEDA_CleaningOptionsFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_CleaningOptionsFrame, wxDialog )
/*!
* WinEDA_CleaningOptionsFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_CleaningOptionsFrame, wxDialog )
////@begin WinEDA_CleaningOptionsFrame event table entries
EVT_CLOSE( WinEDA_CleaningOptionsFrame::OnCloseWindow )
EVT_BUTTON( ID_BUTTON_EXECUTE, WinEDA_CleaningOptionsFrame::OnButtonExecuteClick )
////@end WinEDA_CleaningOptionsFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_CleaningOptionsFrame constructors
*/
WinEDA_CleaningOptionsFrame::WinEDA_CleaningOptionsFrame()
{
Init();
}
WinEDA_CleaningOptionsFrame::WinEDA_CleaningOptionsFrame( WinEDA_PcbFrame* parent, wxDC * DC, wxWindowID id,
const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Init();
m_Parent = parent;
m_DC = DC;
Create(parent, id, caption, pos, size, style);
}
/*!
* WinEDA_CleaningOptionsFrame creator
*/
bool WinEDA_CleaningOptionsFrame::Create( wxWindow * parent, wxWindowID id,
const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_CleaningOptionsFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end WinEDA_CleaningOptionsFrame creation
return true;
}
/*!
* WinEDA_CleaningOptionsFrame destructor
*/
WinEDA_CleaningOptionsFrame::~WinEDA_CleaningOptionsFrame()
{
////@begin WinEDA_CleaningOptionsFrame destruction
////@end WinEDA_CleaningOptionsFrame destruction
}
/*!
* Member initialisation
*/
void WinEDA_CleaningOptionsFrame::Init()
{
m_Parent = NULL;
////@begin WinEDA_CleaningOptionsFrame member initialisation
m_CleanViasOpt = NULL;
m_MergetSegmOpt = NULL;
m_DeleteunconnectedOpt = NULL;
m_ConnectToPadsOpt = NULL;
////@end WinEDA_CleaningOptionsFrame member initialisation
}
/*!
* Control creation for WinEDA_CleaningOptionsFrame
*/
void WinEDA_CleaningOptionsFrame::CreateControls()
{
////@begin WinEDA_CleaningOptionsFrame content construction
// Generated by DialogBlocks, 21/10/2007 19:42:47 (unregistered)
WinEDA_CleaningOptionsFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Static"));
wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_CleanViasOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_CLEAN_VIAS, _("Delete redundant vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_CleanViasOpt->SetValue(false);
if (ShowToolTips())
m_CleanViasOpt->SetToolTip(_("remove vias on pads with a through hole"));
itemStaticBoxSizer4->Add(m_CleanViasOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_MergetSegmOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_MERGE_SEGMENTS, _("Merge segments"), wxDefaultPosition, wxDefaultSize, 0 );
m_MergetSegmOpt->SetValue(false);
if (ShowToolTips())
m_MergetSegmOpt->SetToolTip(_("merge aligned track segments, and remove null segments"));
itemStaticBoxSizer4->Add(m_MergetSegmOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DeleteunconnectedOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteunconnectedOpt->SetValue(false);
if (ShowToolTips())
m_DeleteunconnectedOpt->SetToolTip(_("delete track segment having a dangling end"));
itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect to Pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_ConnectToPadsOpt->SetValue(false);
if (ShowToolTips())
m_ConnectToPadsOpt->SetToolTip(_("Extend dangling tracks which partially cover a pad or via, all the way to pad or via center"));
itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton10->SetDefault();
itemBoxSizer9->Add(itemButton10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
// Set validators
m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias ) );
m_MergetSegmOpt->SetValidator( wxGenericValidator(& s_MergeSegments) );
m_DeleteunconnectedOpt->SetValidator( wxGenericValidator(& s_DeleteUnconnectedSegm) );
////@end WinEDA_CleaningOptionsFrame content construction
}
/*!
* Should we show tooltips?
*/
bool WinEDA_CleaningOptionsFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_CleaningOptionsFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_CleaningOptionsFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WinEDA_CleaningOptionsFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_CleaningOptionsFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_CleaningOptionsFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WinEDA_CleaningOptionsFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_EXECUTE
*/
void WinEDA_CleaningOptionsFrame::OnButtonExecuteClick( wxCommandEvent& event )
{
s_CleanVias = m_CleanViasOpt->GetValue();
s_MergeSegments = m_MergetSegmOpt->GetValue();
s_DeleteUnconnectedSegm = m_DeleteunconnectedOpt->GetValue();
s_ConnectToPads = m_ConnectToPadsOpt->GetValue();
Clean_Pcb_Items(m_Parent, m_DC );
Close(TRUE);
}
/*!
* wxEVT_CLOSE_WINDOW event handler for ID_WIN_EDA_CLEANINGOPTIONSFRAME
*/
void WinEDA_CleaningOptionsFrame::OnCloseWindow( wxCloseEvent& event )
{
s_CleanVias = m_CleanViasOpt->GetValue();
s_MergeSegments = m_MergetSegmOpt->GetValue();
s_DeleteUnconnectedSegm = m_DeleteunconnectedOpt->GetValue();
s_ConnectToPads = m_ConnectToPadsOpt->GetValue();
event.Skip();
}
/////////////////////////////////////////////////////////////////////////////
// Name: cleaningoptions_dialog.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 14:24:54
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 14:24:54
#ifndef _CLEANINGOPTIONS_DIALOG_H_
#define _CLEANINGOPTIONS_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "cleaningoptions_dialog.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_WIN_EDA_CLEANINGOPTIONSFRAME 10000
#define ID_CHECKBOX_CLEAN_VIAS 10001
#define ID_CHECKBOX_MERGE_SEGMENTS 10003
#define ID_CHECKBOX1 10005
#define ID_CHECKBOX 10004
#define ID_BUTTON_EXECUTE 10006
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE _("Cleaning options")
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME ID_WIN_EDA_CLEANINGOPTIONSFRAME
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION wxDefaultPosition
////@end control identifiers
class WinEDA_PcbFrame;
/*declared in clean.cpp:
extern static bool s_CleanVias;
extern static bool s_MergeSegments;
extern static bool s_DeleteUnconnectedSegm;
void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC );
//end clean.cpp */
/*!
* WinEDA_CleaningOptionsFrame class declaration
*/
class WinEDA_CleaningOptionsFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_CleaningOptionsFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_CleaningOptionsFrame();
WinEDA_CleaningOptionsFrame( WinEDA_PcbFrame * parent, wxDC * DC,
wxWindowID id = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE );
/// Destructor
~WinEDA_CleaningOptionsFrame();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_CleaningOptionsFrame event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_WIN_EDA_CLEANINGOPTIONSFRAME
void OnCloseWindow( wxCloseEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_EXECUTE
void OnButtonExecuteClick( wxCommandEvent& event );
////@end WinEDA_CleaningOptionsFrame event handler declarations
////@begin WinEDA_CleaningOptionsFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_CleaningOptionsFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_CleaningOptionsFrame member variables
wxCheckBox* m_CleanViasOpt;
wxCheckBox* m_MergetSegmOpt;
wxCheckBox* m_DeleteunconnectedOpt;
wxCheckBox* m_ConnectToPadsOpt;
////@end WinEDA_CleaningOptionsFrame member variables
WinEDA_PcbFrame * m_Parent;
wxDC * m_DC;
};
#endif
// _CLEANINGOPTIONS_DIALOG_H_
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_cleaning_options.cpp
// Author: jean-pierre Charras
/////////////////////////////////////////////////////////////////////////////
#include "wx/wx.h"
#include "dialog_cleaning_options.h"
DIALOG_CLEANING_OPTIONS::DIALOG_CLEANING_OPTIONS( wxWindow* parent ):
DIALOG_CLEANING_OPTIONS_BASE( parent )
{
m_cleanViasOpt->SetValue( cleanVias );
m_mergeSegmOpt->SetValue( mergeSegments );
m_deleteUnconnectedOpt->SetValue( deleteUnconnectedSegm );
m_reconnectToPadsOpt->SetValue( connectToPads );
GetSizer()->SetSizeHints(this);
Centre();
}
// Static members of DIALOG_CLEANING_OPTIONS
bool DIALOG_CLEANING_OPTIONS::cleanVias = true;
bool DIALOG_CLEANING_OPTIONS::mergeSegments = true;
bool DIALOG_CLEANING_OPTIONS::deleteUnconnectedSegm = true;
bool DIALOG_CLEANING_OPTIONS::connectToPads = false;
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_cleaning_options.h
// Author: jean-pierre Charras
/////////////////////////////////////////////////////////////////////////////
#ifndef DIALOG_CLEANING_OPTIONS_H_
#define DIALOG_CLEANING_OPTIONS_H_
#include "dialog_cleaning_options_base.h"
class DIALOG_CLEANING_OPTIONS: public DIALOG_CLEANING_OPTIONS_BASE
{
public:
static bool cleanVias;
static bool mergeSegments;
static bool deleteUnconnectedSegm;
static bool connectToPads;
public:
DIALOG_CLEANING_OPTIONS( wxWindow* parent );
~DIALOG_CLEANING_OPTIONS()
{
}
private:
void OnCancelClick( wxCommandEvent& event )
{
EndModal( wxID_CANCEL );
}
void OnOKClick( wxCommandEvent& event )
{
GetOpts( );
EndModal( wxID_OK );
}
void OnCloseWindow( wxCloseEvent& event )
{
GetOpts( );
}
void GetOpts( )
{
cleanVias = m_cleanViasOpt->GetValue( );
mergeSegments = m_mergeSegmOpt->GetValue( );
deleteUnconnectedSegm = m_deleteUnconnectedOpt->GetValue( );
connectToPads = m_reconnectToPadsOpt->GetValue( );
}
};
#endif
// DIALOG_CLEANING_OPTIONS_H_
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_cleaning_options_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_CLEANING_OPTIONS_BASE::DIALOG_CLEANING_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxVERTICAL );
m_cleanViasOpt = new wxCheckBox( this, wxID_ANY, _("Delete redundant vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_cleanViasOpt->SetToolTip( _("remove vias on pads with a through hole") );
bSizerUpper->Add( m_cleanViasOpt, 0, wxALL, 5 );
m_mergeSegmOpt = new wxCheckBox( this, wxID_ANY, _("Merge segments"), wxDefaultPosition, wxDefaultSize, 0 );
m_mergeSegmOpt->SetToolTip( _("merge aligned track segments, and remove null segments") );
bSizerUpper->Add( m_mergeSegmOpt, 0, wxALL, 5 );
m_deleteUnconnectedOpt = new wxCheckBox( this, wxID_ANY, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_deleteUnconnectedOpt->SetToolTip( _("delete track segment having a dangling end") );
bSizerUpper->Add( m_deleteUnconnectedOpt, 0, wxALL, 5 );
m_reconnectToPadsOpt = new wxCheckBox( this, wxID_ANY, _("Connect to pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_reconnectToPadsOpt->SetToolTip( _("Extend dangling tracks which partially cover a pad or via, all the way to pad or via center") );
bSizerUpper->Add( m_reconnectToPadsOpt, 0, wxALL, 5 );
bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 5 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCloseWindow ) );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnOKClick ), NULL, this );
}
DIALOG_CLEANING_OPTIONS_BASE::~DIALOG_CLEANING_OPTIONS_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCloseWindow ) );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCancelClick ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnOKClick ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_cleaning_options_base__
#define __dialog_cleaning_options_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_CLEANING_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_CLEANING_OPTIONS_BASE : public wxDialog
{
private:
protected:
wxCheckBox* m_cleanViasOpt;
wxCheckBox* m_mergeSegmOpt;
wxCheckBox* m_deleteUnconnectedOpt;
wxCheckBox* m_reconnectToPadsOpt;
wxStaticLine* m_staticline;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
public:
bool cleanVias;
bool mergeSegments;
bool deleteUnconnectedSegm;
bool connectToPads;
DIALOG_CLEANING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Cleaning options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 243,181 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_CLEANING_OPTIONS_BASE();
};
#endif //__dialog_cleaning_options_base__
...@@ -217,8 +217,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* ptmod, bool createlib ) ...@@ -217,8 +217,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* ptmod, bool createlib )
} }
void WinEDA_ModuleEditFrame::Delete_Module_In_Library( void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname )
const wxString& aLibname )
{ {
wxFileName newFileName; wxFileName newFileName;
wxFileName oldFileName; wxFileName oldFileName;
......
...@@ -367,7 +367,7 @@ bool WinEDA_PcbFrame::ReadPcbNetlist( const wxString& aNetlistFullFilename, ...@@ -367,7 +367,7 @@ bool WinEDA_PcbFrame::ReadPcbNetlist( const wxString& aNetlistFullFilename,
{ {
if( aDeleteBadTracks ) // Remove erroneous tracks if( aDeleteBadTracks ) // Remove erroneous tracks
{ {
RemoveMisConnectedTracks( NULL, true ); RemoveMisConnectedTracks( NULL );
Compile_Ratsnest( NULL, true ); Compile_Ratsnest( NULL, true );
} }
} }
......
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