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

551  :
552  wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY|wxTE_PROCESS_ENTER )
553 {
554  UseAltPopupWindow();
555 
557  SetPopupControl( m_netSelectorPopup );
558 
559  Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), nullptr, this );
560 }
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 563 of file net_selector.cpp.

564 {
565  Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), nullptr, this );
566 }
void onKeyDown(wxKeyEvent &aEvt)

References onKeyDown().

Member Function Documentation

◆ GetSelectedNetcode()

◆ GetSelectedNetname()

wxString NET_SELECTOR::GetSelectedNetname ( )

◆ IsIndeterminate()

bool NET_SELECTOR::IsIndeterminate ( )

Definition at line 652 of file net_selector.cpp.

653 {
655 }
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 569 of file net_selector.cpp.

570 {
571  int key = aEvt.GetKeyCode();
572 
573  if( IsPopupShown() )
574  {
575  // If the popup is shown then it's CHAR_HOOK should be eating these before they
576  // even get to us. But just to be safe, we go ahead and skip.
577  aEvt.Skip();
578  }
579 
580  // Shift-return accepts dialog
581  else if( key == WXK_RETURN && aEvt.ShiftDown() )
582  {
583  wxPostEvent( m_parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
584  }
585 
586  // Return, arrow-down and space-bar all open popup
587  else if( key == WXK_RETURN || key == WXK_DOWN || key == WXK_NUMPAD_DOWN || key == WXK_SPACE )
588  {
589  Popup();
590  }
591 
592  // Non-control characters go to filterbox in popup
593  else if( key > WXK_SPACE && key < WXK_START )
594  {
595  Popup();
597  }
598 
599  else
600  {
601  aEvt.Skip();
602  }
603 }
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 612 of file net_selector.cpp.

613 {
614  m_indeterminateString = aString;
616 }
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 632 of file net_selector.cpp.

633 {
634  m_netSelectorPopup->SetSelectedNet( aNetname );
636 }
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: