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 38 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 555 of file net_selector.cpp.

556  :
557  wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY|wxTE_PROCESS_ENTER )
558 {
559  UseAltPopupWindow();
560 
562  SetPopupControl( m_netSelectorPopup );
563 
564  Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), nullptr, this );
565 }
void onKeyDown(wxKeyEvent &aEvt)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:67

References m_netSelectorPopup, and onKeyDown().

◆ ~NET_SELECTOR()

NET_SELECTOR::~NET_SELECTOR ( )
override

Definition at line 568 of file net_selector.cpp.

569 {
570  Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), nullptr, this );
571 }
void onKeyDown(wxKeyEvent &aEvt)

References onKeyDown().

Member Function Documentation

◆ GetSelectedNetcode()

◆ GetSelectedNetname()

wxString NET_SELECTOR::GetSelectedNetname ( )

◆ IsIndeterminate()

bool NET_SELECTOR::IsIndeterminate ( )

Definition at line 657 of file net_selector.cpp.

658 {
660 }
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:67

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 574 of file net_selector.cpp.

575 {
576  int key = aEvt.GetKeyCode();
577 
578  if( IsPopupShown() )
579  {
580  // If the popup is shown then it's CHAR_HOOK should be eating these before they
581  // even get to us. But just to be safe, we go ahead and skip.
582  aEvt.Skip();
583  }
584 
585  // Shift-return accepts dialog
586  else if( key == WXK_RETURN && aEvt.ShiftDown() )
587  {
588  wxPostEvent( m_parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
589  }
590 
591  // Return, arrow-down and space-bar all open popup
592  else if( key == WXK_RETURN || key == WXK_DOWN || key == WXK_NUMPAD_DOWN || key == WXK_SPACE )
593  {
594  Popup();
595  }
596 
597  // Non-control characters go to filterbox in popup
598  else if( key > WXK_SPACE && key < WXK_START )
599  {
600  Popup();
602  }
603 
604  else
605  {
606  aEvt.Skip();
607  }
608 }
void OnStartingKey(wxKeyEvent &aEvent)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:67

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 617 of file net_selector.cpp.

618 {
619  m_indeterminateString = aString;
621 }
void SetIndeterminateLabel(const wxString &aIndeterminateLabel)
wxString m_indeterminateString
Definition: net_selector.h:68
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:67

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 637 of file net_selector.cpp.

638 {
639  m_netSelectorPopup->SetSelectedNet( aNetname );
641 }
void SetSelectedNet(const wxString &aNetname)
wxString GetStringValue() const override
wxString UnescapeString(const wxString &aSource)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:67

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

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow().

◆ SetSelectedNetcode()

Member Data Documentation

◆ m_indeterminateString

wxString NET_SELECTOR::m_indeterminateString
protected

Definition at line 68 of file net_selector.h.

Referenced by SetIndeterminate(), and SetIndeterminateString().

◆ m_netSelectorPopup


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