KiCad PCB EDA Suite
net_selector.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) 2018 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 2
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  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef __WIDGET_NET_SELECTOR_H
25 #define __WIDGET_NET_SELECTOR_H
26 
27 #include <wx/wx.h>
28 #include <wx/combo.h>
29 
30 
31 class BOARD;
32 class NETINFO_LIST;
34 
35 
36 wxDECLARE_EVENT( NET_SELECTED, wxCommandEvent );
37 
38 
39 class NET_SELECTOR : public wxComboCtrl
40 {
41 public:
42  // Note: this list of arguments is here because it keeps us from having to customize
43  // the constructor calls in wxFormBuilder.
44  NET_SELECTOR( wxWindow *parent, wxWindowID id,
45  const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
46  long style = 0 );
47 
48  ~NET_SELECTOR() override;
49 
50  void SetNetInfo( NETINFO_LIST* aNetInfoList );
51 
52  void SetSelectedNetcode( int aNetcode );
53  void SetSelectedNet( const wxString& aNetname );
54  void SetIndeterminate();
55 
56  bool IsIndeterminate();
57  int GetSelectedNetcode();
58  wxString GetSelectedNetname();
59 
60 protected:
61  void onKeyDown( wxKeyEvent& aEvt );
62 
64 };
65 
66 
67 #endif
int GetSelectedNetcode()
NET_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
wxString GetSelectedNetname()
void onKeyDown(wxKeyEvent &aEvt)
Class NETINFO_LIST is a container class for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:411
void SetSelectedNetcode(int aNetcode)
bool IsIndeterminate()
void SetNetInfo(NETINFO_LIST *aNetInfoList)
wxDECLARE_EVENT(NET_SELECTED, wxCommandEvent)
void SetIndeterminate()
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
void SetSelectedNet(const wxString &aNetname)
~NET_SELECTOR() override
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:63