KiCad PCB EDA Suite
NET_SELECTOR Class Reference

#include <net_selector.h>

Inheritance diagram for NET_SELECTOR:

Public Member Functions

 NET_SELECTOR (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
 
 ~NET_SELECTOR () override
 
void SetNetInfo (NETINFO_LIST *aNetInfoList)
 
void SetIndeterminateString (const wxString &aString)
 
void SetBoard (BOARD *aBoard)
 
void SetSelectedNetcode (int aNetcode)
 
void SetSelectedNet (const wxString &aNetname)
 
void SetIndeterminate ()
 
bool IsIndeterminate ()
 
int GetSelectedNetcode ()
 
wxString GetSelectedNetname ()
 

Protected Member Functions

void onKeyDown (wxKeyEvent &aEvt)
 

Protected Attributes

NET_SELECTOR_COMBOPOPUPm_netSelectorPopup
 
wxString m_indeterminateString
 

Detailed Description

Definition at line 39 of file net_selector.h.

Constructor & Destructor Documentation

◆ NET_SELECTOR()

NET_SELECTOR::NET_SELECTOR ( wxWindow *  parent,
wxWindowID  id,
const wxPoint pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0 
)

Definition at line 525 of file net_selector.cpp.

526  :
527  wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY|wxTE_PROCESS_ENTER )
528 {
529  UseAltPopupWindow();
530 
532  SetPopupControl( m_netSelectorPopup );
533 
534  Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), NULL, this );
535 }
#define NULL
void onKeyDown(wxKeyEvent &aEvt)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:68

References m_netSelectorPopup, NULL, and onKeyDown().

◆ ~NET_SELECTOR()

NET_SELECTOR::~NET_SELECTOR ( )
override

Definition at line 538 of file net_selector.cpp.

539 {
540  Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), NULL, this );
541 }
#define NULL
void onKeyDown(wxKeyEvent &aEvt)

References NULL, and onKeyDown().

Member Function Documentation

◆ GetSelectedNetcode()

◆ GetSelectedNetname()

wxString NET_SELECTOR::GetSelectedNetname ( )

◆ IsIndeterminate()

bool NET_SELECTOR::IsIndeterminate ( )

Definition at line 627 of file net_selector.cpp.

628 {
630 }
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:68

References NET_SELECTOR_COMBOPOPUP::IsIndeterminate(), and m_netSelectorPopup.

Referenced by DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ onKeyDown()

void NET_SELECTOR::onKeyDown ( wxKeyEvent &  aEvt)
protected

Definition at line 544 of file net_selector.cpp.

545 {
546  int key = aEvt.GetKeyCode();
547 
548  if( IsPopupShown() )
549  {
550  // If the popup is shown then it's CHAR_HOOK should be eating these before they
551  // even get to us. But just to be safe, we go ahead and skip.
552  aEvt.Skip();
553  }
554 
555  // Shift-return accepts dialog
556  else if( key == WXK_RETURN && aEvt.ShiftDown() )
557  {
558  wxPostEvent( m_parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
559  }
560 
561  // Return, arrow-down and space-bar all open popup
562  else if( key == WXK_RETURN || key == WXK_DOWN || key == WXK_NUMPAD_DOWN || key == WXK_SPACE )
563  {
564  Popup();
565  }
566 
567  // Non-control characters go to filterbox in popup
568  else if( key > WXK_SPACE && key < WXK_START )
569  {
570  Popup();
572  }
573 
574  else
575  {
576  aEvt.Skip();
577  }
578 }
void OnStartingKey(wxKeyEvent &aEvent)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:68

References m_netSelectorPopup, and NET_SELECTOR_COMBOPOPUP::OnStartingKey().

Referenced by NET_SELECTOR(), and ~NET_SELECTOR().

◆ SetBoard()

void NET_SELECTOR::SetBoard ( BOARD aBoard)

◆ SetIndeterminate()

void NET_SELECTOR::SetIndeterminate ( )

◆ SetIndeterminateString()

void NET_SELECTOR::SetIndeterminateString ( const wxString &  aString)

Definition at line 587 of file net_selector.cpp.

588 {
589  m_indeterminateString = aString;
591 }
void SetIndeterminateLabel(const wxString &aIndeterminateLabel)
wxString m_indeterminateString
Definition: net_selector.h:69
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:68

References m_indeterminateString, m_netSelectorPopup, and NET_SELECTOR_COMBOPOPUP::SetIndeterminateLabel().

Referenced by DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES().

◆ SetNetInfo()

void NET_SELECTOR::SetNetInfo ( NETINFO_LIST aNetInfoList)

◆ SetSelectedNet()

void NET_SELECTOR::SetSelectedNet ( const wxString &  aNetname)

Definition at line 607 of file net_selector.cpp.

608 {
609  m_netSelectorPopup->SetSelectedNet( aNetname );
610  SetValue( m_netSelectorPopup->GetStringValue() );
611 }
void SetSelectedNet(const wxString &aNetname)
wxString GetStringValue() const override
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:68

References NET_SELECTOR_COMBOPOPUP::GetStringValue(), m_netSelectorPopup, and NET_SELECTOR_COMBOPOPUP::SetSelectedNet().

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow().

◆ SetSelectedNetcode()

Member Data Documentation

◆ m_indeterminateString

wxString NET_SELECTOR::m_indeterminateString
protected

Definition at line 69 of file net_selector.h.

Referenced by SetIndeterminate(), and SetIndeterminateString().

◆ m_netSelectorPopup


The documentation for this class was generated from the following files: