KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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/combo.h>
28
29
30class BOARD;
31class NETINFO_LIST;
33
34
35wxDECLARE_EVENT( NET_SELECTED, wxCommandEvent );
36
37
38class NET_SELECTOR : public wxComboCtrl
39{
40public:
41 // Note: this list of arguments is here because it keeps us from having to customize
42 // the constructor calls in wxFormBuilder.
43 NET_SELECTOR( wxWindow *parent, wxWindowID id,
44 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
45 long style = 0 );
46
47 ~NET_SELECTOR() override;
48
49 void SetNetInfo( const NETINFO_LIST* aNetInfoList );
50
51 // Set to wxEmptyString to disallow indeterminate settings
52 void SetIndeterminateString( const wxString& aString );
53
54 void SetBoard( BOARD* aBoard );
55
56 void SetSelectedNetcode( int aNetcode );
57 void SetSelectedNet( const wxString& aNetname );
58 void SetIndeterminate();
59
60 bool IsIndeterminate();
62 wxString GetSelectedNetname();
63
64protected:
65 void onKeyDown( wxKeyEvent& aEvt );
66
69};
70
71
72#endif
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
Container for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:342
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
wxString m_indeterminateString
Definition: net_selector.h:68
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:67
bool IsIndeterminate()
void SetBoard(BOARD *aBoard)
int GetSelectedNetcode()
void SetIndeterminateString(const wxString &aString)
void SetSelectedNetcode(int aNetcode)
void onKeyDown(wxKeyEvent &aEvt)
void SetIndeterminate()
void SetSelectedNet(const wxString &aNetname)
~NET_SELECTOR() override
wxString GetSelectedNetname()
wxDECLARE_EVENT(NET_SELECTED, wxCommandEvent)