KiCad PCB EDA Suite
TEXT_BUTTON_FP_CHOOSER Class Reference
Inheritance diagram for TEXT_BUTTON_FP_CHOOSER:

Public Member Functions

 TEXT_BUTTON_FP_CHOOSER (wxWindow *aParent, DIALOG_SHIM *aParentDlg, const wxString &aPreselect)
 

Protected Member Functions

void DoSetPopupControl (wxComboPopup *popup) override
 
void OnButtonClick () override
 

Protected Attributes

DIALOG_SHIMm_dlg
 
wxString m_preselect
 

Detailed Description

Definition at line 231 of file grid_text_button_helpers.cpp.

Constructor & Destructor Documentation

◆ TEXT_BUTTON_FP_CHOOSER()

TEXT_BUTTON_FP_CHOOSER::TEXT_BUTTON_FP_CHOOSER ( wxWindow *  aParent,
DIALOG_SHIM aParentDlg,
const wxString &  aPreselect 
)
inline

Definition at line 234 of file grid_text_button_helpers.cpp.

235  :
236  wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
237  wxTE_PROCESS_ENTER ),
238  m_dlg( aParentDlg ),
239  m_preselect( aPreselect )
240  {
241  SetButtonBitmaps( KiBitmap( BITMAPS::small_library ) );
242 
243  // win32 fix, avoids drawing the "native dropdown caret"
244  Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
245  }
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105

References KiBitmap(), and small_library.

Member Function Documentation

◆ DoSetPopupControl()

void TEXT_BUTTON_FP_CHOOSER::DoSetPopupControl ( wxComboPopup *  popup)
inlineoverrideprotected

Definition at line 248 of file grid_text_button_helpers.cpp.

249  {
250  m_popup = nullptr;
251  }

◆ OnButtonClick()

void TEXT_BUTTON_FP_CHOOSER::OnButtonClick ( )
inlineoverrideprotected

Definition at line 253 of file grid_text_button_helpers.cpp.

254  {
255  // pick a footprint using the footprint picker.
256  wxString fpid = GetValue();
257 
258  if( fpid.IsEmpty() )
259  fpid = m_preselect;
260 
262 
263  if( frame->ShowModal( &fpid, m_dlg ) )
264  SetValue( fpid );
265 
266  frame->Destroy();
267  }
virtual bool ShowModal(wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until t...
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:64
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:383
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.

References KIWAY_PLAYER::Destroy(), FRAME_FOOTPRINT_VIEWER_MODAL, KIWAY_HOLDER::Kiway(), m_dlg, m_preselect, KIWAY::Player(), and KIWAY_PLAYER::ShowModal().

Member Data Documentation

◆ m_dlg

DIALOG_SHIM* TEXT_BUTTON_FP_CHOOSER::m_dlg
protected

Definition at line 269 of file grid_text_button_helpers.cpp.

Referenced by OnButtonClick().

◆ m_preselect

wxString TEXT_BUTTON_FP_CHOOSER::m_preselect
protected

Definition at line 270 of file grid_text_button_helpers.cpp.

Referenced by OnButtonClick().


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