Commit 89b3eb5a authored by charras's avatar charras

bug fixes and merging my development with svn rep.

parent 13f2e75b
......@@ -4,6 +4,23 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-June-13 RELEASE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+All:
merging my development with svn version
+ pcbnew:
bug fix (problem in postscript generation due to the internationalization
of floating point number notation )
added tool to select layer pair and monitor active layer
+ eeschema
bug fix:
crash libedit when loading certain components (linux only)
incomplete generation of erc file list
2007-June-13 UPDATE Richard A Burton <richardaburton@gmail.com>
================================================================================
+ build:
......
......@@ -117,14 +117,20 @@ bool success = FALSE;
fullfilename.Replace(WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP);
#endif
wxString mask(wxT("*")), extension;
#ifdef __WINDOWS__
mask += wxT(".*");
extension = wxT(".*");
#endif
if ( wxIsWild(fullfilename) )
{
fullfilename =
EDA_FileSelector(_("Doc Files"), /* Titre de la fenetre */
wxPathOnly(fullfilename), /* Chemin par defaut */
fullfilename, /* nom fichier par defaut */
wxEmptyString, /* extension par defaut */
wxEmptyString, /* Masque d'affichage */
extension, /* extension par defaut */
mask, /* Masque d'affichage */
frame, /* parent frame */
wxFD_OPEN, /* wxSAVE, wxFD_OPEN ..*/
TRUE, /* true = ne change pas le repertoire courant */
......
......@@ -77,9 +77,6 @@ WinEDA_App::WinEDA_App(void)
m_Locale = NULL;
m_PdfBrowserIsDefault = TRUE;
/* Init de variables globales d'interet general: */
g_FloatSeparator = '.'; // Nombres flottants = 0.1 par exemple
}
/*****************************/
......@@ -161,9 +158,6 @@ bool succes = SetLanguage(TRUE);
{
}
if ( atof("0,1") ) g_FloatSeparator = ','; // Nombres flottants = 0,1
else g_FloatSeparator = '.';
#ifdef KICAD_PYTHON
PyHandler::GetInstance()->SetAppName( name );
#endif
......@@ -380,9 +374,6 @@ wxString dic_path;
SetLanguageList(NULL);
if ( atof("0,1") ) g_FloatSeparator = ','; // Nombres flottants = 0,1
else g_FloatSeparator = '.';
return m_Locale->IsOk();
}
......
......@@ -39,6 +39,7 @@ static wxString s_HelpPathList[] = {
wxT("d:/kicad/help/"),
#else
wxT("/usr/local/kicad/help/"),
wxT("/usr/share/doc/kicad/help"),
wxT("/usr/share/doc/kicad/"),
#endif
wxT("end_list") // End of list symbol, do not change
......
......@@ -289,7 +289,7 @@ void ChangeSpaces(char * Text, int NewChar)
char * to_point(char * Text)
/**************************/
/* convertit les , en . dans une chaine. utilis pour compenser
l'internalisation imbecile de la fct printf
l'internalisationde la fct printf
qui genere les flottants avec une virgule au lieu du point
*/
{
......@@ -297,7 +297,9 @@ char * line = Text;
if ( Text == NULL ) return NULL;
for ( ; *Text != 0; Text++ )
if (*Text == g_FloatSeparator) *Text = '.';
{
if (*Text == ',') *Text = '.';
}
return line;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -161,8 +161,7 @@ void InstallErcFrame(WinEDA_SchematicFrame *parent, wxPoint & pos)
/*********************************************/
void WinEDA_ErcFrame::ReBuildMatrixPanel(void)
/*********************************************/
/* construit ou reconstruit le panel d'affichage de la matrice de
controle ERC
/* Build or rebuild the panel showing the ERC matrix
*/
{
int ii, jj, event_id, text_height;
......@@ -666,10 +665,9 @@ int ref_elect_type, jj, erc = OK, local_minconn;
/********************************************************/
static bool WriteDiagnosticERC(const wxString & FullFileName)
/*********************************************************/
/* Genere le fichier des diagnostics
/* Create the Diagnostic file (<xxx>.erc file)
*/
{
SCH_SCREEN * Window;
EDA_BaseStruct * DrawStruct;
DrawMarkerStruct * Marker;
char Line[256];
......@@ -683,22 +681,22 @@ wxString msg;
msg = _("ERC control");
fprintf( OutErc, "%s (%s)\n", CONV_TO_UTF8(msg), Line);
for( Window = ScreenSch; Window != NULL; Window = (SCH_SCREEN*)Window->Pnext )
EDA_ScreenList ScreenList(NULL);
for ( SCH_SCREEN * Screen = ScreenList.GetFirst(); Screen != NULL; Screen = ScreenList.GetNext() )
{
Sheet = (DrawSheetStruct *) Window->m_Parent;
Sheet = (DrawSheetStruct*) Screen;
msg.Printf( _("\n***** Sheet %d (%s)\n"),
Window->m_SheetNumber,
Sheet ? Sheet->m_SheetName.GetData() : _("Root"));
Sheet->m_SheetNumber,
Screen == ScreenSch ? _("Root") : Sheet->m_SheetName.GetData());
fprintf( OutErc, "%s", CONV_TO_UTF8(msg));
DrawStruct = Window->EEDrawList;
DrawStruct = Screen->EEDrawList;
for ( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext)
{
if(DrawStruct->m_StructType != DRAW_MARKER_STRUCT_TYPE )
continue;
/* Marqueur trouve */
/* Marqueur trouve */
Marker = (DrawMarkerStruct * ) DrawStruct;
if( Marker->m_Type != MARQ_ERC ) continue;
/* Write diag marqueur */
......
......@@ -174,7 +174,7 @@ void InstallNetlistFrame(WinEDA_SchematicFrame *parent, wxPoint & pos)
}
#define H_SIZE 370
#define V_SIZE 260
#define V_SIZE 300
/*************************************************************************************/
WinEDA_NetlistFrame::WinEDA_NetlistFrame(WinEDA_SchematicFrame *parent, wxPoint& framepos):
......
......@@ -528,8 +528,10 @@ int margin;
PlotFileName = MakeFileName(dirbuf, ShortFileName, wxT(".plt"));
else PlotFileName = MakeFileName(dirbuf, g_DefaultSchematicFileName, wxT(".plt"));
setlocale(LC_NUMERIC, "C");
InitPlotParametresHPGL(PlotOffset, g_PlotScaleX, g_PlotScaleY);
Plot_1_Page_HPGL(PlotFileName,screen);
setlocale(LC_NUMERIC, "");
screen = (BASE_SCREEN*)screen->Pnext;
if ( Select_PlotAll == FALSE ) break;
}
......
......@@ -391,6 +391,7 @@ wxPoint StartPos, EndPos;
return ;
}
setlocale(LC_NUMERIC, "C");
Line.Printf(_("Plot: %s\n"), FileName.GetData()) ;
m_MsgBox->AppendText(Line);
......@@ -507,6 +508,7 @@ wxPoint StartPos, EndPos;
/* fin */
CloseFilePS(PlotOutput);
setlocale(LC_NUMERIC, "");
m_MsgBox->AppendText( wxT("Ok\n"));
}
......
......@@ -233,12 +233,14 @@ int ii;
/* Update the part selection box */
int jj = 1;
if( CurrentLibEntry ) jj = CurrentLibEntry->m_UnitCount;
if ( jj > 1 )
for ( ii = 0; ii < jj ; ii ++ )
{
wxString msg;
msg.Printf(_("Part %c"), 'A' + ii);
m_SelpartBox->Append(msg);
}
else m_SelpartBox->Append( wxEmptyString );
m_SelpartBox->SetSelection( ( CurrentUnit > 0 ) ? CurrentUnit-1 : 0);
if( CurrentLibEntry)
......
/////////////////////////////////////////////////////////////////////////////
// Name: xx.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 02/03/2006 09:16:35
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 02/03/2006 09:16:35
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "xx.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 "xx.h"
////@begin XPM images
////@end XPM images
/*!
* xx type definition
*/
IMPLEMENT_DYNAMIC_CLASS( xx, wxDialog )
/*!
* xx event table definition
*/
BEGIN_EVENT_TABLE( xx, wxDialog )
////@begin xx event table entries
////@end xx event table entries
END_EVENT_TABLE()
/*!
* xx constructors
*/
xx::xx( )
{
}
xx::xx( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* xx creator
*/
bool xx::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin xx member initialisation
////@end xx member initialisation
////@begin xx creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end xx creation
return true;
}
/*!
* Control creation for xx
*/
void xx::CreateControls()
{
////@begin xx content construction
// Generated by DialogBlocks, 02/03/2006 09:16:35 (unregistered)
xx* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
////@end xx content construction
}
/*!
* Should we show tooltips?
*/
bool xx::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap xx::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin xx bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end xx bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon xx::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin xx icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end xx icon retrieval
}
/////////////////////////////////////////////////////////////////////////////
// Name: xx.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 02/03/2006 09:16:35
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 02/03/2006 09:16:35
#ifndef _XX_H_
#define _XX_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "xx.h"
#endif
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10015
#define SYMBOL_XX_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_XX_TITLE _("xx")
#define SYMBOL_XX_IDNAME ID_DIALOG
#define SYMBOL_XX_SIZE wxSize(400, 300)
#define SYMBOL_XX_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* xx class declaration
*/
class xx: public wxDialog
{
DECLARE_DYNAMIC_CLASS( xx )
DECLARE_EVENT_TABLE()
public:
/// Constructors
xx( );
xx( wxWindow* parent, wxWindowID id = SYMBOL_XX_IDNAME, const wxString& caption = SYMBOL_XX_TITLE, const wxPoint& pos = SYMBOL_XX_POSITION, const wxSize& size = SYMBOL_XX_SIZE, long style = SYMBOL_XX_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_XX_IDNAME, const wxString& caption = SYMBOL_XX_TITLE, const wxPoint& pos = SYMBOL_XX_POSITION, const wxSize& size = SYMBOL_XX_SIZE, long style = SYMBOL_XX_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin xx event handler declarations
////@end xx event handler declarations
////@begin xx member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end xx member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin xx member variables
////@end xx member variables
};
#endif
// _XX_H_
......@@ -69,7 +69,6 @@ char text[1024];
fprintf(File,"$SETUP\n");
sprintf(text, "InternalUnit %f INCH\n", 1.0/PCB_INTERNAL_UNIT);
to_point(text);
fprintf(File, text);
Pcb->m_BoardSettings->m_CopperLayerCount = g_DesignSettings.m_CopperLayerCount;
......
......@@ -109,7 +109,6 @@ bool WinEDA_GerberFrame::Read_GERBER_File(wxDC * DC,
/* Lecture de 1 fichier gerber.
Format
Imperial
2.3
Absolu
fin de bloc = *
CrLf apres chaque commande
......@@ -148,6 +147,7 @@ int error = 0;
wxSetWorkingDirectory(wxPathOnly(GERBER_FullFileName));
wxBusyCursor show_wait;
setlocale(LC_NUMERIC, "C");
while( TRUE )
{
......@@ -237,6 +237,8 @@ wxBusyCursor show_wait;
}
fclose(gerber_layer->m_Current_File) ;
setlocale(LC_NUMERIC, "");
/* Init tableau des DCodes et Lecture fichier DCODES */
if ( !gerber_layer->m_As_DCode )
{
......@@ -266,7 +268,6 @@ wxBusyCursor show_wait;
}
}
return TRUE;
}
......
......@@ -105,9 +105,6 @@ char buf[256], * ptchar;
if ( IsNumber(*text) )
{
* ptchar = * text;
if ( * ptchar =='.' || *ptchar == ',' ) * ptchar = g_FloatSeparator;
text++; ptchar ++;
}
else break;
......
......@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
(wxT("(2007-05-25)"))
(wxT("(2007-06-12)"))
#endif
;
......
......@@ -273,7 +273,6 @@ COMMON_GLOBL wxString g_UserLibDirBuffer; // Chemin des librairies de module don
/* variables globales generales */
COMMON_GLOBL int g_FloatSeparator; // = '.' ou = ',' selon locale pour l'ecriture des nombres flotttant
COMMON_GLOBL int g_DebugLevel; // 0= Pas de debug */
COMMON_GLOBL int g_MouseOldButtons;
COMMON_GLOBL int g_KeyPressed;
......@@ -352,7 +351,7 @@ class WinEDA_DrawPanel;
/* COMMON.CPP */
wxString ReturnPcbLayerName(int layer_number, bool is_filename = FALSE);
wxString ReturnPcbLayerName(int layer_number, bool is_filename = FALSE, bool is_gui = FALSE);
/* Return the name of the layer number "layer_number".
if "is_filename" == TRUE, the name can be used for a file name
(not internatinalized, no space)*/
......
......@@ -698,7 +698,7 @@ enum main_id {
ID_AUX_TOOLBAR_PCB_VIA_SIZE,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
ID_AUX_TOOLBAR_PCB_UNUSED1,
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
ID_AUX_TOOLBAR_PCB_UNUSED2,
ID_AUX_TOOLBAR_PCB_UNUSED3,
ID_AUX_TOOLBAR_PCB_UNUSED4,
......
......@@ -479,6 +479,7 @@ public:
// Gestion des layers:
int SelectLayer(int default_layer, int min_layer, int max_layer);
void SelectLayerPair(void);
void SwitchLayer(wxDC *DC, int layer);
// divers
void AddHistory(int value, DrawStructureType type); // Add value in data list history
......@@ -528,6 +529,7 @@ public:
void ReCreateOptToolbar(void);
void ReCreateMenuBar(void);
WinEDAChoiceBox * ReCreateLayerBox( WinEDA_Toolbar * parent);
void PrepareLayerIndicator(void);
void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnLeftDClick(wxDC * DC, const wxPoint& MousePos);
void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
......@@ -627,6 +629,7 @@ public:
void Start_MoveOneNodeOrSegment(TRACK * track, wxDC * DC, int command);
bool PlaceDraggedTrackSegment(TRACK * Track, wxDC * DC);
void Start_DragTrackSegmentAndKeepSlope(TRACK * track, wxDC * DC);
void SwitchLayer(wxDC *DC, int layer);
// Edition des zones
EDGE_ZONE * Del_SegmEdgeZone(wxDC * DC, EDGE_ZONE * edge_zone);
......
/////////////////////////////////////////////////////////////////////////////
// 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, 28/05/2007 19:08:46 (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);
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);
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);
itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect stubs to Pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_ConnectToPadsOpt->SetValue(false);
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|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#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
/*!
* 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_
......@@ -134,7 +134,13 @@ int CurrentTime = time(NULL);
{
wxString tmpFileName = GetScreen()->m_FileName;
wxString filename = g_SaveFileName + PcbExtBuffer;
bool flgmodify = GetScreen()->IsModify();
((WinEDA_PcbFrame*)this)->SavePcbFile(filename);
if( flgmodify ) // Set the flags m_Modify cleared by SavePcbFile()
{
GetScreen()->SetModify();
GetScreen()->SetSave();// Set the flags m_FlagSave cleared by SetModify()
}
GetScreen()->m_FileName = tmpFileName;
SetTitle(GetScreen()->m_FileName);
}
......@@ -355,18 +361,18 @@ int CurrentTime = time(NULL);
OnHotKey(DC, hotkey, NULL);
}
}
/****************************************************************/
void WinEDA_BasePcbFrame::SwitchLayer(wxDC *DC, int layer)
/*****************************************************************/
{
//overridden in WinEDA_PcbFrame;
//Note: overridden in WinEDA_PcbFrame;
int preslayer = GetScreen()->m_Active_Layer;
//if there is only one layer, don't switch.
if ( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1)
return;
//otherwise, must be at least 2 layers..see if it is possible.
if(layer != LAYER_CUIVRE_N || layer != LAYER_CMP_N ||
layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount-1)
layer = LAYER_CUIVRE_N; // Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible
if( layer != LAYER_CMP_N && layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount-1 )
return;
if(preslayer == layer)
return;
......
This diff is collapsed.
......@@ -869,6 +869,10 @@ int itmp;
DrawPanel->MouseToCursorSchema();
break;
case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR:
SelectLayerPair();
break;
case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
itmp = SelectLayer(GetScreen()->m_Active_Layer, CMP_N+1, -1);
if ( itmp >= 0 ) GetScreen()->m_Active_Layer = itmp;
......
......@@ -17,7 +17,7 @@
static void Exit_Editrack(WinEDA_DrawPanel * panel, wxDC *DC);
void ShowNewTrackWhenMovingCursor(WinEDA_DrawPanel * panel,
wxDC * DC, bool erase);
static int Met_Coude_a_45(WinEDA_BasePcbFrame * frame, wxDC * DC,
static int Add_45_degrees_Segment(WinEDA_BasePcbFrame * frame, wxDC * DC,
TRACK * ptfinsegment);
static void ComputeBreakPoint( TRACK * track, int n );
static TRACK * DeleteNullTrackSegments(BOARD * pcb, TRACK * track, int * segmcount);
......@@ -188,7 +188,7 @@ wxPoint pos = GetScreen()->m_Curseur;
if( g_Raccord_45_Auto )
{
if( Met_Coude_a_45(this, DC, g_CurrentTrackSegment) != 0 )
if( Add_45_degrees_Segment(this, DC, g_CurrentTrackSegment) != 0 )
g_TrackSegmentCount++;
}
Track = g_CurrentTrackSegment->Copy();
......@@ -221,7 +221,7 @@ wxPoint pos = GetScreen()->m_Curseur;
/**************************************************************************/
int Met_Coude_a_45(WinEDA_BasePcbFrame * frame, wxDC * DC, TRACK * pt_segm)
int Add_45_degrees_Segment(WinEDA_BasePcbFrame * frame, wxDC * DC, TRACK * pt_segm)
/***************************************************************************/
/* rectifie un virage a 90 et le modifie par 2 coudes a 45
n'opere que sur des segments horizontaux ou verticaux.
......@@ -476,6 +476,15 @@ PCB_SCREEN * screen = (PCB_SCREEN *) panel->GetScreen();
/* dessin de la nouvelle piste : mise a jour du point d'arrivee */
g_CurrentTrackSegment->m_Layer = screen->m_Active_Layer;
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if ( g_TwoSegmentTrackBuild )
{
TRACK * previous_track = (TRACK *)g_CurrentTrackSegment->Pback;
if ( previous_track && (previous_track->m_StructType == TYPETRACK) )
{
previous_track->m_Layer = screen->m_Active_Layer;
previous_track->m_Width = g_DesignSettings.m_CurrentTrackWidth;
}
}
if (Track_45_Only)
{
......
......@@ -135,8 +135,11 @@ EDA_BaseStruct * item;
}
/* Search for a footprint text */
// First search: locate texts for footprints on copper or component layer
// Priority to the active layer (component or copper.
// this is useful for small smd components when 2 texts overlap but are not on the same layer
if ( (LayerSearch == LAYER_CUIVRE_N) || (LayerSearch == CMP_N ))
{ // Search texts for footprints on copper or component layer only
{
for (module = m_Pcb->m_Modules; module != NULL; module = (MODULE*)module->Pnext)
{
TEXTE_MODULE * pt_texte;
......@@ -149,8 +152,8 @@ EDA_BaseStruct * item;
}
}
}
else // Search footprint texts on all layers
{
// Now Search footprint texts on all layers
module = NULL;
{
TEXTE_MODULE * pt_texte;
......@@ -161,7 +164,6 @@ EDA_BaseStruct * item;
return pt_texte;
}
}
}
/* Search for a footprint */
if ( (module = Locate_Prefered_Module(m_Pcb, typeloc)) != NULL)
......@@ -170,6 +172,7 @@ EDA_BaseStruct * item;
return module;
}
/* Search for zones */
if( (TrackLocate = Locate_Zone((TRACK*)m_Pcb->m_Zone,
GetScreen()->m_Active_Layer,typeloc)) != NULL )
{
......
......@@ -233,7 +233,7 @@ drc.o: drc.cpp dialog_drc.cpp dialog_drc.h autorout.h $(COMMON)
block.o: block.cpp $(COMMON)
clean.o: clean.cpp $(COMMON)
clean.o: clean.cpp cleaningoptions_dialog.cpp cleaningoptions_dialog.h $(COMMON)
pcbplot.o: pcbplot.cpp pcbplot.h $(COMMON)
......
......@@ -869,9 +869,16 @@ wxPoint OldPos = m_Parent->m_CurrentScreen->m_Curseur;
{
if( (ii == 0) || ( ref->m_LibName != cmp->m_LibName) )
{ /* Nouveau Module a charger */
Module = m_Parent->Get_Librairie_Module(this, wxEmptyString, cmp->m_LibName, TRUE );
Module = m_Parent->Get_Librairie_Module(this, wxEmptyString, cmp->m_LibName, FALSE );
ref = cmp;
if ( Module == NULL ) continue;
if ( Module == NULL )
{
wxString msg;
msg.Printf(_("Component [%s]: footprint <%s> not found"),
cmp->m_CmpName.GetData(), cmp->m_LibName.GetData());
DisplayError(this, msg);
continue;
}
m_Parent->Place_Module(Module, DC);
/* mise a jour des reperes ( nom et ref "Time Stamp")
si module charge */
......
......@@ -109,6 +109,7 @@ BEGIN_EVENT_TABLE(WinEDA_PcbFrame, wxFrame)
EVT_TOOL(ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions)
EVT_TOOL(ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions)
EVT_TOOL(ID_DRC_CONTROL, WinEDA_PcbFrame::Process_Special_Functions)
EVT_TOOL(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, WinEDA_PcbFrame::Process_Special_Functions)
EVT_KICAD_CHOICEBOX(ID_TOOLBARH_PCB_SELECT_LAYER,
WinEDA_PcbFrame::Process_Special_Functions)
EVT_KICAD_CHOICEBOX(ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
......@@ -159,7 +160,7 @@ BEGIN_EVENT_TABLE(WinEDA_PcbFrame, wxFrame)
EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions )
// PopUp Menus pour Zooms traits dans drawpanel.cpp
// PopUp Menus pour Zooms traites dans drawpanel.cpp
END_EVENT_TABLE()
......@@ -178,7 +179,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame(wxWindow * father, WinEDA_App *parent,
m_FrameName = wxT("PcbFrame");
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessin
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine
m_Draw_Auxiliary_Axis = TRUE;
m_SelTrackWidthBox = NULL;
m_SelViaSizeBox = NULL;
......@@ -275,7 +276,7 @@ PCB_SCREEN * screen;
}
/* Reselection de l'ecran de base,
pour les evenements de refresh g�n�r�s par wxWindows */
pour les evenements de refresh generes par wxWindows */
m_CurrentScreen = ActiveScreen = ScreenPcb;
SaveSettings();
......@@ -483,6 +484,7 @@ int ii, jj;
}
ReCreateLayerBox(NULL);
PrepareLayerIndicator();
DisplayUnitsMsg();
}
......@@ -66,11 +66,6 @@ int tracevia = 1;
g_PlotOffset = m_Auxiliary_Axis_Position;
}
InitPlotParametresGERBER(g_PlotOffset, scale_x, scale_y);
/* Clear the memory used for handle the D_CODE (aperture) list */
Init_ApertureList();
dest = wxFopen(FullFileName, wxT("wt"));
if (dest == NULL)
{
......@@ -78,6 +73,13 @@ int tracevia = 1;
DisplayError(this, msg); return ;
}
setlocale(LC_NUMERIC, "C");
InitPlotParametresGERBER(g_PlotOffset, scale_x, scale_y);
/* Clear the memory used for handle the D_CODE (aperture) list */
Init_ApertureList();
Affiche_1_Parametre(this, 0, _("File"),FullFileName,CYAN) ;
Init_Trace_GERBER(this, dest) ;
......@@ -124,6 +126,7 @@ int tracevia = 1;
}
Fin_Trace_GERBER(this, dest) ;
setlocale(LC_NUMERIC, "");
}
......
......@@ -67,6 +67,8 @@ bool Center = FALSE;
return ;
}
setlocale(LC_NUMERIC, "C");
Affiche_1_Parametre(this, 0,_("File"),FullFileName,CYAN) ;
PrintHeaderHPGL(dest, g_HPGL_Pen_Speed,g_HPGL_Pen_Num);
......@@ -168,6 +170,8 @@ bool Center = FALSE;
}
/* fin */
CloseFileHPGL(dest) ;
setlocale(LC_NUMERIC, "");
}
......
......@@ -48,6 +48,8 @@ int PlotMarge_in_mils = 0;
DisplayError(this, msg); return ;
}
setlocale(LC_NUMERIC, "C");
Affiche_1_Parametre(this, 0,_("File"),FullFileName,CYAN) ;
if( g_PlotScaleOpt != 1 ) Center = TRUE; // Echelle != 1 donc trace centree du PCB
......@@ -201,6 +203,7 @@ int PlotMarge_in_mils = 0;
}
/* fin */
CloseFilePS(dest) ;
setlocale(LC_NUMERIC, "");
}
......
......@@ -187,6 +187,7 @@ void WinEDA_BasePcbFrame::SelectLayerPair(void)
new WinEDA_SelLayerPairFrame(this);
frame->ShowModal(); frame->Destroy();
DrawPanel->MouseToCursorSchema();
SetToolbars();
}
......
......@@ -729,7 +729,6 @@ int w = BUTT_SIZE_X, h = BUTT_SIZE_Y;
iconDC.SelectObject( ButtBitmap );
int buttcolor = *laytool_list[ii]->m_Color;
wxBrush Brush;
iconDC.SelectObject( ButtBitmap );
iconDC.SetPen(*wxBLACK_PEN);
Brush.SetColour(
ColorRefs[buttcolor].m_Red,
......
......@@ -46,6 +46,127 @@
#include "general_ratsnet.xpm"
#include "add_cotation.xpm"
/* Data to build the layer pair indicator button */
static wxBitmap * LayerPairBitmap = NULL;
static char s_BitmapLayerIcon[16][16] = {
{0,0,0,0,0,0,0,3,3,3,1,1,1,1,0,0},
{0,0,0,0,0,0,3,3,3,3,3,1,1,0,0,0},
{0,0,0,0,0,3,3,0,1,1,3,3,0,0,0,0},
{2,2,2,2,3,3,0,1,1,1,1,3,3,2,2,2},
{2,2,2,2,3,3,1,1,1,0,0,3,3,2,2,2},
{2,2,2,2,3,3,1,1,1,1,0,3,3,2,2,2},
{0,0,0,0,0,3,3,1,1,0,3,3,0,0,0,0},
{0,0,0,0,0,1,3,3,3,3,3,0,0,0,0,0},
{0,0,0,0,0,1,1,3,3,3,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0}
};
/************************************************************/
void WinEDA_PcbFrame::PrepareLayerIndicator(void)
/************************************************************/
/* Draw the icon for the "Select layet pair" bitmap tool
*/
{
int ii, jj;
static int previous_active_layer_color, previous_Route_Layer_TOP_color,
previous_Route_Layer_BOTTOM_color, previous_via_color;
int active_layer_color, Route_Layer_TOP_color,
Route_Layer_BOTTOM_color, via_color;
bool change = false;
/* get colors, and redraw bitmap button only on changes */
active_layer_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Active_Layer];
if ( previous_active_layer_color != active_layer_color )
{
previous_active_layer_color = active_layer_color;
change = TRUE;
}
Route_Layer_TOP_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_TOP];
if ( previous_Route_Layer_TOP_color != Route_Layer_TOP_color )
{
previous_Route_Layer_TOP_color = Route_Layer_TOP_color;
change = TRUE;
}
Route_Layer_BOTTOM_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_BOTTOM];
if ( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color )
{
previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color;
change = TRUE;
}
via_color = g_DesignSettings.m_ViaColor[g_DesignSettings.m_CurrentViaType ];
if ( previous_via_color != via_color )
{
previous_via_color = via_color;
change = TRUE;
}
if ( ! change && (LayerPairBitmap != NULL) ) return;
/* Creat the bitmap too and its Memory DC, if not already made */
if ( LayerPairBitmap == NULL )
{
LayerPairBitmap = new wxBitmap(16, 16);
}
/* Draw the icon, witj colors according to the active layer and layer pairs for
via command (change layer) */
wxMemoryDC iconDC;
iconDC.SelectObject( *LayerPairBitmap );
int buttcolor = -1;
wxPen pen;
for ( ii = 0; ii < 16; ii++ )
{
for ( jj = 0; jj < 16; jj++ )
{
if ( s_BitmapLayerIcon[ii][jj] != buttcolor )
{
buttcolor = s_BitmapLayerIcon[ii][jj];
int color;
switch ( buttcolor )
{
default:
case 0:
color = active_layer_color;
break;
case 1:
color = Route_Layer_TOP_color;
break;
case 2:
color = Route_Layer_BOTTOM_color;
break;
case 3:
color = via_color;
break;
}
color &= MASKCOLOR;
pen.SetColour(
ColorRefs[color].m_Red,
ColorRefs[color].m_Green,
ColorRefs[color].m_Blue
);
iconDC.SetPen(pen);
}
iconDC.DrawPoint(jj,ii);
}
}
/* Deselect the Tool Bitmap from DC,
in order to delete the MemoryDC safely without deleting the bitmap */
iconDC.SelectObject( wxNullBitmap );
if ( ! m_HToolBar ) return;
{
m_HToolBar->SetToolNormalBitmap(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap);
}
}
/******************************************/
void WinEDA_PcbFrame::ReCreateHToolbar(void)
/******************************************/
......@@ -122,6 +243,9 @@ int ii;
m_HToolBar->AddSeparator();
ReCreateLayerBox(m_HToolBar);
PrepareLayerIndicator(); // Initialise the bitmap with current active layer colors for the next tool
m_HToolBar->AddTool(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString, * LayerPairBitmap,
_("Show active layer selections\nand select layer pair for route and place via"));
m_HToolBar->AddSeparator();
m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOPLACE, wxEmptyString, BITMAP(mode_module_xpm),
......@@ -409,9 +533,9 @@ wxString msg;
}
/**********************************************************************/
/**************************************************************************/
WinEDAChoiceBox * WinEDA_PcbFrame::ReCreateLayerBox(WinEDA_Toolbar * parent)
/**********************************************************************/
/**************************************************************************/
{
int ii, jj, ll;
bool rebuild = FALSE;
......@@ -425,7 +549,7 @@ long current_mask_layer;
parent->AddControl(m_SelLayerBox);
}
// Test si reconstruction de la liste ncessaire
// Test si reconstruction de la liste necessaire
current_mask_layer = 0;
int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount-1];
Masque_Layer |= ALL_NO_CU_LAYERS;
......
/////////////////////////////////////////////////////////////////////////////
// Name: win_eda_cleaningoptionsframe.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 13:39:29
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 13:39:29
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "win_eda_cleaningoptionsframe.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 "win_eda_cleaningoptionsframe.h"
////@begin XPM images
////@end XPM images
/*!
* Win_EDA_CleaningOptionsFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( Win_EDA_CleaningOptionsFrame, wxDialog )
/*!
* Win_EDA_CleaningOptionsFrame event table definition
*/
BEGIN_EVENT_TABLE( Win_EDA_CleaningOptionsFrame, wxDialog )
////@begin Win_EDA_CleaningOptionsFrame event table entries
////@end Win_EDA_CleaningOptionsFrame event table entries
END_EVENT_TABLE()
/*!
* Win_EDA_CleaningOptionsFrame constructors
*/
Win_EDA_CleaningOptionsFrame::Win_EDA_CleaningOptionsFrame()
{
Init();
}
Win_EDA_CleaningOptionsFrame::Win_EDA_CleaningOptionsFrame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Init();
Create(parent, id, caption, pos, size, style);
}
/*!
* Win_EDA_CleaningOptionsFrame creator
*/
bool Win_EDA_CleaningOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin Win_EDA_CleaningOptionsFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end Win_EDA_CleaningOptionsFrame creation
return true;
}
/*!
* Win_EDA_CleaningOptionsFrame destructor
*/
Win_EDA_CleaningOptionsFrame::~Win_EDA_CleaningOptionsFrame()
{
////@begin Win_EDA_CleaningOptionsFrame destruction
////@end Win_EDA_CleaningOptionsFrame destruction
}
/*!
* Member initialisation
*/
void Win_EDA_CleaningOptionsFrame::Init()
{
////@begin Win_EDA_CleaningOptionsFrame member initialisation
m_CleanViasOpt = NULL;
m_MergetSegmOpt = NULL;
m_DeleteNullSegmOpt = NULL;
m_DeleteunconnectedOpt = NULL;
m_ConnectToPadsOpt = NULL;
////@end Win_EDA_CleaningOptionsFrame member initialisation
}
/*!
* Control creation for Win_EDA_CleaningOptionsFrame
*/
void Win_EDA_CleaningOptionsFrame::CreateControls()
{
////@begin Win_EDA_CleaningOptionsFrame content construction
// Generated by DialogBlocks, 25/05/2007 13:58:52 (unregistered)
Win_EDA_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(true);
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(true);
itemStaticBoxSizer4->Add(m_MergetSegmOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DeleteNullSegmOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_DELETE_NULL_SEGM, _("Delete 0 lenght segments"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteNullSegmOpt->SetValue(true);
itemStaticBoxSizer4->Add(m_DeleteNullSegmOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DeleteunconnectedOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteunconnectedOpt->SetValue(true);
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);
itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticBox* itemStaticBoxSizer10Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Static"));
wxStaticBoxSizer* itemStaticBoxSizer10 = new wxStaticBoxSizer(itemStaticBoxSizer10Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton11 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton11->SetDefault();
itemStaticBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add(5, 5, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText13 = new wxStaticText( itemDialog1, wxID_STATIC, _("Infos:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxTextCtrl* itemTextCtrl14 = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(-1, 120), wxTE_MULTILINE );
itemBoxSizer2->Add(itemTextCtrl14, 0, wxGROW|wxALL, 5);
// Set validators
m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias) );
m_MergetSegmOpt->SetValidator( wxGenericValidator(& s_MergeSegments) );
m_DeleteNullSegmOpt->SetValidator( wxGenericValidator(& s_Delete0lenSegm) );
m_DeleteunconnectedOpt->SetValidator( wxGenericValidator(& s_DeleteUnconnectedSegm) );
////@end Win_EDA_CleaningOptionsFrame content construction
}
/*!
* Should we show tooltips?
*/
bool Win_EDA_CleaningOptionsFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap Win_EDA_CleaningOptionsFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin Win_EDA_CleaningOptionsFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end Win_EDA_CleaningOptionsFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon Win_EDA_CleaningOptionsFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin Win_EDA_CleaningOptionsFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end Win_EDA_CleaningOptionsFrame icon retrieval
}
/////////////////////////////////////////////////////////////////////////////
// Name: win_eda_cleaningoptionsframe.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 13:39:29
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 13:39:29
#ifndef _WIN_EDA_CLEANINGOPTIONSFRAME_H_
#define _WIN_EDA_CLEANINGOPTIONSFRAME_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "win_eda_cleaningoptionsframe.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_CHECKBOX_DELETE_NULL_SEGM 10002
#define ID_CHECKBOX1 10005
#define ID_CHECKBOX 10004
#define ID_BUTTON_EXECUTE 10006
#define ID_TEXTCTRL1 10007
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_TITLE _("Cleaning options")
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_IDNAME ID_WIN_EDA_CLEANINGOPTIONSFRAME
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Win_EDA_CleaningOptionsFrame class declaration
*/
class Win_EDA_CleaningOptionsFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( Win_EDA_CleaningOptionsFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
Win_EDA_CleaningOptionsFrame();
Win_EDA_CleaningOptionsFrame( wxWindow* parent, wxWindowID id = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_STYLE );
/// Destructor
~Win_EDA_CleaningOptionsFrame();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin Win_EDA_CleaningOptionsFrame event handler declarations
////@end Win_EDA_CleaningOptionsFrame event handler declarations
////@begin Win_EDA_CleaningOptionsFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end Win_EDA_CleaningOptionsFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin Win_EDA_CleaningOptionsFrame member variables
wxCheckBox* m_CleanViasOpt;
wxCheckBox* m_MergetSegmOpt;
wxCheckBox* m_DeleteNullSegmOpt;
wxCheckBox* m_DeleteunconnectedOpt;
wxCheckBox* m_ConnectToPadsOpt;
////@end Win_EDA_CleaningOptionsFrame member variables
};
#endif
// _WIN_EDA_CLEANINGOPTIONSFRAME_H_
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