Loading common/tool/context_menu.cpp +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> Loading Loading @@ -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 ) Loading @@ -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; Loading common/tool/tool_base.cpp +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> Loading @@ -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(); Loading common/tool/tool_event.cpp +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> Loading @@ -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; Loading @@ -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; Loading Loading @@ -90,6 +117,7 @@ const std::string TOOL_EVENT::Format() const return ev; } const std::string TOOL_EVENT_LIST::Format() const { string s; Loading common/tool/tool_interactive.cpp +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> Loading @@ -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 ) {}; Loading @@ -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 ); Loading include/tool/context_menu.h +7 −8 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public: } private: class CMEventHandler; friend class TOOL_INTERACTIVE; Loading Loading
common/tool/context_menu.cpp +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> Loading Loading @@ -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 ) Loading @@ -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; Loading
common/tool/tool_base.cpp +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> Loading @@ -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(); Loading
common/tool/tool_event.cpp +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> Loading @@ -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; Loading @@ -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; Loading Loading @@ -90,6 +117,7 @@ const std::string TOOL_EVENT::Format() const return ev; } const std::string TOOL_EVENT_LIST::Format() const { string s; Loading
common/tool/tool_interactive.cpp +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> Loading @@ -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 ) {}; Loading @@ -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 ); Loading
include/tool/context_menu.h +7 −8 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public: } private: class CMEventHandler; friend class TOOL_INTERACTIVE; Loading