28 #include <wx/button.h> 31 #include <wx/splitter.h> 45 const wxString& aTitle,
46 wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>& aAdapter )
47 :
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize,
48 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
49 m_browser_button( nullptr ),
50 m_hsplitter( nullptr ),
51 m_vsplitter( nullptr ),
53 m_external_browser_requested( false )
55 auto sizer =
new wxBoxSizer( wxVERTICAL );
56 wxHtmlWindow* details =
nullptr;
58 m_vsplitter =
new wxSplitterWindow(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
68 auto detailsSizer =
new wxBoxSizer( wxVERTICAL );
69 detailsPanel->SetSizer( detailsSizer );
71 details =
new wxHtmlWindow( detailsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
72 wxHW_SCROLLBAR_AUTO );
73 detailsSizer->Add( details, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
74 detailsPanel->Layout();
75 detailsSizer->Fit( detailsPanel );
81 sizer->Add(
m_vsplitter, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
92 auto buttonsSizer =
new wxBoxSizer( wxHORIZONTAL );
95 buttonsSizer->Add(
m_browser_button, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
97 auto sdbSizer =
new wxStdDialogButtonSizer();
98 auto okButton =
new wxButton(
this, wxID_OK );
99 auto cancelButton =
new wxButton(
this, wxID_CANCEL );
100 sdbSizer->AddButton( okButton );
101 sdbSizer->AddButton( cancelButton );
104 buttonsSizer->Add( sdbSizer, 1, wxALL, 5 );
106 sizer->Add( buttonsSizer, 0, wxEXPAND | wxLEFT, 5 );
120 if( cfg->m_FootprintChooser.sash_h < 0 )
123 m_hsplitter->SetSashPosition( cfg->m_FootprintChooser.sash_h );
125 if( cfg->m_FootprintChooser.sash_v < 0 )
129 m_vsplitter->SetSashPosition( cfg->m_FootprintChooser.sash_v );
131 int w = cfg->m_FootprintChooser.width < 0 ?
133 int h = cfg->m_FootprintChooser.height < 0 ?
135 SetSize( wxSize( w, h ) );
138 okButton->SetDefault();
157 cfg->m_FootprintChooser.height = GetSize().y;
158 cfg->m_FootprintChooser.sash_h =
m_hsplitter->GetSashPosition();
161 cfg->m_FootprintChooser.sash_v =
m_vsplitter->GetSashPosition();
167 auto panel =
new wxPanel( aParent );
168 auto sizer =
new wxBoxSizer( wxVERTICAL );
173 panel->SetSizer( sizer );
200 auto state = wxGetMouseState();
202 if( state.LeftIsDown() )
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
wxWindow * GetFocusTarget()
int horizPixelsFromDU(int x) const
Convert an integer number of dialog units to pixels, horizontally.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
FOOTPRINT_CHOOSER m_FootprintChooser
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Classes used in Pcbnew, CvPcb and GerbView.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit components, if the user selects the component itself rather than picking an individual...
void EndQuasiModal(int retCode)
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
Widget displaying a tree of components with optional search text control and description panel....