KiCad PCB EDA Suite
DIALOG_ABOUT Class Reference

About dialog to show application specific information. More...

#include <dialog_about.h>

Inheritance diagram for DIALOG_ABOUT:
DIALOG_ABOUT_BASE

Public Member Functions

 DIALOG_ABOUT (EDA_BASE_FRAME *aParent, ABOUT_APP_INFO &aAppInfo)
 
 ~DIALOG_ABOUT ()
 

Protected Member Functions

void OnNotebookPageChanged (wxNotebookEvent &aEvent) override
 

Protected Attributes

wxStaticBitmap * m_bitmapApp
 
wxStaticText * m_staticTextAppTitle
 
wxStaticText * m_staticTextCopyright
 
wxStaticText * m_staticTextBuildVersion
 
wxStaticText * m_staticTextLibVersion
 
wxButton * m_btCopyVersionInfo
 
wxButton * m_btReportBug
 
wxButton * m_btDonate
 
wxNotebook * m_notebook
 
wxButton * m_btOk
 

Private Member Functions

void onHtmlLinkClicked (wxHtmlLinkEvent &event)
 
void onCopyVersionInfo (wxCommandEvent &event) override
 
void onReportBug (wxCommandEvent &event) override
 
void onDonateClick (wxCommandEvent &event) override
 
wxFlexGridSizer * createFlexGridSizer ()
 
void createNotebooks ()
 
void createNotebookPage (wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const CONTRIBUTORS &aContributors)
 
void createNotebookPageByCategory (wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const CONTRIBUTORS &aContributors)
 
void createNotebookHtmlPage (wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const wxString &aHtmlMessage, bool aSelection=false)
 
wxStaticText * wxStaticTextRef (wxScrolledWindow *aParent, const wxString &aReference)
 
wxStaticBitmap * createStaticBitmap (wxScrolledWindow *aParent, wxBitmap *icon)
 

Private Attributes

wxImageList * m_images
 
wxString m_titleName
 
ABOUT_APP_INFOm_info
 

Detailed Description

About dialog to show application specific information.

Needs a ABOUT_APP_INFO object that contains the data to be displayed.

Definition at line 53 of file dialog_about.h.

Constructor & Destructor Documentation

◆ DIALOG_ABOUT()

DIALOG_ABOUT::DIALOG_ABOUT ( EDA_BASE_FRAME aParent,
ABOUT_APP_INFO aAppInfo 
)

Definition at line 51 of file dialog_about.cpp.

52  : DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
53 {
54  wxASSERT( aParent != nullptr );
55 
56  // TODO: Change these to 16x16 versions when available
57  m_images = new wxImageList( 24, 24, false, 9 );
58 
59  m_images->Add( KiBitmap( BITMAPS::info ) ); // INFORMATION
60  m_images->Add( KiBitmap( BITMAPS::recent ) ); // VERSION
61  m_images->Add( KiBitmap( BITMAPS::preference ) ); // DEVELOPERS
62  m_images->Add( KiBitmap( BITMAPS::editor ) ); // DOCWRITERS
63  m_images->Add( KiBitmap( BITMAPS::library ) ); // LIBRARIANS
64  m_images->Add( KiBitmap( BITMAPS::color_materials ) ); // ARTISTS
65  m_images->Add( KiBitmap( BITMAPS::language ) ); // TRANSLATORS
66  m_images->Add( KiBitmap( BITMAPS::zip ) ); // PACKAGERS
67  m_images->Add( KiBitmap( BITMAPS::tools ) ); // LICENSE
68 
69  m_notebook->SetImageList( m_images );
70 
71  if( m_info.GetAppIcon().IsOk() )
72  {
73  SetIcon( m_info.GetAppIcon() );
74  m_bitmapApp->SetBitmap( m_info.GetAppIcon() );
75  }
76  else
77  {
78  wxIcon icon;
79  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad ) );
80  SetIcon( icon );
81  m_bitmapApp->SetBitmap( icon );
82  }
83 
84  m_titleName = aParent->GetAboutTitle();
85  m_staticTextAppTitle->SetLabel( m_titleName );
87  m_staticTextBuildVersion->SetLabel( wxT( "Version: " ) + m_info.GetBuildVersion() );
89 
90  SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
92 
93  GetSizer()->SetSizeHints( this );
94  SetFocus();
95  Centre();
96 }
wxString & GetLibVersion()
Definition: aboutinfo.h:112
wxStaticText * m_staticTextAppTitle
wxImageList * m_images
Definition: dialog_about.h:56
void createNotebooks()
wxString & GetBuildVersion()
Definition: aboutinfo.h:106
wxStaticText * m_staticTextLibVersion
wxIcon & GetAppIcon()
Wrapper to manage memory allocation for bitmaps.
Definition: aboutinfo.h:115
wxStaticBitmap * m_bitmapApp
DIALOG_ABOUT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("About"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(570, 500), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxStaticText * m_staticTextBuildVersion
#define _(s)
wxString GetCopyright()
Definition: aboutinfo.h:100
wxStaticText * m_staticTextCopyright
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
wxNotebook * m_notebook
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
const wxString & GetAboutTitle() const
wxString m_titleName
Definition: dialog_about.h:57
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:59

References _, color_materials, createNotebooks(), editor, Format(), EDA_BASE_FRAME::GetAboutTitle(), ABOUT_APP_INFO::GetAppIcon(), ABOUT_APP_INFO::GetBuildVersion(), ABOUT_APP_INFO::GetCopyright(), ABOUT_APP_INFO::GetLibVersion(), icon_kicad, info, KiBitmap(), language, library, DIALOG_ABOUT_BASE::m_bitmapApp, m_images, m_info, DIALOG_ABOUT_BASE::m_notebook, DIALOG_ABOUT_BASE::m_staticTextAppTitle, DIALOG_ABOUT_BASE::m_staticTextBuildVersion, DIALOG_ABOUT_BASE::m_staticTextCopyright, DIALOG_ABOUT_BASE::m_staticTextLibVersion, m_titleName, preference, recent, tools, and zip.

◆ ~DIALOG_ABOUT()

DIALOG_ABOUT::~DIALOG_ABOUT ( )

Definition at line 99 of file dialog_about.cpp.

100 {
101  delete m_images;
102 }
wxImageList * m_images
Definition: dialog_about.h:56

References m_images.

Member Function Documentation

◆ createFlexGridSizer()

wxFlexGridSizer * DIALOG_ABOUT::createFlexGridSizer ( )
private

Definition at line 105 of file dialog_about.cpp.

106 {
107  // three columns with vertical and horizontal extra space of two pixels
108  wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 3, 2, 2 );
109  fgSizer->SetFlexibleDirection( wxHORIZONTAL );
110  fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
111 
112  return fgSizer;
113 }

Referenced by createNotebookPage(), and createNotebookPageByCategory().

◆ createNotebookHtmlPage()

void DIALOG_ABOUT::createNotebookHtmlPage ( wxNotebook *  aParent,
const wxString &  aCaption,
IMAGES  aIconIndex,
const wxString &  aHtmlMessage,
bool  aSelection = false 
)
private

Definition at line 385 of file dialog_about.cpp.

388 {
389  wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
390  wxTAB_TRAVERSAL );
391 
392  wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
393 
394  int flags = aSelection ? wxHW_SCROLLBAR_AUTO : ( wxHW_SCROLLBAR_AUTO | wxHW_NO_SELECTION );
395 
396  // the HTML page is going to be created with previously created HTML content
397  HTML_WINDOW* htmlWindow = new HTML_WINDOW( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
398  flags );
399 
400  // HTML font set to font properties as they are used for widgets to have an unique look
401  // under different platforms with HTML
402  wxFont font = GetFont();
403  htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
404  htmlWindow->SetPage( html );
405 
406  // the HTML window shall not be used to open external links, thus this task is delegated
407  // to users default browser
408  htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
409  wxHtmlLinkEventHandler( DIALOG_ABOUT::onHtmlLinkClicked ), NULL, this );
410 
411  // no additional space around the HTML window as it is also the case by the other notebook pages
412  bSizer->Add( htmlWindow, 1, wxEXPAND, 0 );
413  panel->SetSizer( bSizer );
414 
415  aParent->AddPage( panel, aCaption, false, static_cast<int>( aIconIndex ) );
416 }
void onHtmlLinkClicked(wxHtmlLinkEvent &event)
bool SetPage(const wxString &aSource) override
Definition: html_window.cpp:38
Add dark theme support to wxHtmlWindow.
Definition: html_window.h:33

References onHtmlLinkClicked(), and HTML_WINDOW::SetPage().

Referenced by createNotebooks().

◆ createNotebookPage()

void DIALOG_ABOUT::createNotebookPage ( wxNotebook *  aParent,
const wxString &  aCaption,
IMAGES  aIconIndex,
const CONTRIBUTORS &  aContributors 
)
private

Definition at line 143 of file dialog_about.cpp.

145 {
146  wxPanel* outerPanel = new wxPanel( aParent );
147  wxBoxSizer* outerSizer = new wxBoxSizer( wxVERTICAL );
148 
149  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
150 
151  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( outerPanel, wxID_ANY,
152  wxDefaultPosition,
153  wxDefaultSize,
154  wxHSCROLL|wxVSCROLL );
155  m_scrolledWindow1->SetScrollRate( 5, 5 );
156 
157  /* Panel for additional space at the left,
158  * but can also be used to show an additional bitmap.
159  */
160  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
161 
162  wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
163 
164  for( size_t i=0; i<aContributors.GetCount(); ++i )
165  {
166  CONTRIBUTOR* contributor = &aContributors.Item( i );
167 
168  // Icon at first column
169  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
170  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
171 
172  // Name of contributor at second column
173  if ( contributor->GetName() != wxEmptyString )
174  {
175  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
176  contributor->GetName(),
177  wxDefaultPosition, wxDefaultSize, 0 );
178  m_staticText1->Wrap( -1 );
179  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
180  }
181  else
182  {
183  fgSizer1->AddSpacer( 5 );
184  }
185 
186  // Email address of contributor at third column
187  if ( contributor->GetExtra() != wxEmptyString )
188  {
189  wxStaticText* hyperlink = wxStaticTextRef( m_scrolledWindow1,
190  contributor->GetExtra() );
191  fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
192  }
193  else
194  {
195  fgSizer1->AddSpacer( 5 );
196  }
197  }
198 
199  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
200  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
201  m_scrolledWindow1->SetSizer( bSizer );
202  m_scrolledWindow1->Layout();
203  bSizer->Fit( m_scrolledWindow1 );
204 
205  outerSizer->Add( m_scrolledWindow1, 1, wxEXPAND, 0 );
206  outerPanel->SetSizer( outerSizer );
207 
208  aParent->AddPage( outerPanel, aCaption, false, static_cast<int>( aIconIndex ) );
209 }
wxFlexGridSizer * createFlexGridSizer()
wxString & GetName()
Definition: aboutinfo.h:191
wxString & GetExtra()
Definition: aboutinfo.h:192
wxStaticBitmap * createStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
wxStaticText * wxStaticTextRef(wxScrolledWindow *aParent, const wxString &aReference)
wxBitmap * GetIcon()
Definition: aboutinfo.h:195
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:160

References createFlexGridSizer(), createStaticBitmap(), CONTRIBUTOR::GetExtra(), CONTRIBUTOR::GetIcon(), CONTRIBUTOR::GetName(), and wxStaticTextRef().

Referenced by createNotebooks().

◆ createNotebookPageByCategory()

void DIALOG_ABOUT::createNotebookPageByCategory ( wxNotebook *  aParent,
const wxString &  aCaption,
IMAGES  aIconIndex,
const CONTRIBUTORS &  aContributors 
)
private

Definition at line 212 of file dialog_about.cpp.

215 {
216  // The left justification between wxStaticText and wxHyperlinkCtrl is different so
217  // we must pad to make the alignment look decent.
218  //
219  // @todo Just make all of the contributor lists HTML so the alignment is consistent.
220  wxString padding;
221 
222  // Of course the padding is different depending on the platform so we adjust the
223  // padding accordingly.
224 #if defined( __WXGTK__ )
225  padding += wxT( " " );
226 #endif
227  wxPanel* outerPanel = new wxPanel( aParent );
228  wxBoxSizer* outerSizer = new wxBoxSizer( wxVERTICAL );
229 
230  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
231 
232  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( outerPanel, wxID_ANY,
233  wxDefaultPosition,
234  wxDefaultSize,
235  wxHSCROLL|wxVSCROLL );
236  m_scrolledWindow1->SetScrollRate( 5, 5 );
237 
238  /* Panel for additional space at the left,
239  * but can also be used to show an additional bitmap.
240  */
241  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
242 
243  wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
244 
245  for( size_t i=0; i < aContributors.GetCount(); ++i )
246  {
247  CONTRIBUTOR* contributor = &aContributors.Item( i );
248 
249  wxBitmap* icon = contributor->GetIcon();
250  wxString category = contributor->GetCategory();
251 
252  /* to construct the next row we expect to have
253  * a category and a contributor that was not considered up to now
254  */
255  if( ( category != wxEmptyString ) && !( contributor->IsChecked() ) )
256  {
257  // Icon at first column
258  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, icon );
259  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
260 
261  // Category name at second column
262  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
263  contributor->GetCategory() + wxT( ":" ),
264  wxDefaultPosition, wxDefaultSize, 0 );
265  m_staticText1->SetFont( m_staticText1->GetFont().Bold() );
266  m_staticText1->Wrap( -1 );
267  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM|wxEXPAND, 2 );
268 
269  // Nothing at third column
270  fgSizer1->AddSpacer( 5 );
271 
272  // Now, all contributors of the same category will follow
273  for( size_t j=0; j < aContributors.GetCount(); ++j )
274  {
275  CONTRIBUTOR* sub_contributor = &aContributors.Item( j );
276 
277  if ( sub_contributor->GetCategory() == category )
278  {
279  // First column is empty
280  fgSizer1->AddSpacer( 5 );
281 
282  wxControl* ctrl;
283 
284  // No URL supplied, display normal text control
285  if( sub_contributor->GetUrl().IsEmpty() )
286  {
287  ctrl = new wxStaticText( m_scrolledWindow1, wxID_ANY,
288  padding + wxT( "• " ) + sub_contributor->GetName(),
289  wxDefaultPosition,
290  wxDefaultSize, 0 );
291  }
292  else
293  {
294  // Display a hyperlink control instead
295  ctrl = new wxHyperlinkCtrl( m_scrolledWindow1, wxID_ANY,
296  wxT( "• " ) + sub_contributor->GetName(),
297  sub_contributor->GetUrl(),
298  wxDefaultPosition,
299  wxDefaultSize,
300  wxBORDER_NONE | wxHL_CONTEXTMENU | wxHL_ALIGN_LEFT );
301  }
302 
303  m_staticText1->Wrap( -1 );
304 
305  fgSizer1->Add( ctrl, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
306 
307  // Email address of contributor at third column
308  if( sub_contributor->GetExtra() != wxEmptyString )
309  {
310  wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1,
311  sub_contributor->GetExtra() );
312  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
313  }
314  else
315  {
316  fgSizer1->AddSpacer( 5 );
317  }
318 
319  /* this contributor was added to the GUI,
320  * thus can be ignored next time
321  */
322  sub_contributor->SetChecked( true );
323  }
324  }
325  }
326  else
327  {
328  continue;
329  }
330  }
331 
332  /* Now, lets list the remaining contributors that have not been considered
333  * because they were not assigned to any category.
334  */
335  for ( size_t k=0; k < aContributors.GetCount(); ++k )
336  {
337  CONTRIBUTOR* contributor = &aContributors.Item( k );
338 
339  if ( contributor->IsChecked() )
340  continue;
341 
342  // Icon at first column
343  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
344  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
345 
346  // Name of contributor at second column
347  if( contributor->GetName() != wxEmptyString )
348  {
349  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
350  contributor->GetName(),
351  wxDefaultPosition, wxDefaultSize, 0 );
352  m_staticText1->Wrap( -1 );
353  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
354  }
355  else
356  {
357  fgSizer1->AddSpacer( 5 );
358  }
359 
360  // Email address of contributor at third column
361  if ( contributor->GetExtra() != wxEmptyString )
362  {
363  wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1, contributor->GetExtra() );
364  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
365  }
366  else
367  {
368  fgSizer1->AddSpacer( 5 );
369  }
370  }
371 
372  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
373  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
374  m_scrolledWindow1->SetSizer( bSizer );
375  m_scrolledWindow1->Layout();
376  bSizer->Fit( m_scrolledWindow1 );
377 
378  outerSizer->Add( m_scrolledWindow1, 1, wxEXPAND, 0 );
379  outerPanel->SetSizer( outerSizer );
380 
381  aParent->AddPage( outerPanel, aCaption, false, static_cast<int>( aIconIndex ) );
382 }
wxFlexGridSizer * createFlexGridSizer()
wxString & GetUrl()
Definition: aboutinfo.h:193
void SetChecked(bool status)
Definition: aboutinfo.h:196
wxString & GetCategory()
Definition: aboutinfo.h:194
wxString & GetName()
Definition: aboutinfo.h:191
wxString & GetExtra()
Definition: aboutinfo.h:192
wxStaticBitmap * createStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
wxStaticText * wxStaticTextRef(wxScrolledWindow *aParent, const wxString &aReference)
wxBitmap * GetIcon()
Definition: aboutinfo.h:195
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:160
bool IsChecked()
Definition: aboutinfo.h:197

References createFlexGridSizer(), createStaticBitmap(), CONTRIBUTOR::GetCategory(), CONTRIBUTOR::GetExtra(), CONTRIBUTOR::GetIcon(), CONTRIBUTOR::GetName(), CONTRIBUTOR::GetUrl(), CONTRIBUTOR::IsChecked(), CONTRIBUTOR::SetChecked(), and wxStaticTextRef().

Referenced by createNotebooks().

◆ createNotebooks()

void DIALOG_ABOUT::createNotebooks ( )
private

Definition at line 116 of file dialog_about.cpp.

117 {
120 
121  wxString version = GetVersionInfoData( m_titleName, true );
122 
123  createNotebookHtmlPage( m_notebook, _( "Version" ), IMAGES::VERSION, version, true );
124 
126  m_info.GetDevelopers() );
128  m_info.GetDocWriters() );
129 
131  m_info.GetLibrarians() );
132 
134  m_info.GetArtists() );
138  m_info.GetPackagers() );
139 
141 }
CONTRIBUTORS GetTranslators()
Definition: aboutinfo.h:90
wxString GetVersionInfoData(const wxString &aTitle, bool aHtml, bool aBrief)
Create a version info string for bug reports and the about dialog.
void createNotebookPageByCategory(wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const CONTRIBUTORS &aContributors)
CONTRIBUTORS GetLibrarians()
Definition: aboutinfo.h:88
void createNotebookPage(wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const CONTRIBUTORS &aContributors)
void createNotebookHtmlPage(wxNotebook *aParent, const wxString &aCaption, IMAGES aIconIndex, const wxString &aHtmlMessage, bool aSelection=false)
wxString & GetLicense()
Definition: aboutinfo.h:97
CONTRIBUTORS GetDocWriters()
Definition: aboutinfo.h:87
CONTRIBUTORS GetArtists()
Definition: aboutinfo.h:89
#define _(s)
wxNotebook * m_notebook
CONTRIBUTORS GetPackagers()
Definition: aboutinfo.h:91
CONTRIBUTORS GetDevelopers()
Definition: aboutinfo.h:86
wxString m_titleName
Definition: dialog_about.h:57
wxString & GetDescription()
Definition: aboutinfo.h:94
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:59

References _, ARTISTS, createNotebookHtmlPage(), createNotebookPage(), createNotebookPageByCategory(), DEVELOPERS, DOCWRITERS, ABOUT_APP_INFO::GetArtists(), ABOUT_APP_INFO::GetDescription(), ABOUT_APP_INFO::GetDevelopers(), ABOUT_APP_INFO::GetDocWriters(), ABOUT_APP_INFO::GetLibrarians(), ABOUT_APP_INFO::GetLicense(), ABOUT_APP_INFO::GetPackagers(), ABOUT_APP_INFO::GetTranslators(), GetVersionInfoData(), INFORMATION, LIBRARIANS, LICENSE, m_info, DIALOG_ABOUT_BASE::m_notebook, m_titleName, PACKAGERS, TRANSLATORS, and VERSION.

Referenced by DIALOG_ABOUT().

◆ createStaticBitmap()

wxStaticBitmap * DIALOG_ABOUT::createStaticBitmap ( wxScrolledWindow *  aParent,
wxBitmap *  icon 
)
private

Definition at line 428 of file dialog_about.cpp.

429 {
430  wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
431  wxDefaultPosition, wxDefaultSize, 0 );
432 
433  if( aIcon )
434  bitmap->SetBitmap( *aIcon );
435  else
436  bitmap->SetBitmap( KiBitmap( BITMAPS::right ) );
437 
438  return bitmap;
439 }
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105

References KiBitmap(), and right.

Referenced by createNotebookPage(), and createNotebookPageByCategory().

◆ onCopyVersionInfo()

void DIALOG_ABOUT::onCopyVersionInfo ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 448 of file dialog_about.cpp.

449 {
450  wxLogNull doNotLog; // disable logging of failed clipboard actions
451 
452  if( !wxTheClipboard->Open() )
453  {
454  wxMessageBox( _( "Could not open clipboard to write version information." ),
455  _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
456  return;
457  }
458 
459  wxString msg_version = GetVersionInfoData( m_titleName );
460 
461  wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
462  wxTheClipboard->Flush(); // Allow clipboard data to be available after KiCad closes
463  wxTheClipboard->Close();
464  m_btCopyVersionInfo->SetLabel( _( "Copied..." ) );
465 }
wxString GetVersionInfoData(const wxString &aTitle, bool aHtml, bool aBrief)
Create a version info string for bug reports and the about dialog.
#define _(s)
wxString m_titleName
Definition: dialog_about.h:57
wxButton * m_btCopyVersionInfo

References _, GetVersionInfoData(), DIALOG_ABOUT_BASE::m_btCopyVersionInfo, and m_titleName.

◆ onDonateClick()

void DIALOG_ABOUT::onDonateClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 468 of file dialog_about.cpp.

469 {
470  if( TOOL_MANAGER* mgr = static_cast<EDA_BASE_FRAME*>( GetParent() )->GetToolManager() )
471  mgr->RunAction( "common.SuiteControl.donate", true );
472 }
Master controller class:
Definition: tool_manager.h:54

References TOOLS_HOLDER::GetToolManager().

◆ onHtmlLinkClicked()

void DIALOG_ABOUT::onHtmlLinkClicked ( wxHtmlLinkEvent &  event)
private

Definition at line 442 of file dialog_about.cpp.

443 {
444  ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
445 }

Referenced by createNotebookHtmlPage().

◆ OnNotebookPageChanged()

void DIALOG_ABOUT::OnNotebookPageChanged ( wxNotebookEvent &  aEvent)
overrideprotectedvirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 482 of file dialog_about.cpp.

483 {
484  // Work around wxMac issue where the notebook pages are blank
485 #ifdef __WXMAC__
486  int page = aEvent.GetSelection();
487 
488  if( page >= 0 )
489  m_notebook->ChangeSelection( static_cast<unsigned>( page ) );
490 #endif
491 }
wxNotebook * m_notebook

References DIALOG_ABOUT_BASE::m_notebook.

◆ onReportBug()

void DIALOG_ABOUT::onReportBug ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 475 of file dialog_about.cpp.

476 {
477  if( TOOL_MANAGER* mgr = static_cast<EDA_BASE_FRAME*>( GetParent() )->GetToolManager() )
478  mgr->RunAction( "common.SuiteControl.reportBug", true );
479 }
Master controller class:
Definition: tool_manager.h:54

References TOOLS_HOLDER::GetToolManager().

◆ wxStaticTextRef()

wxStaticText * DIALOG_ABOUT::wxStaticTextRef ( wxScrolledWindow *  aParent,
const wxString &  aReference 
)
private

Definition at line 419 of file dialog_about.cpp.

420 {
421  wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
422  wxT( "(" ) + aReference + wxT( ")" ) );
423 
424  return text;
425 }

References text.

Referenced by createNotebookPage(), and createNotebookPageByCategory().

Member Data Documentation

◆ m_bitmapApp

wxStaticBitmap* DIALOG_ABOUT_BASE::m_bitmapApp
protectedinherited

Definition at line 38 of file dialog_about_base.h.

Referenced by DIALOG_ABOUT(), and DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE().

◆ m_btCopyVersionInfo

wxButton* DIALOG_ABOUT_BASE::m_btCopyVersionInfo
protectedinherited

◆ m_btDonate

wxButton* DIALOG_ABOUT_BASE::m_btDonate
protectedinherited

◆ m_btOk

wxButton* DIALOG_ABOUT_BASE::m_btOk
protectedinherited

Definition at line 47 of file dialog_about_base.h.

Referenced by DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE().

◆ m_btReportBug

wxButton* DIALOG_ABOUT_BASE::m_btReportBug
protectedinherited

◆ m_images

wxImageList* DIALOG_ABOUT::m_images
private

Definition at line 56 of file dialog_about.h.

Referenced by DIALOG_ABOUT(), and ~DIALOG_ABOUT().

◆ m_info

ABOUT_APP_INFO& DIALOG_ABOUT::m_info
private

Definition at line 59 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_notebook

wxNotebook* DIALOG_ABOUT_BASE::m_notebook
protectedinherited

◆ m_staticTextAppTitle

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextAppTitle
protectedinherited

Definition at line 39 of file dialog_about_base.h.

Referenced by DIALOG_ABOUT(), and DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE().

◆ m_staticTextBuildVersion

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextBuildVersion
protectedinherited

Definition at line 41 of file dialog_about_base.h.

Referenced by DIALOG_ABOUT(), and DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE().

◆ m_staticTextCopyright

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextCopyright
protectedinherited

Definition at line 40 of file dialog_about_base.h.

Referenced by DIALOG_ABOUT(), and DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE().

◆ m_staticTextLibVersion

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextLibVersion
protectedinherited

Definition at line 42 of file dialog_about_base.h.

Referenced by DIALOG_ABOUT(), and DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE().

◆ m_titleName

wxString DIALOG_ABOUT::m_titleName
private

Definition at line 57 of file dialog_about.h.

Referenced by createNotebooks(), DIALOG_ABOUT(), and onCopyVersionInfo().


The documentation for this class was generated from the following files: