36#include <wx/checkbox.h>
43 std::vector<PICKED_SYMBOL>& aHistoryList,
44 std::vector<PICKED_SYMBOL>& aAlreadyPlaced,
45 bool aAllowFieldEdits,
bool aShowFootprints,
47 DIALOG_SHIM( aParent, wxID_ANY,
_(
"Choose Symbol" ), wxDefaultPosition, wxDefaultSize,
48 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
50 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
52 aAllowFieldEdits, aShowFootprints, aCancelled,
61 EndModal( wxID_CANCEL );
66 if( aPreselect && aPreselect->
IsValid() )
70 SetTitle(
_(
"Choose Power Symbol" ) );
72 SetTitle( GetTitle() + wxString::Format(
_(
" (%d items loaded)" ),
75 wxBoxSizer* buttonsSizer =
new wxBoxSizer( wxHORIZONTAL );
77 m_keepSymbol =
new wxCheckBox(
this, wxID_ANY,
_(
"Place repeated copies" ) );
78 m_keepSymbol->SetToolTip(
_(
"Keep the symbol selected for subsequent clicks." ) );
80 m_useUnits =
new wxCheckBox(
this, wxID_ANY,
_(
"Place all units" ) );
81 m_useUnits->SetToolTip(
_(
"Sequentially place all units of the symbol." ) );
85 m_keepSymbol->SetValue( cfg->m_SymChooserPanel.keep_symbol );
86 m_useUnits->SetValue( cfg->m_SymChooserPanel.place_all_units );
89 buttonsSizer->Add(
m_keepSymbol, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
90 buttonsSizer->Add(
m_useUnits, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 30 );
92 wxStdDialogButtonSizer* sdbSizer =
new wxStdDialogButtonSizer();
93 wxButton* okButton =
new wxButton(
this, wxID_OK );
94 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL );
96 sdbSizer->AddButton( okButton );
97 sdbSizer->AddButton( cancelButton );
100 buttonsSizer->Add( sdbSizer, 1, wxALL, 5 );
102 sizer->Add( buttonsSizer, 0, wxEXPAND | wxLEFT, 5 );
119 cfg->m_SymChooserPanel.keep_symbol =
m_keepSymbol->GetValue();
120 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< FIELD_T, wxString > > GetFields() const
Get a list of fields edited by the user.
PANEL_SYMBOL_CHOOSER * m_chooserPanel
wxCheckBox * m_keepSymbol
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, bool &aCancelled)
Create dialog to choose symbol.
static std::mutex g_Mutex
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
To be called after this dialog returns from ShowModal().
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
wxWindow * GetFocusTarget() const
std::vector< std::pair< FIELD_T, wxString > > GetFields() const
Get a list of fields edited by the user.
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.