2018-08-19 17:11:58 +01:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2025-01-01 13:30:11 -08:00
|
|
|
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
2018-08-19 17:11:58 +01: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
|
|
|
|
*/
|
|
|
|
|
2024-10-27 02:53:25 +08:00
|
|
|
#pragma once
|
2018-08-19 17:11:58 +01:00
|
|
|
|
2024-10-27 02:53:25 +08:00
|
|
|
#include <widgets/filter_combobox.h>
|
2018-08-19 17:11:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
class BOARD;
|
|
|
|
class NETINFO_LIST;
|
2018-09-29 22:04:32 +01:00
|
|
|
class NET_SELECTOR_COMBOPOPUP;
|
2018-08-19 17:11:58 +01:00
|
|
|
|
|
|
|
|
2024-10-27 02:53:25 +08:00
|
|
|
class NET_SELECTOR : public FILTER_COMBOBOX
|
2018-08-19 17:11:58 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Note: this list of arguments is here because it keeps us from having to customize
|
|
|
|
// the constructor calls in wxFormBuilder.
|
2025-06-04 17:37:29 +01:00
|
|
|
NET_SELECTOR( wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition,
|
|
|
|
const wxSize &size = wxDefaultSize, long style = 0 );
|
2018-09-27 11:52:58 +01:00
|
|
|
|
2023-10-04 21:01:33 +01:00
|
|
|
void SetNetInfo( const NETINFO_LIST* aNetInfoList );
|
2018-08-19 17:11:58 +01:00
|
|
|
|
2020-05-05 16:40:18 +01:00
|
|
|
// Set to wxEmptyString to disallow indeterminate settings
|
|
|
|
void SetIndeterminateString( const wxString& aString );
|
|
|
|
|
2018-08-19 17:11:58 +01:00
|
|
|
void SetSelectedNetcode( int aNetcode );
|
2018-10-10 18:42:27 +01:00
|
|
|
void SetSelectedNet( const wxString& aNetname );
|
2018-08-19 17:11:58 +01:00
|
|
|
void SetIndeterminate();
|
|
|
|
|
|
|
|
bool IsIndeterminate();
|
|
|
|
int GetSelectedNetcode();
|
2018-10-10 18:42:27 +01:00
|
|
|
wxString GetSelectedNetname();
|
2018-08-19 17:11:58 +01:00
|
|
|
|
2025-06-04 17:37:29 +01:00
|
|
|
void SetSelectedString( const wxString& aString ) override
|
|
|
|
{
|
|
|
|
wxFAIL_MSG( "Unsupported; use SetSelectedNet() or SetSelectedNetcode()" );
|
|
|
|
}
|
2018-10-10 12:51:08 +01:00
|
|
|
|
2025-06-04 17:37:29 +01:00
|
|
|
protected:
|
2018-09-29 22:04:32 +01:00
|
|
|
NET_SELECTOR_COMBOPOPUP* m_netSelectorPopup;
|
2020-05-05 16:40:18 +01:00
|
|
|
wxString m_indeterminateString;
|
2018-08-19 17:11:58 +01:00
|
|
|
};
|
|
|
|
|