KiCad PCB EDA Suite
dialog_choose_footprint.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) 2014 Henner Zeller <h.zeller@acm.org>
5  * Copyright (C) 2014-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 #ifndef DIALOG_CHOOSE_FOOTPRINT_H
25 #define DIALOG_CHOOSE_FOOTPRINT_H
26 
27 #include "dialog_shim.h"
28 #include <fp_tree_model_adapter.h>
29 #include <footprint_info.h>
31 
32 class wxStaticBitmap;
33 class wxTextCtrl;
34 class wxStdDialogButtonSizer;
35 class wxDataViewCtrl;
36 class wxHtmlWindow;
37 class wxHtmlLinkEvent;
38 class wxPanel;
39 class wxChoice;
40 class wxButton;
41 class wxTimer;
42 
43 class PCB_BASE_FRAME;
44 class LIB_TREE;
45 class MODULE;
46 
47 
87 {
88 public:
96  DIALOG_CHOOSE_FOOTPRINT( PCB_BASE_FRAME* aParent, const wxString& aTitle,
97  FP_TREE_MODEL_ADAPTER::PTR& aAdapter );
98 
100 
106  LIB_ID GetSelectedLibId() const;
107 
114  {
116  }
117 
118 protected:
119  static constexpr int DblClickDelay = 100; // milliseconds
120 
121  wxPanel* ConstructRightPanel( wxWindow* aParent );
122 
123  void OnCloseTimer( wxTimerEvent& aEvent );
124  void OnUseBrowser( wxCommandEvent& aEvent );
125 
126  void OnComponentPreselected( wxCommandEvent& aEvent );
127 
134  void OnComponentSelected( wxCommandEvent& aEvent );
135 
137  wxButton* m_browser_button;
138  wxSplitterWindow* m_hsplitter;
139  wxSplitterWindow* m_vsplitter;
140 
143 
146 };
147 
148 #endif /* DIALOG_CHOOSE_FOOTPRINT_H */
static constexpr int DblClickDelay
void OnCloseTimer(wxTimerEvent &aEvent)
DIALOG_CHOOSE_FOOTPRINT(PCB_BASE_FRAME *aParent, const wxString &aTitle, FP_TREE_MODEL_ADAPTER::PTR &aAdapter)
Create dialog to choose component.
bool IsExternalBrowserSelected() const
Function IsExternalBrowserSelected.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
Dialog class to select a footprint from the libraries.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
FOOTPRINT_PREVIEW_WIDGET * m_preview_ctrl
LIB_ID GetSelectedLibId() const
To be called after this dialog returns from ShowModal().
void OnUseBrowser(wxCommandEvent &aEvent)
void OnComponentPreselected(wxCommandEvent &aEvent)
wxPanel * ConstructRightPanel(wxWindow *aParent)
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > PTR
Reference-counting container for a pointer to CMP_TREE_MODEL_ADAPTER_BASE.
void OnComponentSelected(wxCommandEvent &aEvent)
Handle the selection of an item.
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
Widget displaying a tree of components with optional search text control and description panel.
Definition: lib_tree.h:42