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.

108 lines
3.3 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-2022 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. PCB_VIEWERS_SETTINGS_BASE* GetViewerSettingsBase() const override;
  63. MAGNETIC_SETTINGS* GetMagneticItemsSettings() override;
  64. ///< @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
  65. void UpdateMsgPanel() override;
  66. COLOR_SETTINGS* GetColorSettings( bool aForceRefresh = false ) const override;
  67. /**
  68. * @return the color of the grid.
  69. */
  70. COLOR4D GetGridColor() override;
  71. FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
  72. void SaveCopyInUndoList( EDA_ITEM*, UNDO_REDO ) override {}
  73. void SaveCopyInUndoList( const PICKED_ITEMS_LIST&, UNDO_REDO ) override {}
  74. void AppendCopyToUndoList( const PICKED_ITEMS_LIST&, UNDO_REDO ) override {}
  75. SELECTION& GetCurrentSelection() override;
  76. DECLARE_EVENT_TABLE()
  77. protected:
  78. void setupUIConditions() override;
  79. private:
  80. wxString m_currentFootprint;
  81. COMPONENT* m_currentComp;
  82. };
  83. #endif // DISPLAY_FOOTPRINTS_FRAME_H