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.

96 lines
3.0 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
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 3
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, you may find one here:
  18. * https://www.gnu.org/licenses/gpl-3.0.html
  19. * or you may write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  21. */
  22. #ifndef __SYMBOL_DIFF_FRAME_H_
  23. #define __SYMBOL_DIFF_FRAME_H_
  24. #include <sch_base_frame.h>
  25. /**
  26. * Symbol library viewer main window.
  27. */
  28. class SYMBOL_DIFF_FRAME : public SCH_BASE_FRAME
  29. {
  30. public:
  31. /**
  32. * @param aKiway
  33. * @param aParent is the parent frame of the viewer.
  34. * @param aFrameType must be either #FRAME_SCH_LIB_VIEWER or #FRAME_SCH_LIB_VIEWER_MODAL.
  35. * @param aLibrary is the library to open when starting (default = NULL).
  36. */
  37. SYMBOL_DIFF_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
  38. const wxString& aLibraryName = wxEmptyString );
  39. ~SYMBOL_DIFF_FRAME();
  40. /**
  41. * Runs the symbol viewer as a modal dialog.
  42. *
  43. * @param aSymbol an optional FPID string to initialize the viewer with and to
  44. * return a selected footprint through.
  45. */
  46. bool ShowModal( wxString* aSymbol, wxWindow* aParent ) override;
  47. /**
  48. * Send the selected symbol back to the caller.
  49. */
  50. void FinishModal();
  51. void OnSize( wxSizeEvent& event ) override;
  52. void doCloseWindow() override;
  53. void ReCreateHToolbar() override;
  54. void ReCreateVToolbar() override;
  55. void ReCreateOptToolbar() override {}
  56. void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
  57. void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
  58. WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override;
  59. void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
  60. const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
  61. SELECTION& GetCurrentSelection() override;
  62. void KiwayMailIn( KIWAY_EXPRESS& mail ) override;
  63. protected:
  64. void setupUIConditions() override;
  65. void doReCreateMenuBar() override;
  66. private:
  67. // Set up the tool framework.
  68. void setupTools();
  69. /**
  70. * Called when the frame is activated to reload the libraries and symbol lists
  71. * that can be changed by the schematic editor or the library editor.
  72. */
  73. void OnActivate( wxActivateEvent& event );
  74. DECLARE_EVENT_TABLE()
  75. };
  76. #endif