KiCad PCB EDA Suite
dialog_find.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KICAD, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 Marco Mattila <marcom99@gmail.com>
5  * Copyright (C) 2006 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
6  * Copyright (C) 1992-2012 Kicad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef DIALOG_FIND_BASE_H
27 #define DIALOG_FIND_BASE_H
28 
29 #include <dialog_find_base.h>
30 #include <boost/function.hpp>
31 
33 {
34 public:
35  DIALOG_FIND( PCB_BASE_FRAME* aParent );
36  void OnInitDialog( wxInitDialogEvent& event ) override;
37  inline BOARD_ITEM* GetItem() const { return foundItem; }
38  void EnableWarp( bool aEnabled );
39  void SetCallback( boost::function<void (BOARD_ITEM*)> aCallback ) { callback = aCallback; }
40 
41 private:
43 
45  static wxString prevSearchString;
46  static bool warpMouse;
48 
49  // Function called when an item is found
50  boost::function<void (BOARD_ITEM*)> callback;
51 
52  void onButtonFindItemClick( wxCommandEvent& event ) override;
53  void onButtonFindMarkerClick( wxCommandEvent& event ) override;
54  void onButtonCloseClick( wxCommandEvent& event ) override;
55  void onClose( wxCloseEvent& event ) override;
56 };
57 
58 #endif /* DIALOG_FIND_BASE_H */
void OnInitDialog(wxInitDialogEvent &event) override
Definition: dialog_find.cpp:61
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
int markerCount
Definition: dialog_find.h:44
void EnableWarp(bool aEnabled)
Definition: dialog_find.cpp:67
void onButtonFindMarkerClick(wxCommandEvent &event) override
BOARD_ITEM * GetItem() const
Definition: dialog_find.h:37
static bool warpMouse
Definition: dialog_find.h:46
DIALOG_FIND(PCB_BASE_FRAME *aParent)
Definition: dialog_find.cpp:47
boost::function< void(BOARD_ITEM *)> callback
Definition: dialog_find.h:50
PCB_BASE_FRAME * parent
Definition: dialog_find.h:42
static wxString prevSearchString
Definition: dialog_find.h:45
BOARD_ITEM * foundItem
Definition: dialog_find.h:47
void onClose(wxCloseEvent &event) override
void SetCallback(boost::function< void(BOARD_ITEM *)> aCallback)
Definition: dialog_find.h:39
void onButtonFindItemClick(wxCommandEvent &event) override
Definition: dialog_find.cpp:79
void onButtonCloseClick(wxCommandEvent &event) override
Definition: dialog_find.cpp:73
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
Class DIALOG_FIND_BASE.