Commit b7d8f5e3 authored by charras's avatar charras

added contributors in about_kicad.cpp

parent 51c0f04a
......@@ -10,18 +10,20 @@
extern wxString g_Main_Title; // Import program title
/**********************************/
wxString SetMsg ( const wxString & msg )
wxString SetMsg( const wxString& msg )
/**********************************/
/* add \n at the beginning of msg under Windows, and do nothing under other version of wxWidgets
* Needed under wxWidgets 2.8 because wxGTK and wxMSW do not have the same behavior
* AddDeveloper needs \n between names under wxGTK, and nothing under wxMSW
* when displaying developer and others.
* can be removed for next wxWidgets versions when this wxWidgets bug will be solved
*/
*/
{
wxString tmp;
#ifdef __WINDOWS__
tmp = wxT("\n");
tmp = wxT( "\n" );
#endif
tmp << msg;
......@@ -30,85 +32,90 @@ wxString SetMsg ( const wxString & msg )
/**************************************************/
void InitKiCadAbout(wxAboutDialogInfo& info)
void InitKiCadAbout( wxAboutDialogInfo& info )
/**************************************************/
{
/* Set name and title */
info.SetName(g_Main_Title);
info.SetName( g_Main_Title );
/* Set description */
wxString description;
description << (_T("Build: ")) << GetAboutBuildVersion();
description << ( _T( "Build: " ) ) << GetAboutBuildVersion();
/* Check for unicode */
#if wxUSE_UNICODE
description << (wxT(" Unicode " ));
description << ( wxT( " Unicode " ) );
#else
description << (wxT(" Ansi "));
description << ( wxT( " Ansi " ) );
#endif
/* Check for wxMSW */
#if defined __WINDOWS__
description << (wxT("on Windows"));
description << ( wxT( "on Windows" ) );
/* Check for wxMAC */
#elif defined __WXMAC__
description << (wxT("on Macintosch"));
description << ( wxT( "on Macintosch" ) );
/* Check for linux and arch */
#elif defined __LINUX__
description << (wxT("on GNU/Linux "));
description << ( wxT( "on GNU/Linux " ) );
#endif
#ifdef _LP64
description << (wxT(" 64 bits"));
description << ( wxT( " 64 bits" ) );
#else
description << (wxT(" 32 bits"));
description << ( wxT( " 32 bits" ) );
#endif
description << (wxT("\n with wxWidgets "));
description << wxMAJOR_VERSION << wxT(".") << wxMINOR_VERSION << wxT(".") << wxRELEASE_NUMBER;
description << ( wxT( "\n with wxWidgets " ) );
description << wxMAJOR_VERSION << wxT( "." ) << wxMINOR_VERSION << wxT( "." ) <<
wxRELEASE_NUMBER;
description << wxT("\n\nWeb sites:\n");
description << wxT("http://iut-tice.ujf-grenoble.fr/kicad/" );
description << wxT("\n");
description << wxT("http://kicad.sourceforge.net/" );
description << wxT("\n");
description << wxT( "\n\nWeb sites:\n" );
description << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/" );
description << wxT( "\n" );
description << wxT( "http://kicad.sourceforge.net/" );
description << wxT( "\n" );
info.SetDescription(description);
info.SetDescription( description );
/* Set copyright */
info.SetCopyright(_T("(C) 1992-2008 KiCad Developers Team"));
info.SetCopyright( _T( "(C) 1992-2008 KiCad Developers Team" ) );
/* Set license */
info.SetLicence(wxString::FromAscii
(
"The complete KiCad EDA Suite is released under the following license: \n"
"\n"
"GNU General Public License version 2\n"
"See <http://www.gnu.org/licenses/> for more information"
));
info.SetLicence( wxString::FromAscii
(
"The complete KiCad EDA Suite is released under the following license: \n"
"\n"
"GNU General Public License version 2\n"
"See <http://www.gnu.org/licenses/> for more information"
) );
/* Add developers */
info.AddDeveloper(wxT("Jean-Pierre Charras <jean-pierre.charras@inpg.fr>"));
info.AddDeveloper(SetMsg(wxT("Dick Hollenbeck <dick@softplc.com>")));
info.AddDeveloper(SetMsg(wxT("kbool library: http://boolean.klaasholwerda.nl/bool.html")));
info.AddDeveloper( wxT( "Jean-Pierre Charras <jean-pierre.charras@inpg.fr>" ) );
info.AddDeveloper( SetMsg( wxT( "Dick Hollenbeck <dick@softplc.com>" ) ) );
info.AddDeveloper( SetMsg( wxT( "kbool library: http://boolean.klaasholwerda.nl/bool.html" ) ) );
/* Add document writers */
info.AddDocWriter(wxT("Jean-Pierre Charras <jean-pierre.charras@inpg.fr>"));
info.AddDocWriter(SetMsg(wxT("Igor Plyatov <plyatov@gmail.com>")));
info.AddDocWriter( wxT( "Jean-Pierre Charras <jean-pierre.charras@inpg.fr>" ) );
info.AddDocWriter( SetMsg( wxT( "Igor Plyatov <plyatov@gmail.com>" ) ) );
/* Add translators */
info.AddTranslator(wxT("Czech (CZ) Milan Horák <stranger@tiscali.cz>")); /* fix for translation ! */
info.AddTranslator(SetMsg(wxT("Dutch (NL) Jerry Jacobs <jerkejacobs@gmail.com>")));
info.AddTranslator(SetMsg(wxT("French (FR) Jean-Pierre Charras <jean-pierre.charras@inpg.fr>")));
info.AddTranslator(SetMsg(wxT("Polish (PL) Mateusz Skowronski <skowri@gmail.com>")));
info.AddTranslator(SetMsg(wxT("Portuguese (PT) Renie Marquet <reniemarquet@uol.com.br>")));
info.AddTranslator(SetMsg(wxT("Russian (RU) Igor Plyatov <plyatov@gmail.com>")));
info.AddTranslator( wxT( "Czech (CZ) Milan Horák <stranger@tiscali.cz>" ) ); /* fix for translation ! */
info.AddTranslator( SetMsg( wxT( "Dutch (NL) Jerry Jacobs <jerkejacobs@gmail.com>" ) ) );
info.AddTranslator( SetMsg( wxT(
"French (FR) Jean-Pierre Charras <jean-pierre.charras@inpg.fr>" ) ) );
info.AddTranslator( SetMsg( wxT( "Polish (PL) Mateusz Skowronski <skowri@gmail.com>" ) ) );
info.AddTranslator( SetMsg( wxT( "Portuguese (PT) Renie Marquet <reniemarquet@uol.com.br>" ) ) );
info.AddTranslator( SetMsg( wxT( "Russian (RU) Igor Plyatov <plyatov@gmail.com>" ) ) );
info.AddTranslator( SetMsg( wxT(
" David Briscoe, Jean Dupont (Remy),Boris Barbour, Dominique Laigle, Paul Burke" ) ) );
info.AddTranslator( SetMsg( wxT( "Pedro Martin del Valle, Inigo Zuluaga")));
/* Add programm credits */
#if 0 // TODO
info.AddArtist(wxT(""));
info.AddArtist( wxT( "" ) );
#endif
}
......@@ -31,50 +31,55 @@ wxString GetBuildVersion()
wxString GetAboutBuildVersion()
/*********************************************/
{
return g_BuildAboutVersion;
return g_BuildAboutVersion;
}
/********************************/
void SetLocaleTo_C_standard(void)
void SetLocaleTo_C_standard( void )
/********************************/
/** function SetLocaleTo_C_standard
because kicad is internationalized, switch internatization to "C" standard
i.e. uses the . (dot) as separator in print/read float numbers
(some contries (France, Germany ..) use , (comma) as separator)
This function must be called before read or write ascii files using float numbers in data
the SetLocaleTo_C_standard function must be called after reading or writing the file
This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function,
but could make more easier an optional use of locale in kicad
*/
* because kicad is internationalized, switch internatization to "C" standard
* i.e. uses the . (dot) as separator in print/read float numbers
* (some contries (France, Germany ..) use , (comma) as separator)
* This function must be called before read or write ascii files using float numbers in data
* the SetLocaleTo_C_standard function must be called after reading or writing the file
*
* This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function,
* but could make more easier an optional use of locale in kicad
*/
{
setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C
}
/********************************/
void SetLocaleTo_Default(void)
void SetLocaleTo_Default( void )
/********************************/
/** function SetLocaleTo_Default
because kicad is internationalized, switch internatization to default
to use the default separator in print/read float numbers
(. (dot) but some contries (France, Germany ..) use , (comma) as separator)
This function must be called after a call to SetLocaleTo_C_standard
This is wrapper to the C setlocale( LC_NUMERIC, "" ) function,
but could make more easier an optional use of locale in kicad
*/
* because kicad is internationalized, switch internatization to default
* to use the default separator in print/read float numbers
* (. (dot) but some contries (France, Germany ..) use , (comma) as separator)
* This function must be called after a call to SetLocaleTo_C_standard
*
* This is wrapper to the C setlocale( LC_NUMERIC, "" ) function,
* but could make more easier an optional use of locale in kicad
*/
{
setlocale( LC_NUMERIC, "" ); // revert to the current locale
}
/*********************************************************************************************/
Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name )
/*********************************************************************************************/
{
// All sizes are in 1/1000 inch
m_Size = size;
m_Size = size;
m_Offset = offset;
m_Name = name;
m_Name = name;
// Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
m_LeftMargin = m_RightMargin = m_TopMargin = m_BottomMargin = 400;
......@@ -150,29 +155,47 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit )
}
/****************************************************************************/
wxString ReturnStringFromValue( int Units, int Value, int Internal_Unit )
/****************************************************************************/
/**************************************************************************************************/
wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol )
/**************************************************************************************************/
/* Return the string from Value, according to units (inch, mm ...) for display,
* and the initial unit for value
* Unit = display units (INCH, MM ..)
* Value = value in Internal_Unit
* Internal_Unit = units per inch for Value
/** Function ReturnStringFromValue
* Return the string from Value, according to units (inch, mm ...) for display,
* and the initial unit for value
* @param aUnit = display units (INCHES, MILLIMETRE ..)
* @param aValue = value in Internal_Unit
* @param aInternal_Unit = units per inch for Value
* @param aAdd_unit_symbol = true to add symbol unit to the string value
* @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm)
*/
{
wxString StringValue;
double value_to_print;
if( Units >= CENTIMETRE )
StringValue << Value;
if( aUnits >= CENTIMETRE )
StringValue << aValue;
else
{
value_to_print = To_User_Unit( Units, Value, Internal_Unit );
StringValue.Printf( ( Internal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ),
value_to_print );
value_to_print = To_User_Unit( aUnits, aValue, aInternal_Unit );
StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ),
value_to_print );
}
if( aAdd_unit_symbol )
switch( aUnits )
{
case INCHES:
StringValue += _( " \"" );
break;
case MILLIMETRE:
StringValue += _( " mm" );
break;
default:
break;
}
return StringValue;
}
......@@ -250,15 +273,15 @@ wxString GenDate()
wxT( "jul" ), wxT( "aug" ), wxT( "sep" ), wxT( "oct" ), wxT( "nov" ), wxT( "dec" )
};
time_t buftime;
struct tm* Date;
wxString string_date;
time_t buftime;
struct tm* Date;
wxString string_date;
time( &buftime );
Date = gmtime( &buftime );
string_date.Printf( wxT( "%d %s %d" ), Date->tm_mday,
mois[Date->tm_mon].GetData(),
Date->tm_year + 1900 );
mois[Date->tm_mon].GetData(),
Date->tm_year + 1900 );
return string_date;
}
......@@ -289,6 +312,7 @@ void* MyMalloc( size_t nb_octets )
/**************************************************************/
bool ProcessExecute( const wxString& aCommandLine, int aFlags )
/**************************************************************/
/**
* Function ProcessExecute
* runs a child process.
......@@ -298,10 +322,10 @@ bool ProcessExecute( const wxString& aCommandLine, int aFlags )
*/
{
#ifdef __WINDOWS__
int pid = wxExecute(aCommandLine);
int pid = wxExecute( aCommandLine );
return pid ? true : false;
#else
wxProcess* process = wxProcess::Open( aCommandLine, aFlags );
wxProcess* process = wxProcess::Open( aCommandLine, aFlags );
return (process != NULL) ? true : false;
#endif
}
......@@ -367,7 +391,7 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
// modify the copy
ret.Trim();
ret.Replace( wxT(" "), wxT("_") );
ret.Replace( wxT( " " ), wxT( "_" ) );
return ret;
}
......@@ -400,9 +424,9 @@ WinEDA_TextFrame::WinEDA_TextFrame( wxWindow* parent, const wxString& title ) :
size = GetClientSize();
m_List = new wxListBox( this, ID_TEXTBOX_LIST,
wxPoint( 0, 0 ), size,
0, NULL,
wxLB_ALWAYS_SB | wxLB_SINGLE );
wxPoint( 0, 0 ), size,
0, NULL,
wxLB_ALWAYS_SB | wxLB_SINGLE );
m_List->SetBackgroundColour( wxColour( 200, 255, 255 ) );
SetReturnCode( -1 );
......@@ -466,7 +490,7 @@ void AfficheDoc( WinEDA_DrawFrame* frame, const wxString& Doc, const wxString& K
{
wxString Line1( wxT( "Doc: " ) ), Line2( wxT( "KeyW: " ) );
int color = BLUE;
int color = BLUE;
if( frame && frame->MsgPanel )
{
......@@ -501,7 +525,7 @@ const wxString& valeur_param( int valeur, wxString& buf_texte )
/**************************************************************/
/**
* @todo replace this obsolete funtion by MakeStringFromValue
* @todo replace this obsolete funtion by ReturnStringFromValue
* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
* entree : valeur en mils , buffer de texte
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
......@@ -520,44 +544,14 @@ const wxString& valeur_param( int valeur, wxString& buf_texte )
return buf_texte;
}
/****************************************************************************************/
const wxString MakeStringFromValue( int value, int internal_unit )
/****************************************************************************************/
/** Function MakeStringFromValue
* convert the value of a parameter to a string like <value in prefered units> <unit symbol>
* like 100 mils converted to 0.1 " or 0.245 mm
* use g_UnitMetric do select inch or metric format
* @param : value in internal units
* @param : internal_unit per inch: currently 1000 for eeschema and 10000 for pcbnew
* @return : the string to display or print
*/
{
wxString text;
if( g_UnitMetric )
{
text.Printf( wxT( "%3.3f mm" ), (float) value * 2.54 / (float) internal_unit );
}
else
{
text.Printf( wxT( "%2.4f \"" ), (float) value / (float) internal_unit );
}
return text;
}
wxString& operator << ( wxString& aString, const wxPoint& aPos )
wxString& operator <<( wxString& aString, const wxPoint& aPos )
{
wxString temp;
aString << wxT("@ (") << valeur_param( aPos.x, temp );
aString << wxT(",") << valeur_param( aPos.y, temp );
aString << wxT(")");
aString << wxT( "@ (" ) << valeur_param( aPos.x, temp );
aString << wxT( "," ) << valeur_param( aPos.y, temp );
aString << wxT( ")" );
return aString;
}
......@@ -91,7 +91,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre( frame, 50, _( "Display" ), Text, DARKGREEN );
/* Display pin length */
Text = MakeStringFromValue( m_PinLen, EESCHEMA_INTERNAL_UNIT );
Text = ReturnStringFromValue( g_UnitMetric, m_PinLen, EESCHEMA_INTERNAL_UNIT, true );
Affiche_1_Parametre( frame, 56, _( "Length" ), Text, MAGENTA );
/* Affichage de l'orientation */
......@@ -181,7 +181,7 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN );
if( m_Width )
msg = MakeStringFromValue( m_Width, EESCHEMA_INTERNAL_UNIT );
msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true );
else
msg = _( "default" );
Affiche_1_Parametre( frame, 20, _( "Width" ), msg, BLUE );
......
......@@ -654,19 +654,20 @@ int GetCommandOptions( const int argc, const char** argv, const char
*/
const wxString& valeur_param( int valeur, wxString& buf_texte );
/** Function MakeStringFromValue
* convert the value of a parameter to a string like <value in prefered units> <unit symbol>
* like 100 mils converted to 0.1 " or 0.245 mm
* use g_UnitMetric do select inch or metric format
* @param : value in internal units
* @param : internal_unit per inch: currently 1000 for eeschema and 10000 for pcbnew
* @return : the string to display or print
*/
const wxString MakeStringFromValue( int value, int internal_unit );
wxString ReturnUnitSymbol( int Units = g_UnitMetric );
int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit );
wxString ReturnStringFromValue( int Units, int Value, int Internal_Unit );
/** Function ReturnStringFromValue
* Return the string from Value, according to units (inch, mm ...) for display,
* and the initial unit for value
* @param aUnit = display units (INCHES, MILLIMETRE ..)
* @param aValue = value in Internal_Unit
* @param aInternal_Unit = units per inch for Value
* @param aAdd_unit_symbol = true to add symbol unit to the string value
* @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm)
*/
wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol = false );
void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric );
/* Add string " (mm):" or " ("):" to the static text Stext.
......
No preview for this file type
This diff is collapsed.
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