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
 
wxNotebook * m_notebook
 
wxButton * m_btOk
 

Private Member Functions

void onHtmlLinkClicked (wxHtmlLinkEvent &event)
 
void onCopyVersionInfo (wxCommandEvent &event) override
 
void onReportBug (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( "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 388 of file dialog_about.cpp.

391 {
392  wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
393  wxTAB_TRAVERSAL );
394 
395  wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
396 
397  wxString htmlPage = wxEmptyString, htmlContent = html;
398 
399  // to have a unique look background color for HTML pages is set to the default as it is
400  // used for all the other widgets
401  wxString htmlColor = ( GetBackgroundColour() ).GetAsString( wxC2S_HTML_SYNTAX );
402  wxString textColor = GetForegroundColour().GetAsString( wxC2S_HTML_SYNTAX );
403  wxString linkColor =
404  wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ).GetAsString( wxC2S_HTML_SYNTAX );
405 
406  // beginning of HTML structure
407  htmlPage.Append( wxString::Format( wxT( "<html><body bgcolor='%s' text='%s' link='%s'>" ),
408  htmlColor, textColor, linkColor ) );
409 
410  htmlPage.Append( htmlContent );
411 
412  // end of HTML structure indicated by closing tags
413  htmlPage.Append( wxT( "</body></html>" ) );
414 
415  int flags = aSelection ? wxHW_SCROLLBAR_AUTO : ( wxHW_SCROLLBAR_AUTO | wxHW_NO_SELECTION );
416 
417  // the HTML page is going to be created with previously created HTML content
418  auto htmlWindow = new wxHtmlWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, flags );
419 
420  // HTML font set to font properties as they are used for widgets to have an unique look
421  // under different platforms with HTML
422  wxFont font = GetFont();
423  htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
424  htmlWindow->SetPage( htmlPage );
425 
426  // the HTML window shall not be used to open external links, thus this task is delegated
427  // to users default browser
428  htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
429  wxHtmlLinkEventHandler( DIALOG_ABOUT::onHtmlLinkClicked ), NULL, this );
430 
431  // no additional space around the HTML window as it is also the case by the other notebook pages
432  bSizer->Add( htmlWindow, 1, wxEXPAND, 0 );
433  panel->SetSizer( bSizer );
434 
435  aParent->AddPage( panel, aCaption, false, static_cast<int>( aIconIndex ) );
436 }
#define NULL
void onHtmlLinkClicked(wxHtmlLinkEvent &event)
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

References Format(), NULL, and onHtmlLinkClicked().

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 += " ";
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( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
266  wxFONTWEIGHT_BOLD, false,
267  wxEmptyString ) ); // bold font
268  m_staticText1->Wrap( -1 );
269  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM|wxEXPAND, 2 );
270 
271  // Nothing at third column
272  fgSizer1->AddSpacer( 5 );
273 
274  // Now, all contributors of the same category will follow
275  for( size_t j=0; j < aContributors.GetCount(); ++j )
276  {
277  CONTRIBUTOR* sub_contributor = &aContributors.Item( j );
278 
279  if ( sub_contributor->GetCategory() == category )
280  {
281  // First column is empty
282  fgSizer1->AddSpacer( 5 );
283 
284  wxControl* ctrl;
285 
286  // No URL supplied, display normal text control
287  if( sub_contributor->GetUrl().IsEmpty() )
288  {
289  ctrl = new wxStaticText( m_scrolledWindow1, wxID_ANY,
290  padding + wxT( "• " ) + sub_contributor->GetName(),
291  wxDefaultPosition,
292  wxDefaultSize, 0 );
293  }
294  else
295  {
296  // Display a hyperlink control instead
297  ctrl = new wxHyperlinkCtrl( m_scrolledWindow1, wxID_ANY,
298  wxT( "• " ) + sub_contributor->GetName(),
299  sub_contributor->GetUrl(),
300  wxDefaultPosition,
301  wxDefaultSize,
302  wxBORDER_NONE | wxHL_CONTEXTMENU | wxHL_ALIGN_LEFT );
303  }
304 
305  m_staticText1->Wrap( -1 );
306 
307  fgSizer1->Add( ctrl, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
308 
309  // Email address of contributor at third column
310  if( sub_contributor->GetExtra() != wxEmptyString )
311  {
312  wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1,
313  sub_contributor->GetExtra() );
314  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
315  }
316  else
317  {
318  fgSizer1->AddSpacer( 5 );
319  }
320 
321  /* this contributor was added to the GUI,
322  * thus can be ignored next time
323  */
324  sub_contributor->SetChecked( true );
325  }
326  }
327  }
328  else
329  {
330  continue;
331  }
332  }
333 
334  /* Now, lets list the remaining contributors that have not been considered
335  * because they were not assigned to any category.
336  */
337  for ( size_t k=0; k < aContributors.GetCount(); ++k )
338  {
339  CONTRIBUTOR* contributor = &aContributors.Item( k );
340 
341  if ( contributor->IsChecked() )
342  continue;
343 
344  // Icon at first column
345  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
346  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
347 
348  // Name of contributor at second column
349  if( contributor->GetName() != wxEmptyString )
350  {
351  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
352  contributor->GetName(),
353  wxDefaultPosition, wxDefaultSize, 0 );
354  m_staticText1->Wrap( -1 );
355  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
356  }
357  else
358  {
359  fgSizer1->AddSpacer( 5 );
360  }
361 
362  // Email address of contributor at third column
363  if ( contributor->GetExtra() != wxEmptyString )
364  {
365  wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1,
366  contributor->GetExtra() );
367  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
368  }
369  else
370  {
371  fgSizer1->AddSpacer( 5 );
372  }
373  }
374 
375  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
376  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
377  m_scrolledWindow1->SetSizer( bSizer );
378  m_scrolledWindow1->Layout();
379  bSizer->Fit( m_scrolledWindow1 );
380 
381  outerSizer->Add( m_scrolledWindow1, 1, wxEXPAND, 0 );
382  outerPanel->SetSizer( outerSizer );
383 
384  aParent->AddPage( outerPanel, aCaption, false, static_cast<int>( aIconIndex ) );
385 }
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 448 of file dialog_about.cpp.

449 {
450  wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
451  wxDefaultPosition, wxDefaultSize, 0 );
452 
453  if( aIcon )
454  {
455  bitmap->SetBitmap( *aIcon );
456  }
457  else
458  {
459  bitmap->SetBitmap( KiBitmap( BITMAPS::right ) );
460  }
461 
462  return bitmap;
463 }
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 472 of file dialog_about.cpp.

473 {
474  wxLogNull doNotLog; // disable logging of failed clipboard actions
475 
476  if( !wxTheClipboard->Open() )
477  {
478  wxMessageBox( _( "Could not open clipboard to write version information." ),
479  _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
480  return;
481  }
482 
483  wxString msg_version = GetVersionInfoData( m_titleName );
484 
485  wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
486  wxTheClipboard->Flush(); // Allow clipboard data to be available after KiCad closes
487  wxTheClipboard->Close();
488  m_btCopyVersionInfo->SetLabel( _( "Copied..." ) );
489 }
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.

◆ onHtmlLinkClicked()

void DIALOG_ABOUT::onHtmlLinkClicked ( wxHtmlLinkEvent &  event)
private

Definition at line 466 of file dialog_about.cpp.

467 {
468  ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
469 }

Referenced by createNotebookHtmlPage().

◆ OnNotebookPageChanged()

void DIALOG_ABOUT::OnNotebookPageChanged ( wxNotebookEvent &  aEvent)
overrideprotectedvirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 499 of file dialog_about.cpp.

500 {
501  // Work around wxMac issue where the notebook pages are blank
502 #ifdef __WXMAC__
503  int page = aEvent.GetSelection();
504 
505  if( page >= 0 )
506  m_notebook->ChangeSelection( static_cast<unsigned>( page ) );
507 #endif
508 }
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 492 of file dialog_about.cpp.

493 {
494  if( TOOL_MANAGER* mgr = static_cast<EDA_BASE_FRAME*>( GetParent() )->GetToolManager() )
495  mgr->RunAction( "common.SuiteControl.reportBug", true );
496 }
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 439 of file dialog_about.cpp.

440 {
441  wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
442  wxT( "(" ) + aReference + wxT( ")" ) );
443 
444  return text;
445 }

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_btOk

wxButton* DIALOG_ABOUT_BASE::m_btOk
protectedinherited

Definition at line 46 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: