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 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
 

Detailed Description

Definition at line 39 of file net_selector.h.

Constructor & Destructor Documentation

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

Definition at line 448 of file net_selector.cpp.

References m_netSelectorPopup, and onKeyDown().

449  :
450  wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxCB_READONLY|wxTE_PROCESS_ENTER )
451 {
452  UseAltPopupWindow();
453 
455  SetPopupControl( m_netSelectorPopup );
456 
457  Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), NULL, this );
458 }
void onKeyDown(wxKeyEvent &aEvt)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:63
NET_SELECTOR::~NET_SELECTOR ( )
override

Definition at line 461 of file net_selector.cpp.

References onKeyDown().

462 {
463  Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), NULL, this );
464 }
void onKeyDown(wxKeyEvent &aEvt)

Member Function Documentation

wxString NET_SELECTOR::GetSelectedNetname ( )
bool NET_SELECTOR::IsIndeterminate ( )

Definition at line 537 of file net_selector.cpp.

References NET_SELECTOR_COMBOPOPUP::IsIndeterminate(), and m_netSelectorPopup.

Referenced by DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

538 {
540 }
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:63
void NET_SELECTOR::onKeyDown ( wxKeyEvent &  aEvt)
protected

Definition at line 467 of file net_selector.cpp.

References m_netSelectorPopup, and NET_SELECTOR_COMBOPOPUP::OnStartingKey().

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

468 {
469  int key = aEvt.GetKeyCode();
470 
471  if( IsPopupShown() )
472  {
473  // If the popup is shown then it's CHAR_HOOK should be eating these before they
474  // even get to us. But just to be safe, we go ahead and skip.
475  aEvt.Skip();
476  }
477 
478  // Shift-return accepts dialog
479  else if( key == WXK_RETURN && aEvt.ShiftDown() )
480  {
481  wxPostEvent( m_parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
482  }
483 
484  // Return, arrow-down and space-bar all open popup
485  else if( key == WXK_RETURN || key == WXK_DOWN || key == WXK_NUMPAD_DOWN || key == WXK_SPACE )
486  {
487  Popup();
488  }
489 
490  // Non-control characters go to filterbox in popup
491  else if( key > WXK_SPACE && key < WXK_START )
492  {
493  Popup();
495  }
496 
497  else
498  {
499  aEvt.Skip();
500  }
501 }
void OnStartingKey(wxKeyEvent &aEvent)
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:63
void NET_SELECTOR::SetIndeterminate ( )

Definition at line 530 of file net_selector.cpp.

References INDETERMINATE, m_netSelectorPopup, and NET_SELECTOR_COMBOPOPUP::SetIndeterminate().

Referenced by DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES().

531 {
533  SetValue( INDETERMINATE );
534 }
#define INDETERMINATE
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:63
void NET_SELECTOR::SetNetInfo ( NETINFO_LIST aNetInfoList)
void NET_SELECTOR::SetSelectedNet ( const wxString &  aNetname)

Definition at line 517 of file net_selector.cpp.

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

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow().

518 {
519  m_netSelectorPopup->SetSelectedNet( aNetname );
520  SetValue( m_netSelectorPopup->GetStringValue() );
521 }
void SetSelectedNet(const wxString &aNetname)
wxString GetStringValue() const override
NET_SELECTOR_COMBOPOPUP * m_netSelectorPopup
Definition: net_selector.h:63

Member Data Documentation


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