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.

139 lines
4.4 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-2018 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_FRAME
  36. * is used to display footprints.
  37. */
  38. class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
  39. {
  40. public:
  41. DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
  42. ~DISPLAY_FOOTPRINTS_FRAME() override;
  43. void doCloseWindow() override;
  44. void ReCreateHToolbar() override;
  45. void ReCreateVToolbar() override;
  46. void ReCreateOptToolbar() override;
  47. /**
  48. * Function InitDisplay
  49. * Refresh the full display for this frame:
  50. * Set the title, the status line and redraw the canvas
  51. * Must be called after the footprint to display is modifed
  52. */
  53. void InitDisplay();
  54. ///> @copydoc PCB_BASE_FRAME::GetModel()
  55. BOARD_ITEM_CONTAINER* GetModel() const override;
  56. /**
  57. * update the gal canvas (view, colors ...)
  58. */
  59. void updateView();
  60. void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
  61. void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
  62. WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override;
  63. MAGNETIC_SETTINGS* GetMagneticItemsSettings() override;
  64. ///> @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
  65. void UpdateMsgPanel() override;
  66. COLOR_SETTINGS* GetColorSettings() override;
  67. /**
  68. * Function GetGridColor() , virtual
  69. * @return the color of the grid
  70. */
  71. COLOR4D GetGridColor() override;
  72. FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
  73. /* SaveCopyInUndoList() virtual
  74. * currently: do nothing in CvPcb.
  75. * but but be defined because it is a pure virtual in PCB_BASE_FRAME
  76. */
  77. void SaveCopyInUndoList( EDA_ITEM* aItemToCopy, UNDO_REDO aTypeCommand = UNDO_REDO::UNSPECIFIED,
  78. const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
  79. {
  80. }
  81. /**
  82. * Function SaveCopyInUndoList (overloaded).
  83. * Creates a new entry in undo list of commands.
  84. * add a list of pickers to handle a list of items
  85. * @param aItemsList = the list of items modified by the command to undo
  86. * @param aTypeCommand = command type (see enum UNDO_REDO)
  87. * @param aTransformPoint = the reference point of the transformation,
  88. * for commands like move
  89. */
  90. void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
  91. const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
  92. {
  93. // currently: do nothing in CvPcb.
  94. }
  95. /**
  96. * Set if the canvas should automatically zoom to the footprint on load.
  97. *
  98. * @param aAutoZoom is true if it should automatically zoom
  99. */
  100. void SetAutoZoom( bool aAutoZoom ) override;
  101. /**
  102. * Get if the canvas should automatically zoom to the footprint on load.
  103. *
  104. * @return true if it should automatically zoom
  105. */
  106. bool GetAutoZoom() override;
  107. SELECTION& GetCurrentSelection() override;
  108. DECLARE_EVENT_TABLE()
  109. protected:
  110. void setupUIConditions() override;
  111. };
  112. #endif // DISPLAY_FOOTPRINTS_FRAME_H