31#include <wx/clipbrd.h>
33#include <wx/hyperlink.h>
56 wxASSERT( aParent !=
nullptr );
58 SetEvtHandlerEnabled(
false );
60 m_images =
new wxImageList( 24, 24,
false, 9 );
84 icon.CopyFromBitmap(
KiBitmap( BITMAPS::icon_kicad_nightly ) );
86 icon.CopyFromBitmap(
KiBitmap( BITMAPS::icon_kicad ) );
99 SetTitle( wxString::Format(
_(
"About %s" ),
m_titleName ) );
102 SetEvtHandlerEnabled(
true );
103 GetSizer()->SetSizeHints(
this );
118 wxFlexGridSizer* fgSizer =
new wxFlexGridSizer( 3, 2, 2 );
119 fgSizer->SetFlexibleDirection( wxHORIZONTAL );
120 fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
154 IMAGES aIconIndex,
const CONTRIBUTORS& aContributors )
156 wxPanel* outerPanel =
new wxPanel( aParent );
157 wxBoxSizer* outerSizer =
new wxBoxSizer( wxVERTICAL );
159 wxBoxSizer* bSizer =
new wxBoxSizer( wxHORIZONTAL );
161 wxScrolledWindow* m_scrolledWindow1 =
new wxScrolledWindow( outerPanel, wxID_ANY,
164 wxHSCROLL|wxVSCROLL );
165 m_scrolledWindow1->SetScrollRate( 5, 5 );
170 wxPanel* panel1 =
new wxPanel( m_scrolledWindow1 );
174 for(
size_t i=0; i<aContributors.GetCount(); ++i )
176 CONTRIBUTOR* contributor = &aContributors.Item( i );
180 fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
183 if ( contributor->
GetName() != wxEmptyString )
185 wxStaticText* m_staticText1 =
new wxStaticText( m_scrolledWindow1, wxID_ANY,
187 wxDefaultPosition, wxDefaultSize, 0 );
188 m_staticText1->Wrap( -1 );
189 fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
193 fgSizer1->AddSpacer( 5 );
197 if ( contributor->
GetExtra() != wxEmptyString )
201 fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
205 fgSizer1->AddSpacer( 5 );
209 bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
210 bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 );
211 m_scrolledWindow1->SetSizer( bSizer );
212 m_scrolledWindow1->Layout();
213 bSizer->Fit( m_scrolledWindow1 );
215 outerSizer->Add( m_scrolledWindow1, 1, wxEXPAND, 0 );
216 outerPanel->SetSizer( outerSizer );
218 aParent->AddPage( outerPanel, aCaption,
false,
static_cast<int>( aIconIndex ) );
224 const CONTRIBUTORS& aContributors )
234#if defined( __WXGTK__ )
235 padding += wxS(
" " );
237 wxPanel* outerPanel =
new wxPanel( aParent );
238 wxBoxSizer* outerSizer =
new wxBoxSizer( wxVERTICAL );
240 wxBoxSizer* bSizer =
new wxBoxSizer( wxHORIZONTAL );
242 wxScrolledWindow* m_scrolledWindow1 =
new wxScrolledWindow( outerPanel, wxID_ANY,
245 wxHSCROLL|wxVSCROLL );
246 m_scrolledWindow1->SetScrollRate( 5, 5 );
251 wxPanel* panel1 =
new wxPanel( m_scrolledWindow1 );
255 for(
size_t i=0; i < aContributors.GetCount(); ++i )
257 CONTRIBUTOR* contributor = &aContributors.Item( i );
259 wxBitmap* icon = contributor->
GetIcon();
265 if( ( category != wxEmptyString ) && !( contributor->
IsChecked() ) )
269 fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
272 wxStaticText* m_staticText1 =
new wxStaticText( m_scrolledWindow1, wxID_ANY,
274 wxDefaultPosition, wxDefaultSize, 0 );
275 m_staticText1->SetFont( m_staticText1->GetFont().Bold() );
276 m_staticText1->Wrap( -1 );
277 fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM|wxEXPAND, 2 );
280 fgSizer1->AddSpacer( 5 );
283 for(
size_t j=0; j < aContributors.GetCount(); ++j )
285 CONTRIBUTOR* sub_contributor = &aContributors.Item( j );
290 fgSizer1->AddSpacer( 5 );
295 if( sub_contributor->
GetUrl().IsEmpty() )
297 ctrl =
new wxStaticText( m_scrolledWindow1, wxID_ANY,
298 padding + wxT(
"• " ) + sub_contributor->
GetName(),
305 ctrl =
new wxHyperlinkCtrl( m_scrolledWindow1, wxID_ANY,
306 wxT(
"• " ) + sub_contributor->
GetName(),
307 sub_contributor->
GetUrl(),
310 wxBORDER_NONE | wxHL_CONTEXTMENU | wxHL_ALIGN_LEFT );
313 m_staticText1->Wrap( -1 );
315 fgSizer1->Add( ctrl, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
318 if( sub_contributor->
GetExtra() != wxEmptyString )
322 fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
326 fgSizer1->AddSpacer( 5 );
345 for (
size_t k=0; k < aContributors.GetCount(); ++k )
347 CONTRIBUTOR* contributor = &aContributors.Item( k );
354 fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
357 if( contributor->
GetName() != wxEmptyString )
359 wxStaticText* m_staticText1 =
new wxStaticText( m_scrolledWindow1, wxID_ANY,
361 wxDefaultPosition, wxDefaultSize, 0 );
362 m_staticText1->Wrap( -1 );
363 fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
367 fgSizer1->AddSpacer( 5 );
371 if ( contributor->
GetExtra() != wxEmptyString )
374 fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
378 fgSizer1->AddSpacer( 5 );
382 bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
383 bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 );
384 m_scrolledWindow1->SetSizer( bSizer );
385 m_scrolledWindow1->Layout();
386 bSizer->Fit( m_scrolledWindow1 );
388 outerSizer->Add( m_scrolledWindow1, 1, wxEXPAND, 0 );
389 outerPanel->SetSizer( outerSizer );
391 aParent->AddPage( outerPanel, aCaption,
false,
static_cast<int>( aIconIndex ) );
396 IMAGES aIconIndex,
const wxString& html,
399 wxPanel* panel =
new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
402 wxBoxSizer* bSizer =
new wxBoxSizer( wxVERTICAL );
404 int flags = aSelection ? wxHW_SCROLLBAR_AUTO : ( wxHW_SCROLLBAR_AUTO | wxHW_NO_SELECTION );
412 wxFont font = GetFont();
413 htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
418 htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
422 bSizer->Add( htmlWindow, 1, wxEXPAND, 0 );
423 panel->SetSizer( bSizer );
425 aParent->AddPage( panel, aCaption,
false,
static_cast<int>( aIconIndex ) );
431 wxStaticText*
text =
new wxStaticText( aParent, wxID_ANY,
432 wxT(
"(" ) + aReference + wxT(
")" ) );
440 wxStaticBitmap* bitmap =
new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
441 wxDefaultPosition, wxDefaultSize, 0 );
444 bitmap->SetBitmap( *aIcon );
454 ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
462 if( !wxTheClipboard->Open() )
464 wxMessageBox(
_(
"Could not open clipboard to write version information." ),
465 _(
"Clipboard Error" ), wxOK | wxICON_EXCLAMATION,
this );
471 wxTheClipboard->SetData(
new wxTextDataObject( msg_version ) );
472 wxTheClipboard->Flush();
473 wxTheClipboard->Close();
481 mgr->RunAction(
"common.SuiteControl.donate" );
488 mgr->RunAction(
"common.SuiteControl.reportBug" );
496 int page = aEvent.GetSelection();
499 m_notebook->ChangeSelection(
static_cast<unsigned>( page ) );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
wxString GetVersionInfoData(const wxString &aTitle, bool aHtml, bool aBrief)
Create a version info string for bug reports and the about dialog.
bool IsNightlyVersion()
Check if the build is meant to be nightly.
An object of this class is meant to be used to store application specific information like who has co...
CONTRIBUTORS GetPackagers()
CONTRIBUTORS GetLibrarians()
wxString & GetLibVersion()
CONTRIBUTORS GetDevelopers()
CONTRIBUTORS GetDocWriters()
wxString & GetBuildVersion()
wxString & GetDescription()
CONTRIBUTORS GetTranslators()
CONTRIBUTORS GetArtists()
wxIcon & GetAppIcon()
Wrapper to manage memory allocation for bitmaps.
A contributor, a person which was involved in the development of the application or which has contrib...
void SetChecked(bool status)
wxStaticText * m_staticTextBuildVersion
wxStaticBitmap * m_bitmapApp
wxStaticText * m_staticTextCopyright
wxStaticText * m_staticTextLibVersion
wxButton * m_btCopyVersionInfo
wxStaticText * m_staticTextAppTitle
void OnNotebookPageChanged(wxNotebookEvent &aEvent) override
wxString m_untranslatedTitleName
void createNotebookPage(wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const CONTRIBUTORS &aContributors)
void createNotebookPageByCategory(wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const CONTRIBUTORS &aContributors)
DIALOG_ABOUT(EDA_BASE_FRAME *aParent, ABOUT_APP_INFO &aAppInfo)
wxStaticBitmap * createStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
void onCopyVersionInfo(wxCommandEvent &event) override
void onHtmlLinkClicked(wxHtmlLinkEvent &event)
wxFlexGridSizer * createFlexGridSizer()
void onReportBug(wxCommandEvent &event) override
wxStaticText * wxStaticTextRef(wxScrolledWindow *aParent, const wxString &aReference)
void onDonateClick(wxCommandEvent &event) override
void createNotebookHtmlPage(wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const wxString &aHtmlMessage, bool aSelection=false)
The base frame for deriving all KiCad main window classes.
const wxString & GetUntranslatedAboutTitle() const
const wxString & GetAboutTitle() const
Add dark theme support to wxHtmlWindow.
bool SetPage(const wxString &aSource) override