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.

133 lines
4.0 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2018 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
  5. * Copyright (C) 2007-2021 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file display_footprints_frame.h
  26. */
  27. #ifndef DISPLAY_FOOTPRINTS_FRAME_H
  28. #define DISPLAY_FOOTPRINTS_FRAME_H
  29. #include <pcb_base_frame.h>
  30. #include <pcbnew_settings.h>
  31. class REPORTER;
  32. // The name (for wxWidgets) of the footprint viewer frame
  33. #define FOOTPRINTVIEWER_FRAME_NAME wxT( "FootprintViewerFrame" )
  34. /**
  35. * Display footprints.
  36. */
  37. class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
  38. {
  39. public:
  40. DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
  41. ~DISPLAY_FOOTPRINTS_FRAME() override;
  42. void doCloseWindow() override;
  43. void ReCreateHToolbar() override;
  44. void ReCreateVToolbar() override;
  45. void ReCreateOptToolbar() override;
  46. void UpdateToolbarControlSizes() override;
  47. /**
  48. * Refresh the full display for this frame:
  49. * Set the title, the status line and redraw the canvas
  50. * Must be called after the footprint to display is modified
  51. */
  52. void InitDisplay();
  53. ///< @copydoc PCB_BASE_FRAME::GetModel()
  54. BOARD_ITEM_CONTAINER* GetModel() const override;
  55. /**
  56. * Update the gal canvas (view, colors ...).
  57. */
  58. void updateView();
  59. void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
  60. void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
  61. WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override;
  62. MAGNETIC_SETTINGS* GetMagneticItemsSettings() override;
  63. ///< @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
  64. void UpdateMsgPanel() override;
  65. COLOR_SETTINGS* GetColorSettings() const override;
  66. /**
  67. * @return the color of the grid.
  68. */
  69. COLOR4D GetGridColor() override;
  70. FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
  71. /**
  72. * Does nothing in CvPcb but defined because it is a pure virtual in #PCB_BASE_FRAME.
  73. */
  74. void SaveCopyInUndoList( EDA_ITEM* aItemToCopy, UNDO_REDO aTypeCommand = UNDO_REDO::UNSPECIFIED ) override
  75. {
  76. }
  77. /**
  78. * Create a new entry in undo list of commands.
  79. *
  80. * Add a list of pickers to handle a list of items.
  81. *
  82. * @param aItemsList is the list of items modified by the command to undo
  83. * @param aTypeCommand is command type (see enum UNDO_REDO)
  84. */
  85. void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand ) override
  86. {
  87. // currently: do nothing in CvPcb.
  88. }
  89. /**
  90. * Set if the canvas should automatically zoom to the footprint on load.
  91. *
  92. * @param aAutoZoom is true if it should automatically zoom
  93. */
  94. void SetAutoZoom( bool aAutoZoom ) override;
  95. /**
  96. * Get if the canvas should automatically zoom to the footprint on load.
  97. *
  98. * @return true if it should automatically zoom
  99. */
  100. bool GetAutoZoom() override;
  101. SELECTION& GetCurrentSelection() override;
  102. DECLARE_EVENT_TABLE()
  103. protected:
  104. void setupUIConditions() override;
  105. };
  106. #endif // DISPLAY_FOOTPRINTS_FRAME_H