Commit 72c48d46 authored by jean-pierre charras's avatar jean-pierre charras

Added new KiCad about dialog, from Rafael Sokolowski <Rafael.Sokolowski@web.de>

parent 7e56bf28
......@@ -5,7 +5,14 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
../polygon
)
set( COMMON_ABOUT_DLG_SRCS
dialog_about/AboutDialog_main.cpp
dialog_about/dialog_about.cpp
dialog_about/dialog_about_base.cpp
)
set(COMMON_SRCS
${COMMON_ABOUT_DLG_SRCS}
about_kicad.cpp
base_screen.cpp
base_struct.cpp
......
......@@ -22,6 +22,8 @@
#include "macros.h"
#include "bitmaps.h"
// Uncomment this line to use the new KiCad About dialog
#define USE_NEW_ABOUT_DIALOG
/*
* Class constructor for WinEDA_BasicFrame general options
......@@ -286,9 +288,14 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
*/
void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
{
#ifdef USE_NEW_ABOUT_DIALOG
bool ShowAboutDialog(wxWindow * parent);
ShowAboutDialog(this);
#else
wxAboutDialogInfo info;
InitKiCadAbout(info);
wxAboutBox(info);
#endif
}
......
This diff is collapsed.
#ifndef ABOUTAPPINFO_H
#define ABOUTAPPINFO_H
#include <wx/aboutdlg.h>
#include <wx/bitmap.h>
#include <wx/dynarray.h>
class Contributor;
WX_DECLARE_OBJARRAY( Contributor, Contributors );
/**
* An object of this class is meant to be used to store application specific information
* like who has contributed in which area of the application, the license, copyright
* and other descriptive information.
*/
class AboutAppInfo
{
public:
AboutAppInfo() {};
virtual ~AboutAppInfo() {};
void AddDeveloper( const Contributor* developer ) { if( developer != NULL )
developers.Add( developer );}
void AddDocWriter( const Contributor* docwriter ) { if( docwriter != NULL )
docwriters.Add( docwriter );}
void AddArtist( const Contributor* artist ) { if( artist != NULL )
artists.Add( artist );}
void AddTranslator( const Contributor* translator ) { if( translator != NULL )
translators.Add( translator );}
Contributors GetDevelopers() { return developers; }
Contributors GetDocWriters() { return docwriters; }
Contributors GetArtists() { return artists; }
Contributors GetTranslators() { return translators; }
void SetDescription( const wxString& text ) { description = text; }
wxString& GetDescription() { return description; }
void SetLicense( const wxString& text ) { license = text; }
wxString& GetLicense() { return license; }
void SetCopyright( const wxString& text ) { copyright = text; }
wxString GetCopyright()
{
wxString copyrightText = copyright;
#if wxUSE_UNICODE
const wxString utf8_copyrightSign = wxString::FromUTF8( "\xc2\xa9" );
copyrightText.Replace( _T( "(c)" ), utf8_copyrightSign );
copyrightText.Replace( _T( "(C)" ), utf8_copyrightSign );
#endif // wxUSE_UNICODE
return copyrightText;
}
void SetAppName( const wxString& name ) { appName = name; }
wxString& GetAppName() { return appName; }
void SetBuildVersion( const wxString& version ) { buildVersion = version; }
wxString& GetBuildVersion() { return buildVersion; }
void SetLibVersion( const wxString& version ) { libVersion = version; }
wxString& GetLibVersion() { return libVersion; }
void SetIcon( const wxIcon& icon ) { appIcon = icon; }
wxIcon& GetIcon() { return appIcon; }
protected:
private:
Contributors developers;
Contributors docwriters;
Contributors artists;
Contributors translators;
wxString description;
wxString license;
wxString copyright; // Todo: copyright sign in unicode
wxString appName;
wxString buildVersion;
wxString libVersion;
wxIcon appIcon;
};
/**
* A contributor, a person which was involved in the development of the application
* or which has contributed in any kind somehow to the project.
*
* A contributor consists of the following mandatory information:
* - Name
* - EMail address
*
* Each contributor can have optional information assigned like:
* - A category
* - A category specific icon
*/
class Contributor
{
public:
Contributor( const wxString& name,
const wxString& email,
const wxString& category = wxEmptyString,
wxBitmap* icon = NULL ) :
m_checked( false )
{ m_name = name; m_email = email; m_category = category; m_icon = icon; }
virtual ~Contributor() {}
wxString& GetName() { return m_name; }
wxString& GetEMail() { return m_email; }
wxString& GetCategory() { return m_category; }
wxBitmap* GetIcon() { return m_icon; }
void SetChecked( bool status ) { m_checked = status; }
bool IsChecked() { return m_checked; }
protected:
private:
wxString m_name;
wxString m_email;
wxString m_category;
wxBitmap* m_icon;
bool m_checked;
};
#endif // ABOUTAPPINFO_H
This diff is collapsed.
/***************************************************************
* Name: dialog_about.h
* Purpose: Defines Application Frame
* Author: Rafael Sokolowski (rafael.sokolowski@web.de)
* Created: 2010-08-06
* Copyright: Rafael Sokolowski ()
* License:
**************************************************************/
#ifndef DIALOG_ABOUT_H
#define DIALOG_ABOUT_H
#include <wx/html/htmlwin.h>
#include <wx/statbmp.h>
#include <wx/stattext.h>
#include <wx/hyperlink.h>
#include "aboutinfo.h"
#include "dialog_about_base.h"
/* Pixel information of icons in XPM format.
* All KiCad icons are linked into shared library 'libbitmaps.a'.
* Icons:
* preference_xpm[]; // Icon for 'Developers' tab
* editor_xpm[]; // Icon for 'Doc Writers' tab
* palette_xpm[]; // Icon for 'Artists' tab
* language_xpm[]; // Icon for 'Translators' tab
* right_xpm[]; // Right arrow icon for list items
* info_xpm[]; // Bulb for description tab
* tools_xpm[]; // Sheet of paper icon for license info tab
*/
#include "bitmaps.h"
/**
* About dialog to show application specific information.
* Needs an <code>AboutAppInfo</code> object that contains the data to be displayed.
*/
class dialog_about : public dialog_about_base
{
private:
// Icons for the various tabs of wxAuiNotebook
wxBitmap picInformation, picDevelopers, picDocWriters, picArtists, picTranslators,
picLicense;
AboutAppInfo info;
public:
dialog_about( wxWindow* dlg, AboutAppInfo& appInfo );
~dialog_about();
private:
void initDialog();
virtual void OnClose( wxCloseEvent& event );
virtual void OnOkClick( wxCommandEvent& event );
virtual void OnHtmlLinkClicked( wxHtmlLinkEvent& event );
// Notebook pages
wxFlexGridSizer* CreateFlexGridSizer();
void DeleteNotebooks();
void CreateNotebooks();
void CreateNotebookPage( wxAuiNotebook* parent,
const wxString& caption,
const wxBitmap& icon,
const Contributors& contributors );
void CreateNotebookPageByCategory( wxAuiNotebook* parent,
const wxString& caption,
const wxBitmap& icon,
const Contributors& contributors );
void CreateNotebookHtmlPage( wxAuiNotebook* parent,
const wxString& caption,
const wxBitmap& icon,
const wxString& html );
wxHyperlinkCtrl* CreateHyperlink( wxScrolledWindow* parent, const wxString& email );
wxStaticBitmap* CreateStaticBitmap( wxScrolledWindow* parent, wxBitmap* icon );
};
#endif // DIALOG_ABOUT_H
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_about_base.h"
///////////////////////////////////////////////////////////////////////////
dialog_about_base::dialog_about_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
m_bitmapApp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_bitmapApp, 0, wxALIGN_CENTER|wxALL, 5 );
wxBoxSizer* b_apptitleSizer;
b_apptitleSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextAppTitle = new wxStaticText( this, wxID_ANY, _("App Title"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE|wxST_NO_AUTORESIZE );
m_staticTextAppTitle->Wrap( -1 );
m_staticTextAppTitle->SetFont( wxFont( 14, 70, 90, 92, false, wxEmptyString ) );
b_apptitleSizer->Add( m_staticTextAppTitle, 0, wxALIGN_CENTER|wxALL|wxEXPAND, 5 );
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, _("Copyright Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE|wxST_NO_AUTORESIZE );
m_staticTextCopyright->Wrap( -1 );
b_apptitleSizer->Add( m_staticTextCopyright, 0, wxALIGN_CENTER|wxALL|wxEXPAND, 1 );
m_staticTextBuildVersion = new wxStaticText( this, wxID_ANY, _("Build Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE|wxST_NO_AUTORESIZE );
m_staticTextBuildVersion->Wrap( -1 );
b_apptitleSizer->Add( m_staticTextBuildVersion, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticTextLibVersion = new wxStaticText( this, wxID_ANY, _("Lib Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE|wxST_NO_AUTORESIZE );
m_staticTextLibVersion->Wrap( -1 );
b_apptitleSizer->Add( m_staticTextLibVersion, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizer3->Add( b_apptitleSizer, 1, wxEXPAND, 5 );
bSizer1->Add( bSizer3, 0, wxEXPAND, 5 );
wxStaticLine* m_staticline1;
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer1->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_auiNotebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON );
m_auiNotebook->SetMinSize( wxSize( 550,300 ) );
bSizer1->Add( m_auiNotebook, 2, wxEXPAND | wxALL, 5 );
m_buttonOK = new wxButton( this, wxID_ANY, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOK->SetDefault();
bSizer1->Add( m_buttonOK, 0, wxALIGN_CENTER|wxALL, 5 );
this->SetSizer( bSizer1 );
this->Layout();
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_about_base::OnClose ) );
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_about_base::OnOkClick ), NULL, this );
}
dialog_about_base::~dialog_about_base()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_about_base::OnClose ) );
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_about_base::OnOkClick ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_about_base__
#define __dialog_about_base__
#include <wx/intl.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/aui/auibook.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class dialog_about_base
///////////////////////////////////////////////////////////////////////////////
class dialog_about_base : public wxDialog
{
private:
wxButton* m_buttonOK;
protected:
wxStaticBitmap* m_bitmapApp;
wxStaticText* m_staticTextAppTitle;
wxStaticText* m_staticTextCopyright;
wxStaticText* m_staticTextBuildVersion;
wxStaticText* m_staticTextLibVersion;
wxAuiNotebook* m_auiNotebook;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public:
dialog_about_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 510,434 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP );
~dialog_about_base();
};
#endif //__dialog_about_base__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment