2011-12-21 20:21:15 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2021-03-21 17:31:23 +00:00
|
|
|
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@gmail.com>
|
|
|
|
* Copyright (C) 2010-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-12-21 20:21:15 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2010-03-16 18:22:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Subclass of DIALOG_SCH_FIND_BASE, which is generated by wxFormBuilder.
|
|
|
|
*
|
|
|
|
* This dialog is used to define the search criteria used to search for items
|
|
|
|
* in the current schematic. What is searched depends on the schematic item
|
|
|
|
* type. Check the Matches() method for each item derived from SCH_ITEM() to
|
|
|
|
* find out how matching is performed against that item.
|
|
|
|
*/
|
|
|
|
|
2011-12-21 20:21:15 +00:00
|
|
|
#ifndef __dialog_schematic_find__
|
|
|
|
#define __dialog_schematic_find__
|
|
|
|
|
2010-03-16 18:22:59 +00:00
|
|
|
#include "dialog_schematic_find_base.h"
|
|
|
|
|
|
|
|
#include <wx/fdrepdlg.h> // Use the wxFindReplaceDialog events, data, and enums.
|
|
|
|
|
2019-05-19 21:04:04 +00:00
|
|
|
class SCH_EDIT_FRAME;
|
|
|
|
class SCH_EDITOR_CONTROL;
|
|
|
|
|
2010-03-16 18:22:59 +00:00
|
|
|
|
|
|
|
class DIALOG_SCH_FIND : public DIALOG_SCH_FIND_BASE
|
|
|
|
{
|
2021-03-21 17:31:23 +00:00
|
|
|
public:
|
2022-08-05 02:40:38 +00:00
|
|
|
DIALOG_SCH_FIND( SCH_EDIT_FRAME* aParent, SCH_SEARCH_DATA* aData,
|
2021-03-21 17:31:23 +00:00
|
|
|
const wxPoint& aPosition = wxDefaultPosition,
|
|
|
|
const wxSize& aSize = wxDefaultSize, int aStyle = 0 );
|
|
|
|
|
2022-03-18 23:30:45 +00:00
|
|
|
void SetFindEntries( const wxArrayString& aEntries, const wxString& aFindString );
|
2021-03-21 17:31:23 +00:00
|
|
|
wxArrayString GetFindEntries() const;
|
|
|
|
|
|
|
|
void SetReplaceEntries( const wxArrayString& aEntries );
|
|
|
|
wxArrayString GetReplaceEntries() const { return m_comboReplace->GetStrings(); }
|
|
|
|
|
2010-03-16 18:22:59 +00:00
|
|
|
protected:
|
|
|
|
// Handlers for DIALOG_SCH_FIND_BASE events.
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnClose( wxCloseEvent& aEvent ) override;
|
2019-07-20 00:40:26 +00:00
|
|
|
void OnCancel( wxCommandEvent& aEvent ) override;
|
2020-04-18 11:04:52 +00:00
|
|
|
void OnSearchForSelect( wxCommandEvent& aEvent ) override;
|
2019-05-19 21:04:04 +00:00
|
|
|
void OnSearchForText( wxCommandEvent& aEvent ) override;
|
2020-04-18 11:04:52 +00:00
|
|
|
void OnSearchForEnter( wxCommandEvent& event ) override;
|
|
|
|
void OnReplaceWithSelect( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnReplaceWithText( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnReplaceWithEnter( wxCommandEvent& event ) override;
|
2019-05-19 21:04:04 +00:00
|
|
|
void OnOptions( wxCommandEvent& event ) override;
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnUpdateReplaceUI( wxUpdateUIEvent& aEvent ) override;
|
|
|
|
void OnUpdateReplaceAllUI( wxUpdateUIEvent& aEvent ) override;
|
2020-04-18 11:04:52 +00:00
|
|
|
void OnIdle( wxIdleEvent& event ) override;
|
2019-05-19 21:04:04 +00:00
|
|
|
void OnChar( wxKeyEvent& aEvent );
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnFind( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnReplace( wxCommandEvent& aEvent ) override;
|
2010-03-16 18:22:59 +00:00
|
|
|
|
2022-07-09 08:28:53 +00:00
|
|
|
// Rebuild the search flags from dialog settings
|
|
|
|
void updateFlags();
|
|
|
|
|
2019-05-19 21:04:04 +00:00
|
|
|
SCH_EDIT_FRAME* m_frame;
|
|
|
|
SCH_EDITOR_CONTROL* m_editorControl;
|
2022-08-05 02:40:38 +00:00
|
|
|
SCH_SEARCH_DATA* m_findReplaceData;
|
2020-04-18 11:04:52 +00:00
|
|
|
bool m_findDirty;
|
2010-03-16 18:22:59 +00:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS( DIALOG_SCH_FIND )
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __dialog_schematic_find__
|