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 Attributes

wxStaticBitmap * m_bitmapApp
 
wxStaticText * m_staticTextAppTitle
 
wxStaticText * m_staticTextCopyright
 
wxStaticText * m_staticTextBuildVersion
 
wxStaticText * m_staticTextLibVersion
 
wxAuiNotebook * m_auiNotebook
 
wxButton * m_btShowVersionInfo
 
wxButton * m_btCopyVersionInfo
 
wxButton * m_btOk
 

Private Member Functions

void initDialog ()
 
void buildVersionInfoData (wxString &aMsg, bool aFormatHtml)
 build the version info message More...
 
void onHtmlLinkClicked (wxHtmlLinkEvent &event)
 
virtual void onCopyVersionInfo (wxCommandEvent &event) override
 
virtual void onShowVersionInfo (wxCommandEvent &event) override
 
wxFlexGridSizer * createFlexGridSizer ()
 
void createNotebooks ()
 
void createNotebookPage (wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)
 
void createNotebookPageByCategory (wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)
 
void createNotebookHtmlPage (wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const wxString &aHtmlMessage)
 
wxStaticText * wxStaticTextMail (wxScrolledWindow *aParent, const wxString &email)
 
wxStaticBitmap * createStaticBitmap (wxScrolledWindow *aParent, wxBitmap *icon)
 

Private Attributes

wxBitmap m_picInformation
 
wxBitmap m_picDevelopers
 
wxBitmap m_picDocWriters
 
wxBitmap m_picArtists
 
wxBitmap m_picTranslators
 
wxBitmap m_picPackagers
 
wxBitmap m_picLicense
 
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 40 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 68 of file dialog_about.cpp.

69  : DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
70 {
71  wxASSERT( aParent != nullptr );
72 
73  m_picInformation = KiBitmap( info_xpm );
74  m_picDevelopers = KiBitmap( preference_xpm );
75  m_picDocWriters = KiBitmap( editor_xpm );
76  m_picArtists = KiBitmap( palette_xpm );
77  m_picTranslators = KiBitmap( language_xpm );
78  m_picLicense = KiBitmap( tools_xpm );
79  m_picPackagers = KiBitmap( zip_xpm );
80 
81  if( m_info.GetAppIcon().IsOk() )
82  {
83  SetIcon( m_info.GetAppIcon() );
84  m_bitmapApp->SetBitmap( m_info.GetAppIcon() );
85  }
86  else
87  {
88  wxIcon icon;
89  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
90  SetIcon( icon );
91  m_bitmapApp->SetBitmap( icon );
92  }
93 
94  m_titleName = aParent->GetAboutTitle();
95  m_staticTextAppTitle->SetLabel( m_titleName );
97  m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
99 
100  SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
101  createNotebooks();
102 
103  GetSizer()->SetSizeHints( this );
104  m_auiNotebook->Update();
105  SetFocus();
106  Centre();
107 }
wxAuiNotebook * m_auiNotebook
wxBitmap m_picDevelopers
Definition: dialog_about.h:46
wxString & GetLibVersion()
Definition: aboutinfo.h:102
wxStaticText * m_staticTextAppTitle
wxBitmap m_picPackagers
Definition: dialog_about.h:50
DIALOG_ABOUT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("About"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(750, 471), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void createNotebooks()
wxString & GetBuildVersion()
Definition: aboutinfo.h:99
wxStaticText * m_staticTextLibVersion
wxIcon & GetAppIcon()
Definition: aboutinfo.h:105
wxStaticBitmap * m_bitmapApp
wxBitmap m_picDocWriters
Definition: dialog_about.h:47
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
wxBitmap m_picArtists
Definition: dialog_about.h:48
wxStaticText * m_staticTextBuildVersion
wxBitmap m_picTranslators
Definition: dialog_about.h:49
wxString GetCopyright()
Definition: aboutinfo.h:93
wxStaticText * m_staticTextCopyright
wxBitmap m_picInformation
Definition: dialog_about.h:45
wxBitmap m_picLicense
Definition: dialog_about.h:51
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
const wxString & GetAboutTitle() const
wxString m_titleName
Definition: dialog_about.h:52
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:54

References createNotebooks(), Format(), EDA_BASE_FRAME::GetAboutTitle(), ABOUT_APP_INFO::GetAppIcon(), ABOUT_APP_INFO::GetBuildVersion(), ABOUT_APP_INFO::GetCopyright(), ABOUT_APP_INFO::GetLibVersion(), KiBitmap(), DIALOG_ABOUT_BASE::m_auiNotebook, DIALOG_ABOUT_BASE::m_bitmapApp, m_info, m_picArtists, m_picDevelopers, m_picDocWriters, m_picInformation, m_picLicense, m_picPackagers, m_picTranslators, DIALOG_ABOUT_BASE::m_staticTextAppTitle, DIALOG_ABOUT_BASE::m_staticTextBuildVersion, DIALOG_ABOUT_BASE::m_staticTextCopyright, DIALOG_ABOUT_BASE::m_staticTextLibVersion, and m_titleName.

◆ ~DIALOG_ABOUT()

DIALOG_ABOUT::~DIALOG_ABOUT ( )

Definition at line 110 of file dialog_about.cpp.

111 {
112 }

Member Function Documentation

◆ buildVersionInfoData()

void DIALOG_ABOUT::buildVersionInfoData ( wxString &  aMsg,
bool  aFormatHtml 
)
private

build the version info message

Parameters
aMsgis the result
aFormatHtml= true to use a minimal HTML format false to use a plain text

Definition at line 444 of file dialog_about.cpp.

445 {
446  // DO NOT translate information in the msg_version string
447 
448  wxString eol = aFormatHtml ? "<br>" : "\n";
449  wxString indent4 = aFormatHtml ? "&nbsp;&nbsp;&nbsp;&nbsp;" : " ";
450 
451  #define ON "ON" << eol
452  #define OFF "OFF" << eol
453 
454  wxPlatformInfo platform;
455  aMsg << "Application: " << m_titleName << eol;
456  aMsg << "Version: " << m_info.GetBuildVersion() << eol;
457  aMsg << "Libraries:" << eol;
458  aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
459 
460 #ifdef BUILD_GITHUB_PLUGIN
461  aMsg << indent4 << GetKicadCurlVersion() << eol;
462 #endif
463  aMsg << "Platform: " << wxGetOsDescription() << ", "
464  << platform.GetArchName() << ", "
465  << platform.GetEndiannessName() << ", "
466  << platform.GetPortIdName() << eol;
467 
468  aMsg << "Build Info:" << eol;
469  aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
470  aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")";
471 
472  // Get the GTK+ version where possible.
473 #ifdef __WXGTK__
474  int major, minor;
475 
476  major = wxPlatformInfo().Get().GetToolkitMajorVersion();
477  minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
478  aMsg << " GTK+ " << major << "." << minor;
479 #endif
480 
481  aMsg << eol;
482 
483  aMsg << indent4 << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
484  << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
485  << ( BOOST_VERSION % 100 ) << eol;
486 
487 #ifdef KICAD_USE_OCC
488  aMsg << indent4 << "OpenCASCADE Technology: " << OCC_VERSION_COMPLETE << eol;
489 #endif
490 
491 #ifdef KICAD_USE_OCE
492  aMsg << indent4 << "OpenCASCADE Community Edition: " << OCC_VERSION_COMPLETE << eol;
493 #endif
494 
495 #ifdef BUILD_GITHUB_PLUGIN
496  aMsg << indent4 << "Curl: " << GetCurlLibVersion() << eol;
497 #endif
498 
499  aMsg << indent4 << "Compiler: ";
500 #if defined(__clang__)
501  aMsg << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
502 #elif defined(__GNUG__)
503  aMsg << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
504 #elif defined(_MSC_VER)
505  aMsg << "Visual C++ " << _MSC_VER;
506 #elif defined(__INTEL_COMPILER)
507  aMsg << "Intel C++ " << __INTEL_COMPILER;
508 #else
509  aMsg << "Other Compiler ";
510 #endif
511 
512 #if defined(__GXX_ABI_VERSION)
513  aMsg << " with C++ ABI " << __GXX_ABI_VERSION << eol;
514 #else
515  aMsg << " without C++ ABI";
516 #endif
517 
518  aMsg << eol;
519 
520  // Add build settings config (build options):
521  aMsg << "Build settings:" << eol;
522 
523  aMsg << indent4 << "USE_WX_GRAPHICS_CONTEXT=";
524 #ifdef USE_WX_GRAPHICS_CONTEXT
525  aMsg << ON;
526 #else
527  aMsg << OFF;
528 #endif
529 
530  aMsg << indent4 << "USE_WX_OVERLAY=";
531 #ifdef USE_WX_OVERLAY
532  aMsg << ON;
533 #else
534  aMsg << OFF;
535 #endif
536 
537  aMsg << indent4 << "KICAD_SCRIPTING=";
538 #ifdef KICAD_SCRIPTING
539  aMsg << ON;
540 #else
541  aMsg << OFF;
542 #endif
543 
544  aMsg << indent4 << "KICAD_SCRIPTING_MODULES=";
545 #ifdef KICAD_SCRIPTING_MODULES
546  aMsg << ON;
547 #else
548  aMsg << OFF;
549 #endif
550 
551  aMsg << indent4 << "KICAD_SCRIPTING_PYTHON3=";
552 #ifdef KICAD_SCRIPTING_PYTHON3
553  aMsg << ON;
554 #else
555  aMsg << OFF;
556 #endif
557 
558  aMsg << indent4 << "KICAD_SCRIPTING_WXPYTHON=";
559 #ifdef KICAD_SCRIPTING_WXPYTHON
560  aMsg << ON;
561 #else
562  aMsg << OFF;
563 #endif
564 
565  aMsg << indent4 << "KICAD_SCRIPTING_WXPYTHON_PHOENIX=";
566 #ifdef KICAD_SCRIPTING_WXPYTHON_PHOENIX
567  aMsg << ON;
568 #else
569  aMsg << OFF;
570 #endif
571 
572  aMsg << indent4 << "KICAD_SCRIPTING_ACTION_MENU=";
573 #ifdef KICAD_SCRIPTING_ACTION_MENU
574  aMsg << ON;
575 #else
576  aMsg << OFF;
577 #endif
578 
579  aMsg << indent4 << "BUILD_GITHUB_PLUGIN=";
580 #ifdef BUILD_GITHUB_PLUGIN
581  aMsg << ON;
582 #else
583  aMsg << OFF;
584 #endif
585 
586  aMsg << indent4 << "KICAD_USE_OCE=";
587 #ifdef KICAD_USE_OCE
588  aMsg << ON;
589 #else
590  aMsg << OFF;
591 #endif
592 
593  aMsg << indent4 << "KICAD_USE_OCC=";
594 #ifdef KICAD_USE_OCC
595  aMsg << ON;
596 #else
597  aMsg << OFF;
598 #endif
599 
600  aMsg << indent4 << "KICAD_SPICE=";
601 #ifdef KICAD_SPICE
602  aMsg << ON;
603 #else
604  aMsg << OFF;
605 #endif
606 }
#define OFF
wxString & GetBuildVersion()
Definition: aboutinfo.h:99
std::string GetKicadCurlVersion()
Definition: kicad_curl.cpp:241
std::string GetCurlLibVersion()
Definition: kicad_curl.cpp:246
wxString m_titleName
Definition: dialog_about.h:52
#define ON
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:54

References ABOUT_APP_INFO::GetBuildVersion(), GetCurlLibVersion(), GetKicadCurlVersion(), m_info, m_titleName, OFF, and ON.

Referenced by onCopyVersionInfo(), and onShowVersionInfo().

◆ createFlexGridSizer()

wxFlexGridSizer * DIALOG_ABOUT::createFlexGridSizer ( )
private

Definition at line 115 of file dialog_about.cpp.

116 {
117  // three columns with vertical and horizontal extra space of two pixels
118  wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 3, 2, 2 );
119  fgSizer->SetFlexibleDirection( wxHORIZONTAL );
120  fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
121 
122  return fgSizer;
123 }

Referenced by createNotebookPage(), and createNotebookPageByCategory().

◆ createNotebookHtmlPage()

void DIALOG_ABOUT::createNotebookHtmlPage ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const wxString &  aHtmlMessage 
)
private

Definition at line 365 of file dialog_about.cpp.

367 {
368  wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
369  wxTAB_TRAVERSAL );
370 
371  wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
372 
373  wxString htmlPage = wxEmptyString, htmlContent = html;
374 
375  // to have a unique look background color for HTML pages is set to the default as it is
376  // used for all the other widgets
377  wxString htmlColor = ( this->GetBackgroundColour() ).GetAsString( wxC2S_HTML_SYNTAX );
378 
379  // beginning of HTML structure
380  htmlPage.Append( wxT( "<html><body bgcolor='" ) + htmlColor + wxT( "'>" ) );
381 
382  htmlPage.Append( htmlContent );
383 
384  // end of HTML structure indicated by closing tags
385  htmlPage.Append( wxT( "</body></html>" ) );
386 
387  // the HTML page is going to be created with previously created HTML content
388  wxHtmlWindow* htmlWindow = new wxHtmlWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
389  wxHW_SCROLLBAR_AUTO|wxHW_NO_SELECTION );
390 
391  // HTML font set to font properties as they are used for widgets to have an unique look
392  // under different platforms with HTML
393  wxFont font = this->GetFont();
394  htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
395  htmlWindow->SetPage( htmlPage );
396 
397  // the HTML window shall not be used to open external links, thus this task is delegated
398  // to users default browser
399  htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
400  wxHtmlLinkEventHandler( DIALOG_ABOUT::onHtmlLinkClicked ), NULL, this );
401 
402  // no additional space around the HTML window as it is also the case by the other notebook pages
403  bSizer->Add( htmlWindow, 1, wxALL|wxEXPAND, 0 );
404  panel->SetSizer( bSizer );
405  panel->Layout();
406  bSizer->Fit( panel );
407  aParent->AddPage( panel, aCaption, false, aIcon );
408 }
void onHtmlLinkClicked(wxHtmlLinkEvent &event)

References onHtmlLinkClicked().

Referenced by createNotebooks().

◆ createNotebookPage()

void DIALOG_ABOUT::createNotebookPage ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const CONTRIBUTORS &  aContributors 
)
private

Definition at line 146 of file dialog_about.cpp.

148 {
149  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
150 
151  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, 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->GetEMail() != wxEmptyString )
188  {
189  wxStaticText* hyperlink = wxStaticTextMail( m_scrolledWindow1,
190  contributor->GetEMail() );
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  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
205 }
wxFlexGridSizer * createFlexGridSizer()
wxString & GetName()
Definition: aboutinfo.h:167
wxStaticText * wxStaticTextMail(wxScrolledWindow *aParent, const wxString &email)
wxString & GetEMail()
Definition: aboutinfo.h:168
wxStaticBitmap * createStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
wxBitmap * GetIcon()
Definition: aboutinfo.h:171
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:148
size_t i
Definition: json11.cpp:597

References createFlexGridSizer(), createStaticBitmap(), CONTRIBUTOR::GetEMail(), CONTRIBUTOR::GetIcon(), CONTRIBUTOR::GetName(), i, and wxStaticTextMail().

Referenced by createNotebooks().

◆ createNotebookPageByCategory()

void DIALOG_ABOUT::createNotebookPageByCategory ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const CONTRIBUTORS &  aContributors 
)
private

Definition at line 208 of file dialog_about.cpp.

211 {
212  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
213 
214  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY,
215  wxDefaultPosition,
216  wxDefaultSize,
217  wxHSCROLL|wxVSCROLL );
218  m_scrolledWindow1->SetScrollRate( 5, 5 );
219 
220  /* Panel for additional space at the left,
221  * but can also be used to show an additional bitmap.
222  */
223  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
224 
225  wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
226 
227  for( size_t i=0; i < aContributors.GetCount(); ++i )
228  {
229  CONTRIBUTOR* contributor = &aContributors.Item( i );
230 
231  wxBitmap* icon = contributor->GetIcon();
232  wxString category = contributor->GetCategory();
233 
234  /* to construct the next row we expect to have
235  * a category and a contributor that was not considered up to now
236  */
237  if( ( category != wxEmptyString ) && !( contributor->IsChecked() ) )
238  {
239  // Icon at first column
240  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, icon );
241  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
242 
243  // Category name at second column
244  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
245  contributor->GetCategory() + wxT( ":" ),
246  wxDefaultPosition, wxDefaultSize, 0 );
247  m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
248  wxFONTWEIGHT_BOLD, false,
249  wxEmptyString ) ); // bold font
250  m_staticText1->Wrap( -1 );
251  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
252 
253  // Nothing at third column
254  fgSizer1->AddSpacer( 5 );
255 
256  // Now, all contributors of the same category will follow
257  for( size_t j=0; j < aContributors.GetCount(); ++j )
258  {
259  CONTRIBUTOR* sub_contributor = &aContributors.Item( j );
260 
261  if ( sub_contributor->GetCategory() == category )
262  {
263  // First column is empty
264  fgSizer1->AddSpacer(5);
265 
266  wxControl* ctrl;
267 
268  // No URL supplied, display normal text control
269  if( sub_contributor->GetUrl().IsEmpty() )
270  {
271  ctrl = new wxStaticText( m_scrolledWindow1, wxID_ANY,
272  wxT( " • " ) + sub_contributor->GetName(),
273  wxDefaultPosition,
274  wxDefaultSize, 0 );
275  }
276  else
277  {
278  // Display a hyperlink control instead
279  ctrl = new wxHyperlinkCtrl( m_scrolledWindow1, wxID_ANY,
280  wxT( "• " ) + sub_contributor->GetName(),
281  sub_contributor->GetUrl(),
282  wxDefaultPosition,
283  wxDefaultSize, wxHL_ALIGN_LEFT );
284  }
285 
286  m_staticText1->Wrap( -1 );
287 
288  fgSizer1->Add( ctrl, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
289 
290  // Email address of contributor at third column
291  if( sub_contributor->GetEMail() != wxEmptyString )
292  {
293  wxStaticText* mail = wxStaticTextMail( m_scrolledWindow1,
294  sub_contributor->GetEMail() );
295  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
296  }
297  else
298  {
299  fgSizer1->AddSpacer( 5 );
300  }
301 
302  /* this contributor was added to the GUI,
303  * thus can be ignored next time
304  */
305  sub_contributor->SetChecked( true );
306  }
307  }
308  }
309  else
310  {
311  continue;
312  }
313  }
314 
315  /* Now, lets list the remaining contributors that have not been considered
316  * because they were not assigned to any category.
317  */
318  for ( size_t k=0; k < aContributors.GetCount(); ++k )
319  {
320  CONTRIBUTOR* contributor = &aContributors.Item( k );
321 
322  if ( contributor->IsChecked() )
323  continue;
324 
325  // Icon at first column
326  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
327  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
328 
329  // Name of contributor at second column
330  if( contributor->GetName() != wxEmptyString )
331  {
332  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
333  contributor->GetName(),
334  wxDefaultPosition, wxDefaultSize, 0 );
335  m_staticText1->Wrap( -1 );
336  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
337  }
338  else
339  {
340  fgSizer1->AddSpacer( 5 );
341  }
342 
343  // Email address of contributor at third column
344  if ( contributor->GetEMail() != wxEmptyString )
345  {
346  wxStaticText* mail = wxStaticTextMail( m_scrolledWindow1,
347  contributor->GetEMail() );
348  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
349  }
350  else
351  {
352  fgSizer1->AddSpacer( 5 );
353  }
354  }
355 
356  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
357  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
358  m_scrolledWindow1->SetSizer( bSizer );
359  m_scrolledWindow1->Layout();
360  bSizer->Fit( m_scrolledWindow1 );
361  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
362 }
wxFlexGridSizer * createFlexGridSizer()
wxString & GetUrl()
Definition: aboutinfo.h:169
void SetChecked(bool status)
Definition: aboutinfo.h:172
wxString & GetCategory()
Definition: aboutinfo.h:170
wxString & GetName()
Definition: aboutinfo.h:167
wxStaticText * wxStaticTextMail(wxScrolledWindow *aParent, const wxString &email)
wxString & GetEMail()
Definition: aboutinfo.h:168
wxStaticBitmap * createStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
wxBitmap * GetIcon()
Definition: aboutinfo.h:171
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:148
size_t i
Definition: json11.cpp:597
bool IsChecked()
Definition: aboutinfo.h:173

References createFlexGridSizer(), createStaticBitmap(), CONTRIBUTOR::GetCategory(), CONTRIBUTOR::GetEMail(), CONTRIBUTOR::GetIcon(), CONTRIBUTOR::GetName(), CONTRIBUTOR::GetUrl(), i, CONTRIBUTOR::IsChecked(), CONTRIBUTOR::SetChecked(), and wxStaticTextMail().

Referenced by createNotebooks().

◆ createNotebooks()

void DIALOG_ABOUT::createNotebooks ( )
private

Definition at line 126 of file dialog_about.cpp.

127 {
130 
131  createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers,
132  m_info.GetDevelopers() );
133  createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters,
134  m_info.GetDocWriters() );
135 
137  m_info.GetArtists() );
141  m_info.GetPackagers() );
142 
144 }
wxAuiNotebook * m_auiNotebook
wxBitmap m_picDevelopers
Definition: dialog_about.h:46
CONTRIBUTORS GetTranslators()
Definition: aboutinfo.h:83
void createNotebookPageByCategory(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)
wxBitmap m_picPackagers
Definition: dialog_about.h:50
wxString & GetLicense()
Definition: aboutinfo.h:90
wxBitmap m_picDocWriters
Definition: dialog_about.h:47
wxBitmap m_picArtists
Definition: dialog_about.h:48
CONTRIBUTORS GetDocWriters()
Definition: aboutinfo.h:81
CONTRIBUTORS GetArtists()
Definition: aboutinfo.h:82
wxBitmap m_picTranslators
Definition: dialog_about.h:49
void createNotebookHtmlPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const wxString &aHtmlMessage)
wxBitmap m_picInformation
Definition: dialog_about.h:45
wxBitmap m_picLicense
Definition: dialog_about.h:51
CONTRIBUTORS GetPackagers()
Definition: aboutinfo.h:84
CONTRIBUTORS GetDevelopers()
Definition: aboutinfo.h:80
wxString & GetDescription()
Definition: aboutinfo.h:87
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:54
void createNotebookPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)

References createNotebookHtmlPage(), createNotebookPage(), createNotebookPageByCategory(), ABOUT_APP_INFO::GetArtists(), ABOUT_APP_INFO::GetDescription(), ABOUT_APP_INFO::GetDevelopers(), ABOUT_APP_INFO::GetDocWriters(), ABOUT_APP_INFO::GetLicense(), ABOUT_APP_INFO::GetPackagers(), ABOUT_APP_INFO::GetTranslators(), DIALOG_ABOUT_BASE::m_auiNotebook, m_info, m_picArtists, m_picDevelopers, m_picDocWriters, m_picInformation, m_picLicense, m_picPackagers, and m_picTranslators.

Referenced by DIALOG_ABOUT().

◆ createStaticBitmap()

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

Definition at line 420 of file dialog_about.cpp.

421 {
422  wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
423  wxDefaultPosition, wxDefaultSize, 0 );
424 
425  if( aIcon )
426  {
427  bitmap->SetBitmap( *aIcon );
428  }
429  else
430  {
431  bitmap->SetBitmap( KiBitmap( right_xpm ) );
432  }
433 
434  return bitmap;
435 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79

References KiBitmap().

Referenced by createNotebookPage(), and createNotebookPageByCategory().

◆ initDialog()

void DIALOG_ABOUT::initDialog ( )
private

◆ onCopyVersionInfo()

void DIALOG_ABOUT::onCopyVersionInfo ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 622 of file dialog_about.cpp.

623 {
624  if( !wxTheClipboard->Open() )
625  {
626  wxMessageBox( _( "Could not open clipboard to write version information." ),
627  _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
628  return;
629  }
630 
631  wxString msg_version;
632  buildVersionInfoData( msg_version, false );
633 
634  wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
635  wxTheClipboard->Close();
636  m_btCopyVersionInfo->SetLabel( _( "Copied..." ) );
637 }
void buildVersionInfoData(wxString &aMsg, bool aFormatHtml)
build the version info message
wxButton * m_btCopyVersionInfo

References buildVersionInfoData(), and DIALOG_ABOUT_BASE::m_btCopyVersionInfo.

◆ onHtmlLinkClicked()

void DIALOG_ABOUT::onHtmlLinkClicked ( wxHtmlLinkEvent &  event)
private

Definition at line 438 of file dialog_about.cpp.

439 {
440  ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
441 }

Referenced by createNotebookHtmlPage().

◆ onShowVersionInfo()

void DIALOG_ABOUT::onShowVersionInfo ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 609 of file dialog_about.cpp.

610 {
611  wxString msg_version;
612  buildVersionInfoData( msg_version, true );
613 
614  HTML_MESSAGE_BOX dlg( this, _( "Version Info" ));
615  dlg.SetDialogSizeInDU( 400, 350 );
616 
617  dlg.AddHTML_Text( msg_version );
618  dlg.ShowModal();
619 }
void buildVersionInfoData(wxString &aMsg, bool aFormatHtml)
build the version info message
Class HTML_MESSAGE_BOX.

References HTML_MESSAGE_BOX::AddHTML_Text(), buildVersionInfoData(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

◆ wxStaticTextMail()

wxStaticText * DIALOG_ABOUT::wxStaticTextMail ( wxScrolledWindow *  aParent,
const wxString &  email 
)
private

Definition at line 411 of file dialog_about.cpp.

412 {
413  wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
414  wxT( "<" ) + aEmail + wxT( ">" ) );
415 
416  return text;
417 }

Referenced by createNotebookPage(), and createNotebookPageByCategory().

Member Data Documentation

◆ m_auiNotebook

wxAuiNotebook* DIALOG_ABOUT_BASE::m_auiNotebook
protectedinherited

◆ 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_btShowVersionInfo

wxButton* DIALOG_ABOUT_BASE::m_btShowVersionInfo
protectedinherited

◆ m_info

ABOUT_APP_INFO& DIALOG_ABOUT::m_info
private

Definition at line 54 of file dialog_about.h.

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

◆ m_picArtists

wxBitmap DIALOG_ABOUT::m_picArtists
private

Definition at line 48 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_picDevelopers

wxBitmap DIALOG_ABOUT::m_picDevelopers
private

Definition at line 46 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_picDocWriters

wxBitmap DIALOG_ABOUT::m_picDocWriters
private

Definition at line 47 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_picInformation

wxBitmap DIALOG_ABOUT::m_picInformation
private

Definition at line 45 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_picLicense

wxBitmap DIALOG_ABOUT::m_picLicense
private

Definition at line 51 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_picPackagers

wxBitmap DIALOG_ABOUT::m_picPackagers
private

Definition at line 50 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ m_picTranslators

wxBitmap DIALOG_ABOUT::m_picTranslators
private

Definition at line 49 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

◆ 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 52 of file dialog_about.h.

Referenced by buildVersionInfoData(), and DIALOG_ABOUT().


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