32#define NO_NET _( "<no net>" )
33#define CREATE_NET _( "<create net>" )
97 wxString escapedNetName;
98 wxString remainingName;
104 escapedNetName = it->second;
106 escapedNetName = selectedNetName;
115 else if( escapedNetName ==
NO_NET )
118 GetComboCtrl()->SetValue(
NO_NET );
120 else if( escapedNetName.StartsWith(
CREATE_NET, &remainingName ) &&
121 !remainingName.IsEmpty() )
124 remainingName = remainingName.Mid( 1 ).Trim().Trim(
false );
132 board->
Add( newnet );
155 if( netInfo ==
nullptr || netInfo->
GetNetCode() == 0 )
158 GetComboCtrl()->SetValue(
NO_NET );
167 wxCommandEvent changeEvent( FILTERED_ITEM_SELECTED );
168 wxPostEvent( GetComboCtrl(), changeEvent );
175 wxString
filter = netstring.Lower();
184 if( netinfo->GetNetCode() > 0 && netinfo->IsCurrent() )
188 if(
filter.IsEmpty() || wxString( netname ).MakeLower().Matches(
filter ) )
190 aNetnames.push_back( netname );
196 std::sort( aNetnames.begin(), aNetnames.end(),
197 [](
const wxString& lhs,
const wxString& rhs )
199 return StrNumCmp( lhs, rhs, true ) < 0;
204 aNetnames.insert( aNetnames.begin(),
NO_NET );
208 wxString newnet = wxString::Format(
"%s: %s",
CREATE_NET, netstring );
209 aNetnames.insert( aNetnames.end(), newnet );
230 std::unique_ptr<NET_SELECTOR_COMBOPOPUP> popup = std::make_unique<NET_SELECTOR_COMBOPOPUP>();
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
A combobox that has a filterable popup.
void setFilterPopup(std::unique_ptr< FILTER_COMBOPOPUP > aPopup)
Handle the data for a net.
const wxString & GetNetname() const
Container for NETINFO_ITEM elements, which are the nets.
BOARD * GetParent() const
NETINFO_ITEM * GetNetItem(int aNetCode) const
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
wxString m_indeterminateString
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
NET_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
void SetBoard(BOARD *aBoard)
void SetIndeterminateString(const wxString &aString)
void SetSelectedNetcode(int aNetcode)
void SetSelectedNet(const wxString &aNetname)
wxString GetSelectedNetname()
wxString UnescapeString(const wxString &aSource)