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
 
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 ( EDA_BASE_FRAME aParent,
ABOUT_APP_INFO aAppInfo 
)

Definition at line 68 of file dialog_about.cpp.

References createNotebooks(), ABOUT_APP_INFO::GetAppIcon(), ABOUT_APP_INFO::GetAppName(), 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, and DIALOG_ABOUT_BASE::m_staticTextLibVersion.

69  : DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
70 {
71  m_picInformation = KiBitmap( info_xpm );
72  m_picDevelopers = KiBitmap( preference_xpm );
73  m_picDocWriters = KiBitmap( editor_xpm );
74  m_picArtists = KiBitmap( palette_xpm );
75  m_picTranslators = KiBitmap( language_xpm );
76  m_picLicense = KiBitmap( tools_xpm );
77  m_picPackagers = KiBitmap( zip_xpm );
78 
79  if( m_info.GetAppIcon().IsOk() )
80  {
81  SetIcon( m_info.GetAppIcon() );
82  m_bitmapApp->SetBitmap( m_info.GetAppIcon() );
83  }
84  else
85  {
86  wxIcon icon;
87  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
88  SetIcon( icon );
89  m_bitmapApp->SetBitmap( icon );
90  }
91 
92  m_staticTextAppTitle->SetLabel( m_info.GetAppName() );
94  m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
96 
98 
99  GetSizer()->SetSizeHints( this );
100  m_auiNotebook->Update();
101  SetFocus();
102  Centre();
103 }
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
wxString & GetAppName()
Definition: aboutinfo.h:96
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
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:53
DIALOG_ABOUT::~DIALOG_ABOUT ( )

Definition at line 106 of file dialog_about.cpp.

107 {
108 }

Member Function Documentation

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 436 of file dialog_about.cpp.

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

Referenced by onCopyVersionInfo(), and onShowVersionInfo().

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

Definition at line 111 of file dialog_about.cpp.

Referenced by createNotebookPage(), and createNotebookPageByCategory().

112 {
113  // three columns with vertical and horizontal extra space of two pixels
114  wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 3, 2, 2 );
115  fgSizer->SetFlexibleDirection( wxHORIZONTAL );
116  fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
117 
118  return fgSizer;
119 }
void DIALOG_ABOUT::createNotebookHtmlPage ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const wxString &  aHtmlMessage 
)
private

Definition at line 357 of file dialog_about.cpp.

References onHtmlLinkClicked().

Referenced by createNotebooks().

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

Definition at line 139 of file dialog_about.cpp.

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

Referenced by createNotebooks().

141 {
142  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
143 
144  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY,
145  wxDefaultPosition,
146  wxDefaultSize,
147  wxHSCROLL|wxVSCROLL );
148  m_scrolledWindow1->SetScrollRate( 5, 5 );
149 
150  /* Panel for additional space at the left,
151  * but can also be used to show an additional bitmap.
152  */
153  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
154 
155  wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
156 
157  for( size_t i=0; i<aContributors.GetCount(); ++i )
158  {
159  CONTRIBUTOR* contributor = &aContributors.Item( i );
160 
161  // Icon at first column
162  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
163  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
164 
165  // Name of contributor at second column
166  if ( contributor->GetName() != wxEmptyString )
167  {
168  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
169  contributor->GetName(),
170  wxDefaultPosition, wxDefaultSize, 0 );
171  m_staticText1->Wrap( -1 );
172  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
173  }
174  else
175  {
176  fgSizer1->AddSpacer( 5 );
177  }
178 
179  // Email address of contributor at third column
180  if ( contributor->GetEMail() != wxEmptyString )
181  {
182  wxStaticText* hyperlink = wxStaticTextMail( m_scrolledWindow1,
183  contributor->GetEMail() );
184  fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
185  }
186  else
187  {
188  fgSizer1->AddSpacer( 5 );
189  }
190  }
191 
192  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
193  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
194  m_scrolledWindow1->SetSizer( bSizer );
195  m_scrolledWindow1->Layout();
196  bSizer->Fit( m_scrolledWindow1 );
197  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
198 }
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
void DIALOG_ABOUT::createNotebookPageByCategory ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const CONTRIBUTORS &  aContributors 
)
private

Definition at line 201 of file dialog_about.cpp.

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

Referenced by createNotebooks().

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

Definition at line 122 of file dialog_about.cpp.

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().

123 {
126 
129 
134  m_info.GetPackagers() );
135 
137 }
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:53
void createNotebookPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)
wxStaticBitmap * DIALOG_ABOUT::createStaticBitmap ( wxScrolledWindow *  aParent,
wxBitmap *  icon 
)
private

Definition at line 412 of file dialog_about.cpp.

References KiBitmap().

Referenced by createNotebookPage(), and createNotebookPageByCategory().

413 {
414  wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
415  wxDefaultPosition, wxDefaultSize, 0 );
416 
417  if( aIcon )
418  {
419  bitmap->SetBitmap( *aIcon );
420  }
421  else
422  {
423  bitmap->SetBitmap( KiBitmap( right_xpm ) );
424  }
425 
426  return bitmap;
427 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
void DIALOG_ABOUT::initDialog ( )
private
void DIALOG_ABOUT::onCopyVersionInfo ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 614 of file dialog_about.cpp.

References buildVersionInfoData(), and DIALOG_ABOUT_BASE::m_btCopyVersionInfo.

615 {
616  if( !wxTheClipboard->Open() )
617  {
618  wxMessageBox( _( "Could not open clipboard to write version information." ),
619  _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
620  return;
621  }
622 
623  wxString msg_version;
624  buildVersionInfoData( msg_version, false );
625 
626  wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
627  wxTheClipboard->Close();
628  m_btCopyVersionInfo->SetLabel( _( "Copied..." ) );
629 }
void buildVersionInfoData(wxString &aMsg, bool aFormatHtml)
build the version info message
wxButton * m_btCopyVersionInfo
void DIALOG_ABOUT::onHtmlLinkClicked ( wxHtmlLinkEvent &  event)
private

Definition at line 430 of file dialog_about.cpp.

Referenced by createNotebookHtmlPage().

431 {
432  ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
433 }
void DIALOG_ABOUT::onShowVersionInfo ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_ABOUT_BASE.

Definition at line 601 of file dialog_about.cpp.

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

602 {
603  wxString msg_version;
604  buildVersionInfoData( msg_version, true );
605 
606  HTML_MESSAGE_BOX dlg( this, _( "Version Info" ));
607  dlg.SetDialogSizeInDU( 400, 350 );
608 
609  dlg.AddHTML_Text( msg_version );
610  dlg.ShowModal();
611 }
void buildVersionInfoData(wxString &aMsg, bool aFormatHtml)
build the version info message
Class HTML_MESSAGE_BOX.
wxStaticText * DIALOG_ABOUT::wxStaticTextMail ( wxScrolledWindow *  aParent,
const wxString &  email 
)
private

Definition at line 403 of file dialog_about.cpp.

Referenced by createNotebookPage(), and createNotebookPageByCategory().

404 {
405  wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
406  wxT( "<" ) + aEmail + wxT( ">" ) );
407 
408  return text;
409 }

Member Data Documentation

wxAuiNotebook* DIALOG_ABOUT_BASE::m_auiNotebook
protectedinherited
wxStaticBitmap* DIALOG_ABOUT_BASE::m_bitmapApp
protectedinherited

Definition at line 39 of file dialog_about_base.h.

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

wxButton* DIALOG_ABOUT_BASE::m_btCopyVersionInfo
protectedinherited
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().

wxButton* DIALOG_ABOUT_BASE::m_btShowVersionInfo
protectedinherited
ABOUT_APP_INFO& DIALOG_ABOUT::m_info
private

Definition at line 53 of file dialog_about.h.

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

wxBitmap DIALOG_ABOUT::m_picArtists
private

Definition at line 48 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxBitmap DIALOG_ABOUT::m_picDevelopers
private

Definition at line 46 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxBitmap DIALOG_ABOUT::m_picDocWriters
private

Definition at line 47 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxBitmap DIALOG_ABOUT::m_picInformation
private

Definition at line 45 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxBitmap DIALOG_ABOUT::m_picLicense
private

Definition at line 51 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxBitmap DIALOG_ABOUT::m_picPackagers
private

Definition at line 50 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxBitmap DIALOG_ABOUT::m_picTranslators
private

Definition at line 49 of file dialog_about.h.

Referenced by createNotebooks(), and DIALOG_ABOUT().

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextAppTitle
protectedinherited

Definition at line 40 of file dialog_about_base.h.

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

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextBuildVersion
protectedinherited

Definition at line 42 of file dialog_about_base.h.

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

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextCopyright
protectedinherited

Definition at line 41 of file dialog_about_base.h.

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

wxStaticText* DIALOG_ABOUT_BASE::m_staticTextLibVersion
protectedinherited

Definition at line 43 of file dialog_about_base.h.

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


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