From 5d5eb7d38c6a2a64c97946cb5c2c57a3c8764789 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 16 Apr 2012 14:56:01 +0200 Subject: [PATCH] Fix a serious bug in EDA_RECT::Intersects Kicad manager: code cleaning. Dead code removed and minor fixes. support of new .kicad_brd extension. --- common/base_struct.cpp | 4 +- kicad/class_treeproject_item.cpp | 9 +- kicad/class_treeprojectfiles.cpp | 27 +- kicad/commandframe.cpp | 25 + kicad/files-io.cpp | 29 +- kicad/kicad.h | 3 +- kicad/prjconfig.cpp | 2 +- kicad/tree_project_frame.cpp | 116 +- kicad/tree_project_frame.h | 59 +- pcbnew/class_drawsegment.cpp | 78 +- pcbnew/dialogs/dialog_block_options_base.fbp | 1054 ++++++++--------- ...ialog_general_options_BoardEditor_base.fbp | 60 +- pcbnew/dialogs/dialog_mask_clearance_base.fbp | 2 +- ...nvert_brd_items_to_polygons_with_Boost.cpp | 2 +- 14 files changed, 711 insertions(+), 759 deletions(-) diff --git a/common/base_struct.cpp b/common/base_struct.cpp index c5cdb74ea1..c6c9e74fd7 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -344,11 +344,11 @@ bool EDA_RECT::Intersects( const EDA_RECT& aRect ) const // calculate the left common area coordinate: int left = MAX( me.m_Pos.x, rect.m_Pos.x ); // calculate the right common area coordinate: - int right = MIN( me.m_Pos.x + m_Size.x, rect.m_Pos.x + rect.m_Size.x ); + int right = MIN( me.m_Pos.x + me.m_Size.x, rect.m_Pos.x + rect.m_Size.x ); // calculate the upper common area coordinate: int top = MAX( me.m_Pos.y, aRect.m_Pos.y ); // calculate the lower common area coordinate: - int bottom = MIN( me.m_Pos.y + m_Size.y, rect.m_Pos.y + rect.m_Size.y ); + int bottom = MIN( me.m_Pos.y + me.m_Size.y, rect.m_Pos.y + rect.m_Size.y ); // if a common area exists, it must have a positive (null accepted) size if( left <= right && top <= bottom ) diff --git a/kicad/class_treeproject_item.cpp b/kicad/class_treeproject_item.cpp index 0003280da3..1a86ba9a02 100644 --- a/kicad/class_treeproject_item.cpp +++ b/kicad/class_treeproject_item.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -214,8 +215,9 @@ bool TREEPROJECT_ITEM::Delete( bool check ) /*******************************************/ /* delete a file */ { - wxMessageDialog dialog( m_Parent, - _ ("Do you really want to delete ") + GetFileName(), + wxString msg; + msg.Printf( _("Do you really want to delete '%s'"), GetChars(GetFileName() ) ); + wxMessageDialog dialog( m_Parent, msg, _( "Delete File" ), wxYES_NO | wxICON_QUESTION ); if( !check || wxID_YES == dialog.ShowModal() ) @@ -264,7 +266,8 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe ) ExecuteFile( m_Parent, EESCHEMA_EXE, FullFileName ); break; - case TREE_PCB: + case TREE_LEGACY_PCB: + case TREE_SEXP_PCB: ExecuteFile( m_Parent, PCBNEW_EXE, FullFileName ); break; diff --git a/kicad/class_treeprojectfiles.cpp b/kicad/class_treeprojectfiles.cpp index 9cf484db70..5c8ee42768 100644 --- a/kicad/class_treeprojectfiles.cpp +++ b/kicad/class_treeprojectfiles.cpp @@ -2,6 +2,30 @@ * @file class_treeprojectfiles.cpp * this is the wxTreeCtrl that shows a KiCad tree project files */ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2004-2012 Jean-Pierre Charras + * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + #include @@ -38,7 +62,8 @@ TREEPROJECTFILES::TREEPROJECTFILES( TREE_PROJECT_FRAME* parent ) : m_ImageList->Add( KiBitmap( kicad_icon_small_xpm ) ); // TREE_PROJECT m_ImageList->Add( KiBitmap( eeschema_xpm ) ); // TREE_SCHEMA - m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_PCB + m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_LEGACY_PCB + m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_SFMT_PCB m_ImageList->Add( KiBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER m_ImageList->Add( KiBitmap( datasheet_xpm ) ); // TREE_PDF m_ImageList->Add( KiBitmap( icon_txt_xpm ) ); // TREE_TXT diff --git a/kicad/commandframe.cpp b/kicad/commandframe.cpp index 51ed272674..c0aa77eda3 100644 --- a/kicad/commandframe.cpp +++ b/kicad/commandframe.cpp @@ -3,6 +3,31 @@ * @brief Frame showing fast launch buttons and messages box */ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2004-2012 Jean-Pierre Charras + * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + #include #include diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index 9aec929a5d..a3d54ee80f 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -2,9 +2,29 @@ /* files-io.cpp */ /****************/ -#ifdef __GNUG__ -#pragma implementation -#endif +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2004-2012 Jean-Pierre Charras + * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ #include #include @@ -110,7 +130,8 @@ void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event ) { /* List of file extensions to save. */ static const wxChar* extentionList[] = { - wxT( "*.sch" ), wxT( "*.lib" ), wxT( "*.cmp" ), wxT( "*.brd" ), + wxT( "*.sch" ), wxT( "*.lib" ), wxT( "*.cmp" ), + wxT( "*.brd" ), wxT( "*.kicad_brd" ), wxT( "*.net" ), wxT( "*.pro" ), wxT( "*.pho" ), wxT( "*.py" ), wxT( "*.pdf" ), wxT( "*.txt" ), wxT( "*.dcm" ), NULL diff --git a/kicad/kicad.h b/kicad/kicad.h index d98c33406e..18d9729fa7 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -157,7 +157,8 @@ public: KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title, enum TreeFileType { TREE_PROJECT = 1, TREE_SCHEMA, // Schematic file (.sch) - TREE_PCB, // board file (.brd) + TREE_LEGACY_PCB, // board file (.brd) legacy format + TREE_SEXP_PCB, // board file (.kicad_brd) new s expression format TREE_GERBER, // Gerber file (.pho, .g*) TREE_PDF, // PDF file (.pdf) TREE_TXT, // ascii text file (.txt) diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index ab2c33c116..95a0698f95 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -6,7 +6,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2004-2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2004-2012 Jean-Pierre Charras * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index a50d2ecc74..e7e4dd7037 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -20,6 +21,8 @@ #include #include +// TODO: use the wxString defined in wildcards_and_files_ext.h, when exists +const wxString PcbSexpFileExtension( wxT("kicad_brd") ); /* Note about the tree project build process: * Building the tree project can be *very* long if there are a lot of subdirectories @@ -39,7 +42,8 @@ const wxChar* s_AllowedExtensionsToList[] = { wxT( "^.*\\.pro$" ), wxT( "^.*\\.pdf$" ), - wxT( "^[^$].*\\.brd$" ), // Pcbnew files + wxT( "^[^$].*\\.brd$" ), // Legacy Pcbnew files + wxT( "^[^$].*\\.kicad_brd$" ), // S format Pcbnew files wxT( "^.*\\.net$" ), wxT( "^.*\\.txt$" ), wxT( "^.*\\.pho$" ), // Gerber file (Kicad extension) @@ -89,7 +93,7 @@ BEGIN_EVENT_TABLE( TREE_PROJECT_FRAME, wxSashLayoutWindow ) EVT_TREE_BEGIN_DRAG( ID_PROJECT_TREE, TREE_PROJECT_FRAME::OnDragStart ) EVT_TREE_END_DRAG( ID_PROJECT_TREE, TREE_PROJECT_FRAME::OnDragEnd ) EVT_MENU( ID_PROJECT_TXTEDIT, TREE_PROJECT_FRAME::OnTxtEdit ) - EVT_MENU( ID_PROJECT_NEWDIR, TREE_PROJECT_FRAME::OnNewDirectory ) + EVT_MENU( ID_PROJECT_NEWDIR, TREE_PROJECT_FRAME::OnCreateNewDirectory ) EVT_MENU( ID_PROJECT_DELETE, TREE_PROJECT_FRAME::OnDeleteFile ) EVT_MENU( ID_PROJECT_RENAME, TREE_PROJECT_FRAME::OnRenameFile ) END_EVENT_TABLE() @@ -155,12 +159,11 @@ TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent ) : menu = m_ContextMenus[i]; // ID_PROJECT_RENAME - item = new wxMenuItem( menu, - ID_PROJECT_RENAME, + item = new wxMenuItem( menu, ID_PROJECT_RENAME, TREE_DIRECTORY != i ? _( "&Rename file" ) : _( "&Rename directory" ), TREE_DIRECTORY != i ? _( "Rename file" ) : - _( "&Rename directory" ) ); + _( "Rename directory" ) ); item->SetBitmap( KiBitmap( right_xpm ) ); menu->Append( item ); @@ -182,7 +185,7 @@ TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent ) : TREE_DIRECTORY != i ? _( "&Delete File" ) : _( "&Delete Directory" ), TREE_DIRECTORY != i ? _( "Delete the File" ) : - _( "&Delete the Directory and its content" ) ); + _( "Delete the Directory and its content" ) ); item->SetBitmap( KiBitmap( delete_xpm ) ); menu->Append( item ); } @@ -321,50 +324,17 @@ wxMenu* TREE_PROJECT_FRAME::GetContextMenu( int type ) /** - * @brief TODO + * Called by the popup menu in the tree frame + * Creates a new subdirectory inside the current kicad project directory + * the user is prompted to enter a directory name */ -/*****************************************************************************/ -void TREE_PROJECT_FRAME::OnNewDirectory( wxCommandEvent& event ) -/*****************************************************************************/ +void TREE_PROJECT_FRAME::OnCreateNewDirectory( wxCommandEvent& event ) { - NewFile( TREE_DIRECTORY ); -} - - -/** - * @brief TODO - */ -/*****************************************************************************/ -void TREE_PROJECT_FRAME::NewFile( TreeFileType type ) -/*****************************************************************************/ -{ - wxString mask = GetFileExt( type ); - wxString wildcard = GetFileWildcard( type ); - - // Get the directory: - wxString dir; - wxString title; - - TREEPROJECT_ITEM* treeData; - - title = ( TREE_DIRECTORY != type ) ? _( "Create New File" ) : - _( "Create New Directory" ); - - treeData = GetSelectedData(); + // Get the root directory name: + TREEPROJECT_ITEM* treeData = GetSelectedData(); if( !treeData ) return; - dir = wxGetCwd() + wxFileName().GetPathSeparator() + treeData->GetDir(); - - // Ask for the new file name - wxString nameless_prj = NAMELESS_PROJECT; - nameless_prj += wxT(".") + mask; - wxFileDialog dlg( this, title, dir, nameless_prj, - wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return; - TreeFileType rootType = treeData->GetType(); wxTreeItemId root; @@ -375,34 +345,31 @@ void TREE_PROJECT_FRAME::NewFile( TreeFileType type ) else { root = m_TreeProject->GetItemParent( m_TreeProject->GetSelection() ); - if( !root.IsOk() ) root = m_TreeProject->GetSelection(); } - NewFile( dlg.GetPath(), type, root ); -} + // Ask for the new sub directory name + wxString curr_dir = treeData->GetDir(); - -/** - * @brief TODO - */ -/*****************************************************************************/ -void TREE_PROJECT_FRAME::NewFile( const wxString& name, - TreeFileType type, - wxTreeItemId& root ) -/*****************************************************************************/ -{ - if( TREE_DIRECTORY != type ) + // Make the current subdir relative to the current path: + if( !curr_dir.IsEmpty() ) // A subdir is selected { - wxFile( name, wxFile::write ); - } - else - { - wxMkdir( name ); + curr_dir += wxFileName::GetPathSeparator(); + curr_dir += wxT("dummy"); + wxFileName fn(curr_dir); + fn.MakeRelativeTo(); + curr_dir = fn.GetPath() + wxFileName::GetPathSeparator(); } + wxString msg; + msg.Printf( wxT("Current working directory:\n%s"), GetChars( wxGetCwd() ) ); + wxString subdir = wxGetTextFromUser( msg, _( "Create New Directory" ), curr_dir ); - AddFile( name, root ); + if( subdir.IsEmpty() ) + return; + + if( wxMkdir( subdir ) ) + AddFileToTree( subdir, root ); } @@ -425,10 +392,14 @@ wxString TREE_PROJECT_FRAME::GetFileExt( TreeFileType type ) ext = SchematicFileExtension; break; - case TREE_PCB: + case TREE_LEGACY_PCB: ext = PcbFileExtension; break; + case TREE_SEXP_PCB: + ext = PcbSexpFileExtension; + break; + case TREE_GERBER: ext = GerberFileExtension; break; @@ -485,7 +456,8 @@ wxString TREE_PROJECT_FRAME::GetFileWildcard( TreeFileType type ) ext = SchematicFileWildcard; break; - case TREE_PCB: + case TREE_LEGACY_PCB: + case TREE_SEXP_PCB: ext = PcbFileWildcard; break; @@ -530,7 +502,7 @@ wxString TREE_PROJECT_FRAME::GetFileWildcard( TreeFileType type ) /** - * Function AddFile + * Function AddFileToTree * @brief Add filename "name" to the tree \n * if name is a directory, add the sub directory file names * @param aName = the filename or the dirctory name to add @@ -539,7 +511,7 @@ wxString TREE_PROJECT_FRAME::GetFileWildcard( TreeFileType type ) * false to stop file add. * @return true if the file (or directory) is added. */ -bool TREE_PROJECT_FRAME::AddFile( const wxString& aName, +bool TREE_PROJECT_FRAME::AddFileToTree( const wxString& aName, wxTreeItemId& aRoot, bool aRecurse ) { wxTreeItemId cellule; @@ -681,7 +653,7 @@ bool TREE_PROJECT_FRAME::AddFile( const wxString& aName, { do // Add name in tree, but do not recurse { - AddFile( aName + sep + dir_filename, cellule, false ); + AddFileToTree( aName + sep + dir_filename, cellule, false ); } while( dir.GetNext( &dir_filename ) ); } @@ -743,7 +715,7 @@ void TREE_PROJECT_FRAME::ReCreateTreePrj() while( cont ) { if( filename != fn.GetFullName() ) - AddFile( dir.GetName() + wxFileName::GetPathSeparator() + + AddFileToTree( dir.GetName() + wxFileName::GetPathSeparator() + filename, m_root ); cont = dir.GetNext( &filename ); @@ -980,7 +952,7 @@ void TREE_PROJECT_FRAME::OnExpand( wxTreeEvent& Event ) { do // Add name to tree item, but do not recurse in subdirs: { - AddFile( fileName + sep + dir_filename, kid, false ); + AddFileToTree( fileName + sep + dir_filename, kid, false ); } while( dir.GetNext( &dir_filename ) ); } itemData->m_WasPopulated = true; // set state to populated diff --git a/kicad/tree_project_frame.h b/kicad/tree_project_frame.h index dca3f49262..942c289f2f 100644 --- a/kicad/tree_project_frame.h +++ b/kicad/tree_project_frame.h @@ -47,9 +47,7 @@ private: protected: wxMenu* GetContextMenu( int type ); - void NewFile( TreeFileType type ); - void NewFile( const wxString& name, TreeFileType type, - wxTreeItemId& root ); + /** * Function GetSelectedData * return the item data from item currently selected (highlighted) @@ -91,63 +89,28 @@ public: void OnDeleteFile( wxCommandEvent& event ); void OnRenameFile( wxCommandEvent& event ); - void OnNewDirectory( wxCommandEvent& event ); - void OnNewPyFile( wxCommandEvent& event ); + /** + * Function OnCreateNewDirectory + * Creates a new subdirectory inside the current kicad project directory + * the user is prompted to enter a directory name + */ + void OnCreateNewDirectory( wxCommandEvent& event ); void ClearFilters(); const std::vector& GetFilters(); void RemoveFilter( const wxString& filter ); -#ifdef KICAD_PYTHON - boost::python::object ToWx(); - - TREE_PROJECT_FRAME() - { - } - - - TREE_PROJECT_FRAME( const TREE_PROJECT_FRAME& ) - { - } - - - void OnRunPy( wxCommandEvent& event ); - - boost::python::object GetMenuPy( TreeFileType ); - - boost::python::object GetFtExPy( TreeFileType ) const; - - void RemoveFilterPy( const boost::python::str& filter ); - void AddFilter( const boost::python::str& filter ); - - boost::python::object GetTreeCtrl(); - TREEPROJECT_ITEM* GetItemData( const boost::python::object& item ); - - void AddFilePy( const boost::python::str& name, - boost::python::object& root ); - void NewFilePy( const boost::python::str& name, - TreeFileType type, - boost::python::object& root ); - - TREEPROJECT_ITEM* FindItemData( const boost::python::str& name ); - - boost::python::object GetCurrentMenu(); - int AddStatePy( boost::python::object& bitmap ); - -#endif - /** - * Function AddFile - * @brief Add filename "name" to the tree \n - * if name is a directory, add the sub directory file names - * @param aName = the filename or the dirctory name to add + * Function AddFileToTree + * @brief Add the file or directory aName to the project tree + * @param aName = the filename or the directory name to add in tree * @param aRoot = the wxTreeItemId item where to add sub tree items * @param aRecurse = true to filenames or sub dir names to the current tree item * false to stop file add. * @return true if the file (or directory) is added. */ - bool AddFile( const wxString& aName, + bool AddFileToTree( const wxString& aName, wxTreeItemId& aRoot, bool aRecurse = true); DECLARE_EVENT_TABLE() diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index b8156747b8..9ec6f74941 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -386,55 +386,55 @@ EDA_RECT DRAWSEGMENT::GetBoundingBox() const switch( m_Shape ) { - case S_SEGMENT: - bbox.SetEnd( m_End ); - bbox.Inflate( (m_Width / 2) + 1 ); - break; + case S_SEGMENT: + bbox.SetEnd( m_End ); + break; - case S_CIRCLE: - bbox.Inflate( GetRadius() + 1 ); - break; + case S_CIRCLE: + bbox.Inflate( GetRadius() ); + break; - case S_ARC: - { - bbox.Merge( m_End ); - wxPoint end = m_End; - RotatePoint( &end, m_Start, -m_Angle ); - bbox.Merge( end ); - } - break; - - case S_POLYGON: - { - wxPoint p_end; - MODULE* module = GetParentModule(); - - for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) + case S_ARC: { - wxPoint pt = m_PolyPoints[ii]; + bbox.Merge( m_End ); + wxPoint end = m_End; + RotatePoint( &end, m_Start, -m_Angle ); + bbox.Merge( end ); + } + break; - if( module ) // Transform, if we belong to a module + case S_POLYGON: + { + wxPoint p_end; + MODULE* module = GetParentModule(); + + for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) { - RotatePoint( &pt, module->GetOrientation() ); - pt += module->m_Pos; + wxPoint pt = m_PolyPoints[ii]; + + if( module ) // Transform, if we belong to a module + { + RotatePoint( &pt, module->GetOrientation() ); + pt += module->m_Pos; + } + + if( ii == 0 ) + p_end = pt; + + bbox.SetX( MIN( bbox.GetX(), pt.x ) ); + bbox.SetY( MIN( bbox.GetY(), pt.y ) ); + p_end.x = MAX( p_end.x, pt.x ); + p_end.y = MAX( p_end.y, pt.y ); } - if( ii == 0 ) - p_end = pt; - - bbox.SetX( MIN( bbox.GetX(), pt.x ) ); - bbox.SetY( MIN( bbox.GetY(), pt.y ) ); - p_end.x = MAX( p_end.x, pt.x ); - p_end.y = MAX( p_end.y, pt.y ); + bbox.SetEnd( p_end ); + break; } - - bbox.SetEnd( p_end ); - bbox.Inflate( 1 ); - break; - } } - bbox.Inflate( (m_Width+1) / 2 ); + bbox.Inflate( ((m_Width+1) / 2) + 1 ); + bbox.Normalize(); + return bbox; } diff --git a/pcbnew/dialogs/dialog_block_options_base.fbp b/pcbnew/dialogs/dialog_block_options_base.fbp index afad8ab928..5dab3a6fdf 100644 --- a/pcbnew/dialogs/dialog_block_options_base.fbp +++ b/pcbnew/dialogs/dialog_block_options_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 source_name @@ -14,9 +14,9 @@ none 1 dialog_block_options_base - + . - + 1 1 0 @@ -27,14 +27,14 @@ 1 1 0 - - - + + + 1 wxBOTH 0 1 - + 1 0 Dock @@ -42,74 +42,74 @@ Left 1 impl_virtual - - + + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 1 DIALOG_BLOCK_OPTIONS_BASE 1 - - + + 1 - - + + Resizable - + 1 397,226 wxDEFAULT_DIALOG_STYLE - - + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + bSizerMain wxVERTICAL none @@ -120,11 +120,11 @@ wxID_ANY Options - + sbSizer1 wxVERTICAL none - + 5 wxEXPAND @@ -132,7 +132,7 @@ 2 0 - + gSizer1 none 4 @@ -146,80 +146,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include modules - + 0 - + 0 - + 1 m_Include_Modules 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -231,80 +231,80 @@ 1 1 1 - - - + + + 1 0 1 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include text items - + 0 - + 0 - + 1 m_Include_PcbTextes 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -316,80 +316,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include locked modules - + 0 - + 0 - + 1 m_IncludeLockedModules 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -401,80 +401,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include drawings - + 0 - + 0 - + 1 m_Include_Draw_Items 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -486,80 +486,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include tracks - + 0 - + 0 - + 1 m_Include_Tracks 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -571,80 +571,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include board outline layer - + 0 - + 0 - + 1 m_Include_Edges_Items 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -656,80 +656,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include zones - + 0 - + 0 - + 1 m_Include_Zones 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -741,80 +741,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Draw selected items while moving - + 0 - + 0 - + 1 m_DrawBlockItems 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -828,77 +828,77 @@ 1 1 1 - - - + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 1 m_staticline1 1 - - + + protected 1 - - + + Resizable - + 1 - + wxLI_HORIZONTAL - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -910,80 +910,80 @@ 1 1 1 - - - + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Include items on invisible layers - + 0 - + 0 - + 1 m_checkBoxIncludeInvisible 1 - - + + protected 1 - - + + Resizable - + 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - + + + + + checkBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -1001,17 +1001,17 @@ 1 0 0 - + m_sdbSizer1 protected - + OnCancel - - - + + + ExecuteCommand - - + + diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp index fa0465708d..ec41ef731a 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp @@ -25,62 +25,28 @@ 1 0 - 1 - 1 - 1 - 1 - 0 - - - - + wxAUI_MGR_DEFAULT - - 1 - 0 - 1 1 - 0 - Dock - 0 - Left 1 impl_virtual - 1 - 0 0 wxID_ANY - - 0 - - 0 - 1 DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE - 1 - - - 1 - Resizable - 1 611,346 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER General settings - 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -478,10 +444,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -567,10 +529,6 @@ 0 Adjust the number of ratsnets shown from cursor to closest pads - - wxFILTER_NONE - wxDefaultValidator - 1 @@ -656,10 +614,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -745,10 +699,6 @@ 0 Delay after the first change to create a backup file of the board on disk. - - wxFILTER_NONE - wxDefaultValidator - 0 @@ -834,10 +784,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - @@ -2111,10 +2057,6 @@ 0 - - wxFILTER_NONE - wxDefaultValidator - diff --git a/pcbnew/dialogs/dialog_mask_clearance_base.fbp b/pcbnew/dialogs/dialog_mask_clearance_base.fbp index c4e8f1a9bf..08645184ce 100644 --- a/pcbnew/dialogs/dialog_mask_clearance_base.fbp +++ b/pcbnew/dialogs/dialog_mask_clearance_base.fbp @@ -1,6 +1,6 @@ - + C++ diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index d3fa83d413..24a34ad036 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -302,7 +302,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) } // Add graphic items (copper texts) and board edges - for( BOARD_ITEM* item = aPcb->m_Drawings; item; item = item->Next() ) + for( BOARD_ITEM* item = aPcb->m_Drawings; item; item = item->Next() ) { if( item->GetLayer() != GetLayer() && item->GetLayer() != EDGE_N ) continue;