30#include <wx/checkbox.h>
36#include "wx/display.h"
68#define MODAL_FRAME ( wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN \
69 | wxWANTS_CHARS | wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP )
76 m_filterByPinCount( nullptr ),
77 m_filterByFPFilters( nullptr ),
79 m_firstPaintEvent( true )
95 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
105 wxCommandEvent
dummy;
111 wxBoxSizer* fpFilterSizer =
new wxBoxSizer( wxVERTICAL );
113 sizer->Add( fpFilterSizer, 0, wxEXPAND | wxLEFT, 10 );
115 wxBoxSizer* buttonsSizer =
new wxBoxSizer( wxHORIZONTAL );
118 wxStdDialogButtonSizer* sdbSizer =
new wxStdDialogButtonSizer();
119 wxButton* okButton =
new wxButton(
this, wxID_OK );
120 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL );
122 sdbSizer->AddButton( okButton );
123 sdbSizer->AddButton( cancelButton );
126 buttonsSizer->Add( sdbSizer, 1, wxALL, 5 );
128 sizer->Add( buttonsSizer, 0, wxEXPAND | wxLEFT, 5 );
131 SetTitle( GetTitle() + wxString::Format(
_(
" (%d items loaded)" ),
138 [&]( wxCommandEvent& evt )
144 [&]( wxCommandEvent& evt )
162 if( aNode.
m_Type == LIB_TREE_NODE::TYPE::LIBRARY )
171 [](
LIB_ID& id, std::vector<std::unique_ptr<EDA_PATTERN_MATCH>>& filters ) ->
bool
176 for(
const std::unique_ptr<EDA_PATTERN_MATCH>&
filter : filters )
181 if(
filter->GetPattern().Contains( wxS(
":" ) ) )
182 name =
id.GetUniStringLibNickname().Lower() + wxS(
":" );
184 name +=
id.GetUniStringLibItemName().Lower();
223 wxCHECK_MSG( cfg,
nullptr, wxT(
"config not existing" ) );
234 return Pgm().GetSettingsManager().GetColorSettings( settings->m_ColorTheme );
236 return Pgm().GetSettingsManager().GetColorSettings();
242 const std::string& payload = mail.
GetPayload();
256 std::vector<std::string> strings =
split( payload,
"\r" );
258 if( strings.size() >= 1 )
260 wxString pinCountStr( strings[0] );
266 + wxString::Format( wxS(
" (%d)" ),
m_pinCount ) );
271 if( strings.size() >= 2 && !strings[1].empty() )
273 for(
const wxString&
filter : wxSplit( strings[1],
' ' ) )
275 m_fpFilters.push_back( std::make_unique<EDA_PATTERN_MATCH_WILDCARD_ANCHORED>() );
280 + wxString::Format( wxS(
" (%s)" ), strings[1] ) );
295 if( aFootprint && !aFootprint->IsEmpty() )
299 fpid.
Parse( *aFootprint,
true );
314 PCB_BASE_FRAME::SetPosition( aNewPosition );
329 PCB_BASE_FRAME::Raise();
331 ret = PCB_BASE_FRAME::Show( show );
336 if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
338 SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
339 std::max( wxWindow::GetSize().x, savedDialogRect.GetSize().x ),
340 std::max( wxWindow::GetSize().y, savedDialogRect.GetSize().y ),
347 if( wxDisplay::GetFromWindow(
this ) == wxNOT_FOUND )
352 s_dialogRect = wxRect( wxWindow::GetPosition(), wxWindow::GetSize() );
353 ret = PCB_BASE_FRAME::Show( show );
380 wxString footprint = fpID.
Format();
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Color settings are a bit different than most of the settings objects in that there can be more than o...
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
MAIL_T Command()
Returns the MAIL_T associated with this mail.
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...
void SetModal(bool aIsModal)
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
bool IsValid() const
Check if this LID_ID is valid.
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
WINDOW_SETTINGS m_FootprintViewer
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
#define FOOTPRINT_CHOOSER_FRAME_NAME
@ FRAME_FOOTPRINT_CHOOSER
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
std::vector< FAB_LAYER_COLOR > dummy
static std::vector< std::string > split(const std::string &aStr, const std::string &aDelim)
Split the input string into a vector of output strings.
Stores the common settings that are saved and loaded for each window / frame.