Commit ee80c7f6 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Some more reformatting and adding copyright notices.

parent 62ea71fc
Loading
Loading
Loading
Loading
+46 −18
Original line number Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2013 CERN
 * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
 *
 * 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 <wx/wx.h>
#include <wx/menu.h>

@@ -41,12 +65,14 @@ CONTEXT_MENU::CONTEXT_MENU ( )
	m_titleSet = false;
}


CONTEXT_MENU::~CONTEXT_MENU()
{
	delete m_menu;
	delete m_handler;
}


void CONTEXT_MENU::SetTitle( const wxString& aTitle )
{
	if( m_titleSet )
@@ -60,11 +86,13 @@ void CONTEXT_MENU::SetTitle( const wxString& aTitle )
	m_titleSet = true;
}


void CONTEXT_MENU::Add ( const wxString& aItem, int aId )
{
	m_menu->Append( new wxMenuItem( m_menu, aId, aItem, wxEmptyString, wxITEM_NORMAL ) );
}


void CONTEXT_MENU::Clear()
{
	m_titleSet = false;
+33 −6
Original line number Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2013 CERN
 * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
 *
 * 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 <tool/tool_event.h>
#include <tool/tool_manager.h>

@@ -6,16 +30,19 @@ KiGfx::VIEW *TOOL_BASE::getView()
	return m_toolMgr->GetView();
}


KiGfx::VIEW_CONTROLS* TOOL_BASE::getViewControls()
{	
	return m_toolMgr->GetViewControls();
}


wxWindow* TOOL_BASE::getEditFrameInt()
{
	return m_toolMgr->GetEditFrame();
}


EDA_ITEM* TOOL_BASE::getModelInt()
{
	return m_toolMgr->GetModel();
+69 −41
Original line number Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2013 CERN
 * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
 *
 * 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 <cstring>
#include <string>

@@ -10,11 +34,13 @@

using namespace std;

struct FlagString {
struct FlagString
{
	int flag;		
	std::string str;
};


static const std::string flag2string( int flag, const FlagString* exps )
{
	std::string rv;
@@ -24,6 +50,7 @@ static const std::string flag2string(int flag, const FlagString *exps)
	return rv;
}


const std::string TOOL_EVENT::Format() const
{
	std::string ev;
@@ -90,6 +117,7 @@ const std::string TOOL_EVENT::Format() const
	return ev;
}


const std::string TOOL_EVENT_LIST::Format() const
{
	string s;
+37 −10
Original line number Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2013 CERN
 * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
 *
 * 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 <string>

#include <tool/tool_event.h>
@@ -9,6 +33,7 @@ TOOL_INTERACTIVE::TOOL_INTERACTIVE( TOOL_ID aId, const std::string& aName ):
	TOOL_BASE( TOOL_Interactive, aId, aName )
	{};


TOOL_INTERACTIVE::TOOL_INTERACTIVE( const std::string& aName ) :
	TOOL_BASE( TOOL_Interactive, TOOL_MANAGER::MakeToolId( aName ), aName )
	{};
@@ -16,24 +41,26 @@ TOOL_INTERACTIVE::TOOL_INTERACTIVE( const std::string& aName ):

TOOL_INTERACTIVE::~TOOL_INTERACTIVE()
{

}


OPT_TOOL_EVENT TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST & aEventList )
{
	return m_toolMgr->ScheduleWait( this, aEventList );
}


void TOOL_INTERACTIVE::goInternal( TOOL_STATE_FUNC& aState, const TOOL_EVENT_LIST& aConditions )
{
	m_toolMgr->ScheduleNextState( this, aState, aConditions );
}


void TOOL_INTERACTIVE::Reset()
{

}


void TOOL_INTERACTIVE::SetContextMenu( CONTEXT_MENU *aMenu, TOOL_ContextMenuTrigger aTrigger )
{
	aMenu->setTool( this );
+7 −8
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ public:
	}

private:

	class CMEventHandler;
	
	friend class TOOL_INTERACTIVE;
Loading