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.

122 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-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. // The name (for wxWidgets) of the footprint viewer frame
  31. #define FOOTPRINTVIEWER_FRAME_NAME wxT( "FootprintViewerFrame" )
  32. /**
  33. * DISPLAY_FOOTPRINTS_FRAME
  34. * is used to display footprints.
  35. */
  36. class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
  37. {
  38. bool m_autoZoom;
  39. double m_lastZoom;
  40. public:
  41. DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
  42. ~DISPLAY_FOOTPRINTS_FRAME() override;
  43. void OnCloseWindow( wxCloseEvent& Event ) 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. /**
  55. * update the gal canvas (view, colors ...)
  56. */
  57. void updateView();
  58. void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
  59. void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
  60. WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override;
  61. /// Updates the GAL with display settings changes
  62. void ApplyDisplaySettingsToGAL();
  63. ///> @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
  64. void UpdateMsgPanel() override;
  65. bool GetAutoZoom() const { return m_autoZoom; }
  66. void SetAutoZoom( bool aEnable ) { m_autoZoom = aEnable; }
  67. /**
  68. * Function GetGridColor() , virtual
  69. * @return the color of the grid
  70. */
  71. COLOR4D GetGridColor() override;
  72. void InstallOptionsDisplay( wxCommandEvent& event );
  73. MODULE* Get_Module( const wxString& CmpName );
  74. /* SaveCopyInUndoList() virtual
  75. * currently: do nothing in CvPcb.
  76. * but but be defined because it is a pure virtual in PCB_BASE_FRAME
  77. */
  78. void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
  79. const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
  80. {
  81. }
  82. /**
  83. * Function SaveCopyInUndoList (overloaded).
  84. * Creates a new entry in undo list of commands.
  85. * add a list of pickers to handle a list of items
  86. * @param aItemsList = the list of items modified by the command to undo
  87. * @param aTypeCommand = command type (see enum UNDO_REDO_T)
  88. * @param aTransformPoint = the reference point of the transformation,
  89. * for commands like move
  90. */
  91. void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO_T aTypeCommand,
  92. const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
  93. {
  94. // currently: do nothing in CvPcb.
  95. }
  96. void SyncToolbars() override;
  97. DECLARE_EVENT_TABLE()
  98. };
  99. #endif // DISPLAY_FOOTPRINTS_FRAME_H