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 &aSymbolNetlist, const wxString &aPreselect)
 

Protected Member Functions

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

Protected Attributes

DIALOG_SHIMm_dlg
 
wxString m_preselect
 
std::string m_symbolNetlist
 

Detailed Description

Definition at line 239 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 &  aSymbolNetlist,
const wxString &  aPreselect 
)
inline

Definition at line 242 of file grid_text_button_helpers.cpp.

243 :
244 wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
245 wxTE_PROCESS_ENTER ),
246 m_dlg( aParentDlg ),
247 m_preselect( aPreselect ),
248 m_symbolNetlist( aSymbolNetlist.ToStdString() )
249 {
250 SetButtonBitmaps( KiBitmap( BITMAPS::small_library ) );
251
252 // win32 fix, avoids drawing the "native dropdown caret"
253 Customize( wxCC_IFLAG_HAS_NONSTANDARD_BUTTON );
254 }
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
@ small_library

References KiBitmap(), and small_library.

Member Function Documentation

◆ DoSetPopupControl()

void TEXT_BUTTON_FP_CHOOSER::DoSetPopupControl ( wxComboPopup *  popup)
inlineoverrideprotected

Definition at line 257 of file grid_text_button_helpers.cpp.

258 {
259 m_popup = nullptr;
260 }

◆ OnButtonClick()

void TEXT_BUTTON_FP_CHOOSER::OnButtonClick ( )
inlineoverrideprotected

Definition at line 262 of file grid_text_button_helpers.cpp.

263 {
264 // pick a footprint using the footprint picker.
265 wxString fpid = GetValue();
266
267 if( fpid.IsEmpty() )
268 fpid = m_preselect;
269
271
272 if( !m_symbolNetlist.empty() )
273 {
275 frame->KiwayMailIn( event );
276 }
277
278 if( frame->ShowModal( &fpid, m_dlg ) )
279 SetValue( fpid );
280
281 frame->Destroy();
282 }
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:39
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:66
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...
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Receive KIWAY_EXPRESS messages from other players.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:394
@ FRAME_FOOTPRINT_VIEWER_MODAL
Definition: frame_type.h:43
@ FRAME_FOOTPRINT_VIEWER
Definition: frame_type.h:42
@ MAIL_SYMBOL_NETLIST
Definition: mail_type.h:45

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

Member Data Documentation

◆ m_dlg

DIALOG_SHIM* TEXT_BUTTON_FP_CHOOSER::m_dlg
protected

Definition at line 284 of file grid_text_button_helpers.cpp.

Referenced by OnButtonClick().

◆ m_preselect

wxString TEXT_BUTTON_FP_CHOOSER::m_preselect
protected

Definition at line 285 of file grid_text_button_helpers.cpp.

Referenced by OnButtonClick().

◆ m_symbolNetlist

std::string TEXT_BUTTON_FP_CHOOSER::m_symbolNetlist
protected

Definition at line 296 of file grid_text_button_helpers.cpp.

Referenced by OnButtonClick().


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