36#include <wx/checkbox.h>
43 std::vector<PICKED_SYMBOL>& aHistoryList,
44 std::vector<PICKED_SYMBOL>& aAlreadyPlaced,
45 bool aAllowFieldEdits,
bool aShowFootprints ) :
46 DIALOG_SHIM( aParent, wxID_ANY,
_(
"Choose Symbol" ), wxDefaultPosition, wxDefaultSize,
47 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
49 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
51 aAllowFieldEdits, aShowFootprints,
58 EndModal( wxID_CANCEL );
63 if( aPreselect && aPreselect->
IsValid() )
67 SetTitle(
_(
"Choose Power Symbol" ) );
69 SetTitle( GetTitle() + wxString::Format(
_(
" (%d items loaded)" ),
72 wxBoxSizer* buttonsSizer =
new wxBoxSizer( wxHORIZONTAL );
74 m_keepSymbol =
new wxCheckBox(
this, wxID_ANY,
_(
"Place repeated copies" ) );
75 m_keepSymbol->SetToolTip(
_(
"Keep the symbol selected for subsequent clicks." ) );
77 m_useUnits =
new wxCheckBox(
this, wxID_ANY,
_(
"Place all units" ) );
78 m_useUnits->SetToolTip(
_(
"Sequentially place all units of the symbol." ) );
82 m_keepSymbol->SetValue( cfg->m_SymChooserPanel.keep_symbol );
83 m_useUnits->SetValue( cfg->m_SymChooserPanel.place_all_units );
86 buttonsSizer->Add(
m_keepSymbol, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
87 buttonsSizer->Add(
m_useUnits, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 30 );
89 wxStdDialogButtonSizer* sdbSizer =
new wxStdDialogButtonSizer();
90 wxButton* okButton =
new wxButton(
this, wxID_OK );
91 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL );
93 sdbSizer->AddButton( okButton );
94 sdbSizer->AddButton( cancelButton );
97 buttonsSizer->Add( sdbSizer, 1, wxALL, 5 );
99 sizer->Add( buttonsSizer, 0, wxEXPAND | wxLEFT, 5 );
116 cfg->m_SymChooserPanel.keep_symbol =
m_keepSymbol->GetValue();
117 cfg->m_SymChooserPanel.place_all_units =
m_useUnits->GetValue();
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::vector< std::pair< int, wxString > > GetFields() const
Get a list of fields edited by the user.
PANEL_SYMBOL_CHOOSER * m_chooserPanel
wxCheckBox * m_keepSymbol
static std::mutex g_Mutex
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
To be called after this dialog returns from ShowModal().
DIALOG_SYMBOL_CHOOSER(SCH_BASE_FRAME *aParent, const LIB_ID *aPreselect, const SYMBOL_LIBRARY_FILTER *aFilter, std::vector< PICKED_SYMBOL > &aHistoryList, std::vector< PICKED_SYMBOL > &aAlreadyPlaced, bool aAllowFieldEdits, bool aShowFootprints)
Create dialog to choose symbol.
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
std::vector< std::pair< int, wxString > > GetFields() const
Get a list of fields edited by the user.
wxWindow * GetFocusTarget() const
void OnChar(wxKeyEvent &aEvent)
void SetPreselect(const LIB_ID &aPreselect)
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
To be called after this dialog returns from ShowModal().
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Helper object to filter a list of libraries.
bool GetFilterPowerSymbols() const
Definition for symbol library class.