2018-08-06 18:26:37 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2021-01-26 15:23:37 +00:00
|
|
|
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2018-08-06 18:26:37 +00:00
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-07-18 20:32:12 +00:00
|
|
|
#ifndef CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL_H_
|
|
|
|
#define CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL_H_
|
2018-08-06 18:26:37 +00:00
|
|
|
|
2019-07-18 20:32:12 +00:00
|
|
|
#include <display_footprints_frame.h>
|
2018-08-06 18:26:37 +00:00
|
|
|
|
2019-05-14 11:14:00 +00:00
|
|
|
#include <tool/action_menu.h>
|
2018-08-06 18:26:37 +00:00
|
|
|
#include <tool/selection.h>
|
2019-07-18 20:32:12 +00:00
|
|
|
#include <tool/tool_interactive.h>
|
2018-08-06 18:26:37 +00:00
|
|
|
#include <tool/tool_menu.h>
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-18 20:32:12 +00:00
|
|
|
* Selection tool for the footprint viewer in cvpcb.
|
2018-08-06 18:26:37 +00:00
|
|
|
*/
|
2019-07-18 20:32:12 +00:00
|
|
|
class CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL : public TOOL_INTERACTIVE
|
2018-08-06 18:26:37 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-07-18 20:32:12 +00:00
|
|
|
CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL();
|
|
|
|
~CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL() {}
|
2018-08-06 18:26:37 +00:00
|
|
|
|
|
|
|
/// @copydoc TOOL_BASE::Init()
|
|
|
|
bool Init() override;
|
|
|
|
|
|
|
|
/// @copydoc TOOL_BASE::Reset()
|
|
|
|
void Reset( RESET_REASON aReason ) override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The main loop.
|
|
|
|
*/
|
|
|
|
int Main( const TOOL_EVENT& aEvent );
|
|
|
|
|
2019-06-02 14:34:19 +00:00
|
|
|
/**
|
|
|
|
* Selections aren't currently supported in the footprint viewer.
|
2018-08-06 18:26:37 +00:00
|
|
|
*/
|
2019-07-18 20:32:12 +00:00
|
|
|
SELECTION& GetSelection()
|
|
|
|
{
|
|
|
|
return m_selection;
|
|
|
|
}
|
|
|
|
|
|
|
|
void clearSelection() {}
|
2018-08-06 18:26:37 +00:00
|
|
|
|
2020-05-22 18:27:05 +00:00
|
|
|
/**
|
|
|
|
* Update the menu to reflect the current tool states.
|
|
|
|
*
|
|
|
|
* @param aEvent is the event generated by the tool framework
|
|
|
|
*/
|
|
|
|
int UpdateMenu( const TOOL_EVENT& aEvent );
|
2018-08-06 18:26:37 +00:00
|
|
|
|
2021-01-26 15:23:37 +00:00
|
|
|
///< Sets up handlers for various events.
|
2018-08-06 18:26:37 +00:00
|
|
|
void setTransitions() override;
|
|
|
|
|
|
|
|
private:
|
2019-07-18 20:32:12 +00:00
|
|
|
/// Pointer to the parent frame.
|
2018-08-06 18:26:37 +00:00
|
|
|
DISPLAY_FOOTPRINTS_FRAME* m_frame;
|
|
|
|
|
|
|
|
/// Current state of selection (not really used: no selection in display footprints frame).
|
|
|
|
SELECTION m_selection;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|