KiCad PCB EDA Suite
Loading...
Searching...
No Matches
FILTER_COMBOPOPUP Class Referenceabstract

#include <filter_combobox.h>

Inheritance diagram for FILTER_COMBOPOPUP:
NET_SELECTOR_COMBOPOPUP SYMBOL_FILTER_COMBOPOPUP

Public Member Functions

 FILTER_COMBOPOPUP ()
 
bool Create (wxWindow *aParent) override
 
wxWindow * GetControl () override
 
void SetStringValue (const wxString &aNetName) override
 
void OnPopup () override
 
void OnStartingKey (wxKeyEvent &aEvent)
 
wxSize GetAdjustedSize (int aMinWidth, int aPrefHeight, int aMaxHeight) override
 
virtual void Accept ()=0
 

Protected Member Functions

std::optional< wxString > getSelectedValue () const
 Get the currently selected value in the list, or std::nullopt.
 
wxString getFilterValue () const
 Get the current value of the filter control.
 
void rebuildList ()
 Call this to rebuild the list from the getListContent() method.
 

Protected Attributes

wxTextValidator * m_filterValidator
 
wxTextCtrl * m_filterCtrl
 
wxListBox * m_listBox
 
int m_minPopupWidth
 
int m_maxPopupHeight
 
wxEvtHandler * m_focusHandler
 

Private Member Functions

virtual void getListContent (wxArrayString &aListToFill)=0
 Implement this to fill in the given list.
 
wxSize updateSize ()
 
void onIdle (wxIdleEvent &aEvent)
 
void onMouseMoved (const wxPoint aScreenPos)
 
void onMouseClick (wxMouseEvent &aEvent)
 
void onKeyDown (wxKeyEvent &aEvent)
 
void onEnter (wxCommandEvent &aEvent)
 
void onFilterEdit (wxCommandEvent &aEvent)
 
void doStartingKey (wxKeyEvent &aEvent)
 
void doSetFocus (wxWindow *aWindow)
 

Detailed Description

Definition at line 40 of file filter_combobox.h.

Constructor & Destructor Documentation

◆ FILTER_COMBOPOPUP()

FILTER_COMBOPOPUP::FILTER_COMBOPOPUP ( )

Definition at line 54 of file filter_combobox.cpp.

Member Function Documentation

◆ Accept()

virtual void FILTER_COMBOPOPUP::Accept ( )
pure virtual

◆ Create()

bool FILTER_COMBOPOPUP::Create ( wxWindow *  aParent)
override

◆ doSetFocus()

void FILTER_COMBOPOPUP::doSetFocus ( wxWindow *  aWindow)
private

Definition at line 381 of file filter_combobox.cpp.

References KIPLATFORM::UI::ForceFocus().

Referenced by onKeyDown(), onMouseMoved(), and OnStartingKey().

◆ doStartingKey()

void FILTER_COMBOPOPUP::doStartingKey ( wxKeyEvent &  aEvent)
private

Definition at line 347 of file filter_combobox.cpp.

References m_filterCtrl, and text.

Referenced by onKeyDown(), and OnStartingKey().

◆ GetAdjustedSize()

wxSize FILTER_COMBOPOPUP::GetAdjustedSize ( int  aMinWidth,
int  aPrefHeight,
int  aMaxHeight 
)
override

Definition at line 136 of file filter_combobox.cpp.

References m_maxPopupHeight, m_minPopupWidth, and updateSize().

◆ GetControl()

wxWindow * FILTER_COMBOPOPUP::GetControl ( )
inlineoverride

Definition at line 47 of file filter_combobox.h.

◆ getFilterValue()

wxString FILTER_COMBOPOPUP::getFilterValue ( ) const
protected

Get the current value of the filter control.

Can be empty.

Definition at line 167 of file filter_combobox.cpp.

References m_filterCtrl.

Referenced by SYMBOL_FILTER_COMBOPOPUP::getListContent(), and NET_SELECTOR_COMBOPOPUP::getListContent().

◆ getListContent()

virtual void FILTER_COMBOPOPUP::getListContent ( wxArrayString &  aListToFill)
privatepure virtual

Implement this to fill in the given list.

Implemented in SYMBOL_FILTER_COMBOPOPUP, and NET_SELECTOR_COMBOPOPUP.

Referenced by rebuildList().

◆ getSelectedValue()

std::optional< wxString > FILTER_COMBOPOPUP::getSelectedValue ( ) const
protected

Get the currently selected value in the list, or std::nullopt.

Definition at line 156 of file filter_combobox.cpp.

References m_listBox.

Referenced by NET_SELECTOR_COMBOPOPUP::Accept(), and SYMBOL_FILTER_COMBOPOPUP::Accept().

◆ onEnter()

void FILTER_COMBOPOPUP::onEnter ( wxCommandEvent &  aEvent)
private

Definition at line 331 of file filter_combobox.cpp.

References Accept().

Referenced by Create().

◆ onFilterEdit()

void FILTER_COMBOPOPUP::onFilterEdit ( wxCommandEvent &  aEvent)
private

Definition at line 337 of file filter_combobox.cpp.

References m_listBox, rebuildList(), and updateSize().

Referenced by Create().

◆ onIdle()

void FILTER_COMBOPOPUP::onIdle ( wxIdleEvent &  aEvent)
private

Definition at line 203 of file filter_combobox.cpp.

References KIPLATFORM::UI::GetMousePosition(), m_filterCtrl, m_focusHandler, and onMouseMoved().

Referenced by Create().

◆ onKeyDown()

void FILTER_COMBOPOPUP::onKeyDown ( wxKeyEvent &  aEvent)
private

Definition at line 272 of file filter_combobox.cpp.

References Accept(), doSetFocus(), doStartingKey(), m_filterCtrl, m_focusHandler, and m_listBox.

Referenced by Create().

◆ onMouseClick()

void FILTER_COMBOPOPUP::onMouseClick ( wxMouseEvent &  aEvent)
private

Definition at line 243 of file filter_combobox.cpp.

References Accept(), and m_listBox.

Referenced by Create().

◆ onMouseMoved()

void FILTER_COMBOPOPUP::onMouseMoved ( const wxPoint  aScreenPos)
private

Definition at line 224 of file filter_combobox.cpp.

References doSetFocus(), m_filterCtrl, and m_listBox.

Referenced by onIdle().

◆ OnPopup()

void FILTER_COMBOPOPUP::OnPopup ( )
override

Definition at line 114 of file filter_combobox.cpp.

References m_filterCtrl, m_listBox, and updateSize().

◆ OnStartingKey()

void FILTER_COMBOPOPUP::OnStartingKey ( wxKeyEvent &  aEvent)

Definition at line 129 of file filter_combobox.cpp.

References doSetFocus(), doStartingKey(), and m_filterCtrl.

Referenced by FILTER_COMBOBOX::onKeyDown().

◆ rebuildList()

void FILTER_COMBOPOPUP::rebuildList ( )
protected

◆ SetStringValue()

void FILTER_COMBOPOPUP::SetStringValue ( const wxString &  aNetName)
override

Definition at line 108 of file filter_combobox.cpp.

◆ updateSize()

wxSize FILTER_COMBOPOPUP::updateSize ( )
private

Member Data Documentation

◆ m_filterCtrl

wxTextCtrl* FILTER_COMBOPOPUP::m_filterCtrl
protected

◆ m_filterValidator

wxTextValidator* FILTER_COMBOPOPUP::m_filterValidator
protected

Definition at line 95 of file filter_combobox.h.

Referenced by Create().

◆ m_focusHandler

wxEvtHandler* FILTER_COMBOPOPUP::m_focusHandler
protected

Definition at line 101 of file filter_combobox.h.

Referenced by onIdle(), and onKeyDown().

◆ m_listBox

wxListBox* FILTER_COMBOPOPUP::m_listBox
protected

◆ m_maxPopupHeight

int FILTER_COMBOPOPUP::m_maxPopupHeight
protected

Definition at line 99 of file filter_combobox.h.

Referenced by GetAdjustedSize(), and updateSize().

◆ m_minPopupWidth

int FILTER_COMBOPOPUP::m_minPopupWidth
protected

Definition at line 98 of file filter_combobox.h.

Referenced by GetAdjustedSize(), and updateSize().


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