Loading common/about_kicad.cpp +49 −42 Original line number Original line Diff line number Diff line Loading @@ -12,6 +12,7 @@ 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 /* 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 * 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 * AddDeveloper needs \n between names under wxGTK, and nothing under wxMSW Loading @@ -20,6 +21,7 @@ wxString SetMsg ( const wxString & msg ) */ */ { { wxString tmp; wxString tmp; #ifdef __WINDOWS__ #ifdef __WINDOWS__ tmp = wxT( "\n" ); tmp = wxT( "\n" ); #endif #endif Loading Loading @@ -66,7 +68,8 @@ void InitKiCadAbout(wxAboutDialogInfo& info) description << ( wxT( " 32 bits" ) ); description << ( wxT( " 32 bits" ) ); #endif #endif description << ( wxT( "\n with wxWidgets " ) ); description << ( wxT( "\n with wxWidgets " ) ); description << wxMAJOR_VERSION << wxT(".") << wxMINOR_VERSION << wxT(".") << wxRELEASE_NUMBER; description << wxMAJOR_VERSION << wxT( "." ) << wxMINOR_VERSION << wxT( "." ) << wxRELEASE_NUMBER; description << wxT( "\n\nWeb sites:\n" ); description << wxT( "\n\nWeb sites:\n" ); description << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/" ); description << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/" ); Loading Loading @@ -101,14 +104,18 @@ void InitKiCadAbout(wxAboutDialogInfo& info) /* Add translators */ /* Add translators */ info.AddTranslator( wxT( "Czech (CZ) Milan Horák <stranger@tiscali.cz>" ) ); /* fix for translation ! */ 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( "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( "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( "Polish (PL) Mateusz Skowronski <skowri@gmail.com>" ) ) ); info.AddTranslator( SetMsg( wxT( "Portuguese (PT) Renie Marquet <reniemarquet@uol.com.br>" ) ) ); 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( "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 */ /* Add programm credits */ #if 0 // TODO #if 0 // TODO info.AddArtist( wxT( "" ) ); info.AddArtist( wxT( "" ) ); #endif #endif } } common/common.cpp +76 −82 Original line number Original line Diff line number Diff line Loading @@ -34,39 +34,44 @@ wxString GetAboutBuildVersion() return g_BuildAboutVersion; return g_BuildAboutVersion; } } /********************************/ /********************************/ void SetLocaleTo_C_standard( void ) void SetLocaleTo_C_standard( void ) /********************************/ /********************************/ /** function SetLocaleTo_C_standard /** function SetLocaleTo_C_standard because kicad is internationalized, switch internatization to "C" standard * because kicad is internationalized, switch internatization to "C" standard i.e. uses the . (dot) as separator in print/read float numbers * i.e. uses the . (dot) as separator in print/read float numbers (some contries (France, Germany ..) use , (comma) as separator) * (some contries (France, Germany ..) use , (comma) as separator) This function must be called before read or write ascii files using float numbers in data * 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 * 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, * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, but could make more easier an optional use of locale in kicad * but could make more easier an optional use of locale in kicad */ */ { { setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C 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, /** function SetLocaleTo_Default 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 setlocale( LC_NUMERIC, "" ); // revert to the current locale } } /*********************************************************************************************/ /*********************************************************************************************/ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name ) Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name ) /*********************************************************************************************/ /*********************************************************************************************/ Loading Loading @@ -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, /** Function ReturnStringFromValue * Return the string from Value, according to units (inch, mm ...) for display, * and the initial unit for value * and the initial unit for value * Unit = display units (INCH, MM ..) * @param aUnit = display units (INCHES, MILLIMETRE ..) * Value = value in Internal_Unit * @param aValue = value in Internal_Unit * Internal_Unit = units per inch for Value * @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; wxString StringValue; double value_to_print; double value_to_print; if( Units >= CENTIMETRE ) if( aUnits >= CENTIMETRE ) StringValue << Value; StringValue << aValue; else else { { value_to_print = To_User_Unit( Units, Value, Internal_Unit ); value_to_print = To_User_Unit( aUnits, aValue, aInternal_Unit ); StringValue.Printf( ( Internal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), value_to_print ); value_to_print ); } } if( aAdd_unit_symbol ) switch( aUnits ) { case INCHES: StringValue += _( " \"" ); break; case MILLIMETRE: StringValue += _( " mm" ); break; default: break; } return StringValue; return StringValue; } } Loading Loading @@ -289,6 +312,7 @@ void* MyMalloc( size_t nb_octets ) /**************************************************************/ /**************************************************************/ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) bool ProcessExecute( const wxString& aCommandLine, int aFlags ) /**************************************************************/ /**************************************************************/ /** /** * Function ProcessExecute * Function ProcessExecute * runs a child process. * runs a child process. Loading Loading @@ -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 * Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * entree : valeur en mils , buffer de texte * entree : valeur en mils , buffer de texte * retourne en buffer : texte : valeur exprimee en pouces ou millimetres * retourne en buffer : texte : valeur exprimee en pouces ou millimetres Loading @@ -520,34 +544,6 @@ const wxString& valeur_param( int valeur, wxString& buf_texte ) return 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 ) { { Loading @@ -559,5 +555,3 @@ wxString& operator << ( wxString& aString, const wxPoint& aPos ) return aString; return aString; } } eeschema/affiche.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -91,7 +91,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame ) Affiche_1_Parametre( frame, 50, _( "Display" ), Text, DARKGREEN ); Affiche_1_Parametre( frame, 50, _( "Display" ), Text, DARKGREEN ); /* Display pin length */ /* 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 ); Affiche_1_Parametre( frame, 56, _( "Length" ), Text, MAGENTA ); /* Affichage de l'orientation */ /* Affichage de l'orientation */ Loading Loading @@ -181,7 +181,7 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame ) Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN ); Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN ); if( m_Width ) if( m_Width ) msg = MakeStringFromValue( m_Width, EESCHEMA_INTERNAL_UNIT ); msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); else else msg = _( "default" ); msg = _( "default" ); Affiche_1_Parametre( frame, 20, _( "Width" ), msg, BLUE ); Affiche_1_Parametre( frame, 20, _( "Width" ), msg, BLUE ); Loading include/common.h +12 −11 Original line number Original line Diff line number Diff line Loading @@ -654,19 +654,20 @@ int GetCommandOptions( const int argc, const char** argv, const char */ */ const wxString& valeur_param( int valeur, wxString& buf_texte ); 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 ); wxString ReturnUnitSymbol( int Units = g_UnitMetric ); int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ); 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 ); void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric ); /* Add string " (mm):" or " ("):" to the static text Stext. /* Add string " (mm):" or " ("):" to the static text Stext. Loading internat/fr/kicad.mo +297 B (155 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
common/about_kicad.cpp +49 −42 Original line number Original line Diff line number Diff line Loading @@ -12,6 +12,7 @@ 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 /* 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 * 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 * AddDeveloper needs \n between names under wxGTK, and nothing under wxMSW Loading @@ -20,6 +21,7 @@ wxString SetMsg ( const wxString & msg ) */ */ { { wxString tmp; wxString tmp; #ifdef __WINDOWS__ #ifdef __WINDOWS__ tmp = wxT( "\n" ); tmp = wxT( "\n" ); #endif #endif Loading Loading @@ -66,7 +68,8 @@ void InitKiCadAbout(wxAboutDialogInfo& info) description << ( wxT( " 32 bits" ) ); description << ( wxT( " 32 bits" ) ); #endif #endif description << ( wxT( "\n with wxWidgets " ) ); description << ( wxT( "\n with wxWidgets " ) ); description << wxMAJOR_VERSION << wxT(".") << wxMINOR_VERSION << wxT(".") << wxRELEASE_NUMBER; description << wxMAJOR_VERSION << wxT( "." ) << wxMINOR_VERSION << wxT( "." ) << wxRELEASE_NUMBER; description << wxT( "\n\nWeb sites:\n" ); description << wxT( "\n\nWeb sites:\n" ); description << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/" ); description << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/" ); Loading Loading @@ -101,14 +104,18 @@ void InitKiCadAbout(wxAboutDialogInfo& info) /* Add translators */ /* Add translators */ info.AddTranslator( wxT( "Czech (CZ) Milan Horák <stranger@tiscali.cz>" ) ); /* fix for translation ! */ 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( "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( "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( "Polish (PL) Mateusz Skowronski <skowri@gmail.com>" ) ) ); info.AddTranslator( SetMsg( wxT( "Portuguese (PT) Renie Marquet <reniemarquet@uol.com.br>" ) ) ); 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( "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 */ /* Add programm credits */ #if 0 // TODO #if 0 // TODO info.AddArtist( wxT( "" ) ); info.AddArtist( wxT( "" ) ); #endif #endif } }
common/common.cpp +76 −82 Original line number Original line Diff line number Diff line Loading @@ -34,39 +34,44 @@ wxString GetAboutBuildVersion() return g_BuildAboutVersion; return g_BuildAboutVersion; } } /********************************/ /********************************/ void SetLocaleTo_C_standard( void ) void SetLocaleTo_C_standard( void ) /********************************/ /********************************/ /** function SetLocaleTo_C_standard /** function SetLocaleTo_C_standard because kicad is internationalized, switch internatization to "C" standard * because kicad is internationalized, switch internatization to "C" standard i.e. uses the . (dot) as separator in print/read float numbers * i.e. uses the . (dot) as separator in print/read float numbers (some contries (France, Germany ..) use , (comma) as separator) * (some contries (France, Germany ..) use , (comma) as separator) This function must be called before read or write ascii files using float numbers in data * 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 * 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, * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, but could make more easier an optional use of locale in kicad * but could make more easier an optional use of locale in kicad */ */ { { setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C 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, /** function SetLocaleTo_Default 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 setlocale( LC_NUMERIC, "" ); // revert to the current locale } } /*********************************************************************************************/ /*********************************************************************************************/ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name ) Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxString& name ) /*********************************************************************************************/ /*********************************************************************************************/ Loading Loading @@ -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, /** Function ReturnStringFromValue * Return the string from Value, according to units (inch, mm ...) for display, * and the initial unit for value * and the initial unit for value * Unit = display units (INCH, MM ..) * @param aUnit = display units (INCHES, MILLIMETRE ..) * Value = value in Internal_Unit * @param aValue = value in Internal_Unit * Internal_Unit = units per inch for Value * @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; wxString StringValue; double value_to_print; double value_to_print; if( Units >= CENTIMETRE ) if( aUnits >= CENTIMETRE ) StringValue << Value; StringValue << aValue; else else { { value_to_print = To_User_Unit( Units, Value, Internal_Unit ); value_to_print = To_User_Unit( aUnits, aValue, aInternal_Unit ); StringValue.Printf( ( Internal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), value_to_print ); value_to_print ); } } if( aAdd_unit_symbol ) switch( aUnits ) { case INCHES: StringValue += _( " \"" ); break; case MILLIMETRE: StringValue += _( " mm" ); break; default: break; } return StringValue; return StringValue; } } Loading Loading @@ -289,6 +312,7 @@ void* MyMalloc( size_t nb_octets ) /**************************************************************/ /**************************************************************/ bool ProcessExecute( const wxString& aCommandLine, int aFlags ) bool ProcessExecute( const wxString& aCommandLine, int aFlags ) /**************************************************************/ /**************************************************************/ /** /** * Function ProcessExecute * Function ProcessExecute * runs a child process. * runs a child process. Loading Loading @@ -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 * Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * entree : valeur en mils , buffer de texte * entree : valeur en mils , buffer de texte * retourne en buffer : texte : valeur exprimee en pouces ou millimetres * retourne en buffer : texte : valeur exprimee en pouces ou millimetres Loading @@ -520,34 +544,6 @@ const wxString& valeur_param( int valeur, wxString& buf_texte ) return 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 ) { { Loading @@ -559,5 +555,3 @@ wxString& operator << ( wxString& aString, const wxPoint& aPos ) return aString; return aString; } }
eeschema/affiche.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -91,7 +91,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame ) Affiche_1_Parametre( frame, 50, _( "Display" ), Text, DARKGREEN ); Affiche_1_Parametre( frame, 50, _( "Display" ), Text, DARKGREEN ); /* Display pin length */ /* 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 ); Affiche_1_Parametre( frame, 56, _( "Length" ), Text, MAGENTA ); /* Affichage de l'orientation */ /* Affichage de l'orientation */ Loading Loading @@ -181,7 +181,7 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame ) Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN ); Affiche_1_Parametre( frame, 14, _( "Convert" ), msg, BROWN ); if( m_Width ) if( m_Width ) msg = MakeStringFromValue( m_Width, EESCHEMA_INTERNAL_UNIT ); msg = ReturnStringFromValue( g_UnitMetric, m_Width, EESCHEMA_INTERNAL_UNIT, true ); else else msg = _( "default" ); msg = _( "default" ); Affiche_1_Parametre( frame, 20, _( "Width" ), msg, BLUE ); Affiche_1_Parametre( frame, 20, _( "Width" ), msg, BLUE ); Loading
include/common.h +12 −11 Original line number Original line Diff line number Diff line Loading @@ -654,19 +654,20 @@ int GetCommandOptions( const int argc, const char** argv, const char */ */ const wxString& valeur_param( int valeur, wxString& buf_texte ); 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 ); wxString ReturnUnitSymbol( int Units = g_UnitMetric ); int ReturnValueFromString( int Units, const wxString& TextValue, int Internal_Unit ); 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 ); void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric ); /* Add string " (mm):" or " ("):" to the static text Stext. /* Add string " (mm):" or " ("):" to the static text Stext. Loading
internat/fr/kicad.mo +297 B (155 KiB) File changed.No diff preview for this file type. View original file View changed file