Memory allocation improvements and other minor fixes.

* Replace C malloc() and free() functions with C++ new and delete
  operators or the appropriate STL container.
* Add option to end mouse capture function to skip executing the end
  mouse capture callback.
* Lots of coding policy and Doxygen comment goodness.
This commit is contained in:
Wayne Stambaugh
2011-11-10 10:55:05 -05:00
parent 7bd8284661
commit cc7e7fc5ca
32 changed files with 1071 additions and 841 deletions
+32 -8
View File
@@ -1,7 +1,32 @@
/****************************************************/
/* block_module_editor.cpp */
/* Handle block commands for the footprint editor */
/****************************************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, [email protected]
* Copyright (C) 2011 Wayne Stambaugh <[email protected]>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.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
*/
/**
* @file block_module_editor.cpp
* @brief Footprint editor block handling implementation.
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
@@ -194,8 +219,8 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
GetScreen()->ClearBlockCommand();
SetCurItem( NULL );
DrawPanel->SetMouseCapture( NULL, NULL );
SetToolID( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString,
false );
DrawPanel->Refresh( true );
}
@@ -264,9 +289,8 @@ void FOOTPRINT_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
SetCurItem( NULL );
DrawPanel->SetMouseCapture( NULL, NULL );
DrawPanel->EndMouseCapture( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString, false );
DrawPanel->Refresh( true );
SetToolID( GetToolId(), DrawPanel->GetCurrentCursor(), wxEmptyString );
}