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.

87 lines
3.4 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2010 Wayne Stambaugh <stambaughw@gmail.com>
  5. * Copyright (C) 2010-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
  26. *
  27. * Subclass of DIALOG_SCH_FIND_BASE, which is generated by wxFormBuilder.
  28. *
  29. * This dialog is used to define the search criteria used to search for items
  30. * in the current schematic. What is searched depends on the schematic item
  31. * type. Check the Matches() method for each item derived from SCH_ITEM() to
  32. * find out how matching is performed against that item.
  33. */
  34. #ifndef __dialog_schematic_find__
  35. #define __dialog_schematic_find__
  36. #include "dialog_schematic_find_base.h"
  37. #include <wx/fdrepdlg.h> // Use the wxFindReplaceDialog events, data, and enums.
  38. class SCH_EDIT_FRAME;
  39. class SCH_EDITOR_CONTROL;
  40. class DIALOG_SCH_FIND : public DIALOG_SCH_FIND_BASE
  41. {
  42. public:
  43. DIALOG_SCH_FIND( SCH_EDIT_FRAME* aParent, wxFindReplaceData* aData,
  44. const wxPoint& aPosition = wxDefaultPosition,
  45. const wxSize& aSize = wxDefaultSize, int aStyle = 0 );
  46. void SetFindEntries( const wxArrayString& aEntries );
  47. wxArrayString GetFindEntries() const;
  48. void SetReplaceEntries( const wxArrayString& aEntries );
  49. wxArrayString GetReplaceEntries() const { return m_comboReplace->GetStrings(); }
  50. protected:
  51. // Handlers for DIALOG_SCH_FIND_BASE events.
  52. void OnClose( wxCloseEvent& aEvent ) override;
  53. void OnCancel( wxCommandEvent& aEvent ) override;
  54. void OnSearchForSelect( wxCommandEvent& aEvent ) override;
  55. void OnSearchForText( wxCommandEvent& aEvent ) override;
  56. void OnSearchForEnter( wxCommandEvent& event ) override;
  57. void OnReplaceWithSelect( wxCommandEvent& aEvent ) override;
  58. void OnReplaceWithText( wxCommandEvent& aEvent ) override;
  59. void OnReplaceWithEnter( wxCommandEvent& event ) override;
  60. void OnOptions( wxCommandEvent& event ) override;
  61. void OnUpdateReplaceUI( wxUpdateUIEvent& aEvent ) override;
  62. void OnUpdateReplaceAllUI( wxUpdateUIEvent& aEvent ) override;
  63. void OnIdle( wxIdleEvent& event ) override;
  64. void OnChar( wxKeyEvent& aEvent );
  65. void OnFind( wxCommandEvent& aEvent ) override;
  66. void OnReplace( wxCommandEvent& aEvent ) override;
  67. SCH_EDIT_FRAME* m_frame;
  68. SCH_EDITOR_CONTROL* m_editorControl;
  69. wxFindReplaceData* m_findReplaceData;
  70. bool m_findDirty;
  71. DECLARE_NO_COPY_CLASS( DIALOG_SCH_FIND )
  72. };
  73. #endif // __dialog_schematic_find__