31#include <wx/splitter.h>
46 const wxString& aTitle,
47 wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>& aAdapter )
48 :
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize,
49 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
50 m_browser_button( nullptr ),
51 m_hsplitter( nullptr ),
52 m_vsplitter( nullptr ),
54 m_external_browser_requested( false )
56 auto sizer =
new wxBoxSizer( wxVERTICAL );
59 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
69 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
70 detailsPanel->SetSizer( detailsSizer );
72 details =
new HTML_WINDOW( detailsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
73 wxHW_SCROLLBAR_AUTO );
74 detailsSizer->Add( details, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
75 detailsPanel->Layout();
76 detailsSizer->Fit( detailsPanel );
82 sizer->Add(
m_vsplitter, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
85 LIB_TREE::FLAGS::ALL_WIDGETS, details );
93 auto buttonsSizer =
new wxBoxSizer( wxHORIZONTAL );
96 buttonsSizer->Add(
m_browser_button, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
98 auto sdbSizer =
new wxStdDialogButtonSizer();
99 auto okButton =
new wxButton(
this, wxID_OK );
100 auto cancelButton =
new wxButton(
this, wxID_CANCEL );
101 sdbSizer->AddButton( okButton );
102 sdbSizer->AddButton( cancelButton );
105 buttonsSizer->Add( sdbSizer, 1, wxALL, 5 );
107 sizer->Add( buttonsSizer, 0, wxEXPAND | wxLEFT, 5 );
110 aAdapter->FinishTreeInitialization();
126 if( cfg->m_FootprintChooser.sash_h < 0 )
129 m_hsplitter->SetSashPosition( cfg->m_FootprintChooser.sash_h );
131 if( cfg->m_FootprintChooser.sash_v < 0 )
135 m_vsplitter->SetSashPosition( cfg->m_FootprintChooser.sash_v );
137 int w = cfg->m_FootprintChooser.width < 0 ?
139 int h = cfg->m_FootprintChooser.height < 0 ?
141 SetSize( wxSize( w, h ) );
163 cfg->m_FootprintChooser.height = GetSize().y;
164 cfg->m_FootprintChooser.sash_h =
m_hsplitter->GetSashPosition();
167 cfg->m_FootprintChooser.sash_v =
m_vsplitter->GetSashPosition();
173 auto panel =
new wxPanel( aParent );
174 auto sizer =
new wxBoxSizer( wxVERTICAL );
180 panel->SetSizer( sizer );
207 auto state = wxGetMouseState();
209 if( state.LeftIsDown() )
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={})
int horizPixelsFromDU(int x) const
Convert an integer number of dialog units to pixels, horizontally.
void EndQuasiModal(int retCode)
EDA_UNITS GetUserUnits() const
Add dark theme support to wxHtmlWindow.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
Widget displaying a tree of symbols with optional search text control and description panel....
wxWindow * GetFocusTarget()
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit symbols, if the user selects the symbol itself rather than picking an individual unit,...
FOOTPRINT_CHOOSER m_FootprintChooser
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.