You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.2 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software: you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation, either version 3 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL_H_
  20. #define CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL_H_
  21. #include <display_footprints_frame.h>
  22. #include <tool/action_menu.h>
  23. #include <tool/selection.h>
  24. #include <tool/tool_interactive.h>
  25. #include <tool/tool_menu.h>
  26. /**
  27. * Selection tool for the footprint viewer in CvPcb.
  28. */
  29. class CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL : public TOOL_INTERACTIVE
  30. {
  31. public:
  32. CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL();
  33. ~CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL() {}
  34. /// @copydoc TOOL_BASE::Init()
  35. bool Init() override;
  36. /// @copydoc TOOL_BASE::Reset()
  37. void Reset( RESET_REASON aReason ) override;
  38. /**
  39. * The main loop.
  40. */
  41. int Main( const TOOL_EVENT& aEvent );
  42. /**
  43. * Selections aren't currently supported in the footprint viewer.
  44. */
  45. SELECTION& GetSelection()
  46. {
  47. return m_selection;
  48. }
  49. void clearSelection() {}
  50. /**
  51. * Update the menu to reflect the current tool states.
  52. *
  53. * @param aEvent is the event generated by the tool framework.
  54. */
  55. int UpdateMenu( const TOOL_EVENT& aEvent );
  56. /// Set up handlers for various events.
  57. void setTransitions() override;
  58. private:
  59. /// Pointer to the parent frame.
  60. DISPLAY_FOOTPRINTS_FRAME* m_frame;
  61. /// Current state of selection (not really used: no selection in display footprints frame).
  62. SELECTION m_selection;
  63. };
  64. #endif