Browse Source

added: new language: Swedish

translation made by: Lars 'Bäfvert' Gäfvert <lars.gafvert at gmail dot com>



git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@188 e52654a7-88a9-db11-a3e9-0013d4bc506e
master
Tomasz Sowa 12 years ago
parent
commit
8880e87af6
  1. 5
      CHANGELOG
  2. 2
      README
  3. 2
      help/index.html
  4. 1
      src/bigtypes.h
  5. 4
      src/compileconfig.h
  6. 190
      src/languages.cpp
  7. 3
      src/languages.h
  8. 16
      src/mainwindow.cpp
  9. 1
      src/parsermanager.h
  10. 3
      src/programresources.cpp
  11. 1
      src/resource.h
  12. 1
      src/resource.rc
  13. 318
      src/stopcalculating.h
  14. 3
      src/winmain.cpp

5
CHANGELOG

@ -1,3 +1,8 @@
Version 0.8.7 prerelease (2009.09.08):
* added: new language: Swedish
translation made by: Lars 'Bäfvert' Gäfvert <lars.gafvert at gmail dot com>
Version 0.8.6 (2009.06.30):
* added: new language: Russian
translation made by: Vladimir Gladilovich <vdgladilovich at gmail dot com>

2
README

@ -17,7 +17,7 @@ display values with the base (radix) from two to sixteen.
Author: Tomasz Sowa
Contact: t.sowa@ttmath.org
Licence: BSD (open source)
Interface: English, Polish, Spanish, Danish, Chinese, Russian
Interface: English, Polish, Spanish, Danish, Chinese, Russian, Swedish
Project page: http://ttcalc.sourceforge.net/
Bignum library: TTMath http://www.ttmath.org/
Operating systems: Microsoft Windows 9x/Me/NT/2000/XP/Vista

2
help/index.html

@ -44,7 +44,7 @@ display values with the base (radix) from two to sixteen.
<tr><td>Author:</td><td>Tomasz Sowa</td></tr>
<tr><td>Contact:</td><td>t.sowa@ttmath.org</td></tr>
<tr><td>Licence:</td><td>BSD (open source)</td></tr>
<tr><td>Interface:</td><td>English, Polish, Spanish, Danish, Chinese, Russian</td></tr>
<tr><td>Interface:</td><td>English, Polish, Spanish, Danish, Chinese, Russian, Swedish</td></tr>
<tr><td>Project page:</td><td><a href="http://ttcalc.sourceforge.net/">http://ttcalc.sourceforge.net/</a></td></tr>
<tr><td>Bignum library:</td><td>TTMath <a href="http://ttmath.org/">http://www.ttmath.org/</a></td></tr>
<tr><td>Operating systems:</td><td>Microsoft Windows 9x/Me/NT/2000/XP/Vista</td></tr>

1
src/bigtypes.h

@ -58,7 +58,6 @@
typedef ttmath::Big<4,27> TTMathBig3;
typedef TTMathBig3 TTMathBigMax;
#else
/* portable */

4
src/compileconfig.h

@ -55,8 +55,8 @@
*/
#define TTCALC_MAJOR_VER 0
#define TTCALC_MINOR_VER 8
#define TTCALC_REVISION_VER 6
#define TTCALC_PRERELEASE_VER 0
#define TTCALC_REVISION_VER 7
#define TTCALC_PRERELEASE_VER 1

190
src/languages.cpp

@ -109,7 +109,7 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"There's a recurrence between functions");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Variables or functions must return only one value");
InsertErrorPair(ttmath::err_still_calculating,"Calculating...");
InsertErrorPair(ttmath::err_too_big_factorial,"A too big argument for the factorial() function");
//InsertErrorPair(ttmath::err_too_big_factorial,"A too big argument for the factorial() function");
@ -143,7 +143,7 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"Pomiêdzy funkcjami zachodzi wywo³anie rekurencyjne");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Zmienne albo funkcje mog¹ posiadaæ (zwracaæ) tylko jedn¹ wartoœæ");
InsertErrorPair(ttmath::err_still_calculating,"Obliczanie...");
InsertErrorPair(ttmath::err_too_big_factorial,"Zbyt du¿y argument dla funkcji factorial()");
//InsertErrorPair(ttmath::err_too_big_factorial,"Zbyt du縴 argument dla funkcji factorial()");
/*
@ -176,7 +176,7 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"Recurrencia entre funciones");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Variables o funciones solo pueden retornar un valor");
InsertErrorPair(ttmath::err_still_calculating,"Calculando ...");
InsertErrorPair(ttmath::err_too_big_factorial,"Argumento muy grande para la funcion factorial()");
//InsertErrorPair(ttmath::err_too_big_factorial,"Argumento muy grande para la funcion factorial()");
/*
@ -208,7 +208,7 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"Der er en gentagelse mellem funktioner");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Variabler eller funktioner skal kun returnere én værdi");
InsertErrorPair(ttmath::err_still_calculating,"Regner...");
InsertErrorPair(ttmath::err_too_big_factorial,"Et for stort argument for factorial() funktionen");
//InsertErrorPair(ttmath::err_too_big_factorial,"Et for stort argument for factorial() funktionen");
/*
@ -240,7 +240,7 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"º¯ÊýÑ­»·");
InsertErrorPair(ttmath::err_must_be_only_one_value,"±äÁ¿»òº¯Êý±ØÐëÓзµ»ØÖµ");
InsertErrorPair(ttmath::err_still_calculating,"ÕýÔÚ¼ÆËã...");
InsertErrorPair(ttmath::err_too_big_factorial,"½×³Ëº¯ÊýµÄ²ÎÊýÌ«´ó");
//InsertErrorPair(ttmath::err_too_big_factorial,"阶乘函数的参数太大");
/*
@ -272,12 +272,50 @@ void Languages::InitErrorMessagesTab()
InsertErrorPair(ttmath::err_functions_loop,"Ôóíêöèè ðåêóððåíòíû");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Ïåðåìåííûå èëè ôóíêöèè äîëæíû âîçâðàùàòü òîëüêî îäíî çíà÷åíèå");
InsertErrorPair(ttmath::err_still_calculating,"Ïîäñ÷èòûâàåì...");
InsertErrorPair(ttmath::err_too_big_factorial,"Ñëèøêîì áîëüøîé àðãóìåíò äëÿ ôóíêöèè factorial()");
//InsertErrorPair(ttmath::err_too_big_factorial,"央桫觐� 犷朦�� 囵泱戾眚 潆� 趔黻鲨� factorial()");
/*
swedish messages relating to ttmath library
*/
error_messages_tab.push_back( std::map<ttmath::ErrorCode, std::string>() );
InsertErrorPair(ttmath::err_ok,"ok");
InsertErrorPair(ttmath::err_nothing_has_read,"");
InsertErrorPair(ttmath::err_unknown_character,"Ett ok鋘t tecken");
InsertErrorPair(ttmath::err_unexpected_final_bracket,"En of鰎v鋘tat slutlig klass");
InsertErrorPair(ttmath::err_stack_not_clear,"Ett ok鋘t tecken saknas");
InsertErrorPair(ttmath::err_unknown_variable,"En ok鋘d variabel");
InsertErrorPair(ttmath::err_division_by_zero,"Division med noll");
InsertErrorPair(ttmath::err_interrupt,"Ber鋕ningen har avbrutits");
InsertErrorPair(ttmath::err_overflow,"Overflow fel");
InsertErrorPair(ttmath::err_unknown_function,"En ok鋘d funktion");
InsertErrorPair(ttmath::err_unknown_operator,"En ok鋘d operator");
InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"En ok鋘d semikolonoperator");
InsertErrorPair(ttmath::err_improper_amount_of_arguments,"Felaktig m鋘gd argument");
InsertErrorPair(ttmath::err_improper_argument,"Ogiltig argumentation");
InsertErrorPair(ttmath::err_unexpected_end,"Of鰎v鋘tat fel");
InsertErrorPair(ttmath::err_internal_error,"Ett internt fel");
InsertErrorPair(ttmath::err_incorrect_name,"Ogiltigt namn f鰎 en variabel eller funktion");
InsertErrorPair(ttmath::err_incorrect_value,"Ogiltigt v鋜de f鰎 en variabel eller funktion");
InsertErrorPair(ttmath::err_variable_exists,"Denna variabel existerar redan");
InsertErrorPair(ttmath::err_variable_loop,"Det 鋜 en upprepepning mellan variabler");
InsertErrorPair(ttmath::err_functions_loop,"Det 鋜 en upprepning mellan funktioner");
InsertErrorPair(ttmath::err_must_be_only_one_value,"Variabler eller funktioner skall kunna avge ett v鋜de");
InsertErrorPair(ttmath::err_still_calculating,"R鋕nar b鋠rar...");
//InsertErrorPair(ttmath::err_too_big_factorial,"Ett f鰎 stort argument f鰎 factorial() funktionen");
}
// for gui messages
@ -411,6 +449,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&Danish");
InsertGuiPair(menu_view_lang_chinese, "&Chinese");
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&Close");
InsertGuiPair(menu_edit_undo, "&Undo");
InsertGuiPair(menu_edit_paste, "&Paste");
@ -544,6 +583,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&Duñski");
InsertGuiPair(menu_view_lang_chinese, "&Chiñski");
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Szwedzki");
InsertGuiPair(menu_view_close_program, "&Zamknij");
InsertGuiPair(menu_edit_undo, "&Cofnij");
InsertGuiPair(menu_edit_paste, "&Wklej");
@ -681,6 +721,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&Danés"); // 'Danés' is a correct translation for 'Danish'?
InsertGuiPair(menu_view_lang_chinese, "&Chino"); // 'Chino' is a correct translation for 'Chinese'?
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&Close");
InsertGuiPair(menu_edit_undo, "&Deshacer");
InsertGuiPair(menu_edit_paste, "&Pegar");
@ -814,6 +855,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&Dansk");
InsertGuiPair(menu_view_lang_chinese, "&Kinesisk"); // 'Kinesisk' is a correct translation for 'Chinese'?
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&Afslut");
InsertGuiPair(menu_edit_undo, "&Fortryd");
InsertGuiPair(menu_edit_paste, "&Sæt ind");
@ -946,6 +988,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&µ¤ÂóÓï");
InsertGuiPair(menu_view_lang_chinese, "&¼òÌåÖÐÎÄ");
InsertGuiPair(menu_view_lang_russian, "&Russian");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&¹Ø±Õ");
InsertGuiPair(menu_edit_undo, "&È¡Ïû");
InsertGuiPair(menu_edit_paste, "&Õ³Ìù");
@ -1076,6 +1119,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(menu_view_lang_danish, "&Äàòñêèé");
InsertGuiPair(menu_view_lang_chinese, "&Êèòàéñêèé");
InsertGuiPair(menu_view_lang_russian, "&Ðóññêèé");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&Çàêðûòü");
InsertGuiPair(menu_edit_undo, "&Îòìåíèòü äåéñòâèå");
InsertGuiPair(menu_edit_paste, "&Âñòàâèòü");
@ -1120,6 +1164,140 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(cant_find_help, "Íå óäàåòñÿ íàéòè ôàéëû ïîìîùè");
InsertGuiPair(cant_open_project_page, "Íå óäàåòñÿ îòêðûòü ñàéò ïðîåêòà");
/*
swedish gui messages
*/
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
InsertGuiPair(button_ok,"Ok");
InsertGuiPair(button_cancel,"Avbryt");
InsertGuiPair(message_box_caption,"TTCalc");
InsertGuiPair(dialog_box_add_variable_caption,"L鋑g till en ny variabel");
InsertGuiPair(dialog_box_edit_variable_caption,"Redigera en variabel");
InsertGuiPair(dialog_box_add_variable_incorrect_name,"Ogiltigt namn f鰎 variabel");
InsertGuiPair(dialog_box_add_variable_incorrect_value,"Ogiltigt v鋜de f鰎 variabel");
InsertGuiPair(dialog_box_add_variable_variable_exists,"Denna variabel finns redan");
InsertGuiPair(dialog_box_edit_variable_unknown_variable,"Denna variabel saknas i tabellen. F鰎modligen ett internt fel!");
InsertGuiPair(dialog_box_delete_variable_confirm,"Vill du f鰎g鰎a dessa variabler?");
InsertGuiPair(dialog_box_variable_not_all_deleted,"N錱ra variabler gick ej att ta k錶 p�. Det m錽te vara ett internt fel!");
InsertGuiPair(dialog_box_add_function_caption,"L鋑g till en ny funktion");
InsertGuiPair(dialog_box_edit_function_caption,"Redigera en funktion");
InsertGuiPair(dialog_box_add_function_function_exists,"Denna funktion finns redan");
InsertGuiPair(dialog_box_edit_function_unknown_function,"Denna funktion saknas i tabellen. F鰎modligen ett internt fel!");
InsertGuiPair(dialog_box_delete_function_confirm,"Vill du f鰎g鰎a dessa funktioner?");
InsertGuiPair(dialog_box_function_not_all_deleted,"N錱ra funktioner gick inte att f鰎g鰎a. Jag tror vi har att g鰎a med ett internt fel!");
InsertGuiPair(dialog_box_add_function_incorrect_name,"Ogiltigt namn f鰎 funktionen");
InsertGuiPair(list_variables_header_1,"Namn");
InsertGuiPair(list_variables_header_2,"V鋜de");
InsertGuiPair(list_functions_header_1,"Namn");
InsertGuiPair(list_functions_header_2,"Param.");
InsertGuiPair(list_functions_header_3,"V鋜de");
InsertGuiPair(button_add,"L鋑ga till");
InsertGuiPair(button_edit,"Redigera");
InsertGuiPair(button_delete,"F鰎g鰎a");
InsertGuiPair(button_clear,"C");
InsertGuiPair(tab_standard,"Standard");
InsertGuiPair(tab_variables,"Variabler");
InsertGuiPair(tab_functions,"Funktioner");
InsertGuiPair(tab_precision,"Precision");
InsertGuiPair(tab_display,"Visning");
InsertGuiPair(tab_convert,"Konvertera");
InsertGuiPair(radio_precision_1,"Liten - 96 bitar f鰎 mantissan, 32 bitar f鰎 exponenten");
InsertGuiPair(radio_precision_2,"Mellan - 288 bitar f鰎 mantissan, 64 bitar f鰎 exponenten");
InsertGuiPair(radio_precision_3,"Stor - 864 bitar f鰎 mantissan, 128 bitar f鰎 exponenten");
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 giltiga siffror (decimaler)");
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 giltiga siffror");
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 siffror");
InsertGuiPair(overflow_during_printing,"Overflow under printning");
InsertGuiPair(combo_rounding_none,"Ingen");
InsertGuiPair(combo_rounding_integer,"till heltal");
InsertGuiPair(combo_rounding_to_number,"till");
InsertGuiPair(combo_rounding_after_comma,"siffror(cifre)");
InsertGuiPair(check_remove_zeroes,"Radera sista 鰒erfl鰀iga nollor");
InsertGuiPair(display_input, "Input");
InsertGuiPair(display_output, "Output");
InsertGuiPair(display_rounding, "Avrundning");
InsertGuiPair(display_always_scientific,"Alltid");
InsertGuiPair(display_not_always_scientific,"N鋜 exponenten 鋜 st鰎re 鋘:");
InsertGuiPair(display_group_scientific, "Visa resultatet som vetenskapligt v鋜de");
InsertGuiPair(display_decimal_point, "Decimalpunkt");
InsertGuiPair(display_deg_rad_grad, "sin/cos asin/acos");
InsertGuiPair(convert_type, "Type");
InsertGuiPair(convert_input, "Input");
InsertGuiPair(convert_output, "Output");
InsertGuiPair(convert_dynamic_output, "Auto prefix");
InsertGuiPair(menu_view, "&Visa");
InsertGuiPair(menu_edit, "&Redigera");
InsertGuiPair(menu_help, "&Hj鋖p");
InsertGuiPair(menu_language, "&Spr錱");
InsertGuiPair(menu_view_new_window, "&Nytt f鰊ster");
InsertGuiPair(menu_view_normal_view, "No&rmal visning");
InsertGuiPair(menu_view_compact_view, "K&ompakt visning");
InsertGuiPair(menu_view_always_on_top, "&Alltid 鰒erst");
InsertGuiPair(menu_view_lang_english, "&Engelska");
InsertGuiPair(menu_view_lang_polish, "&Polska");
InsertGuiPair(menu_view_lang_spanish, "&Spanska");
InsertGuiPair(menu_view_lang_danish, "&Danska");
InsertGuiPair(menu_view_lang_chinese, "&Kinesiska"); // 'Kinesisk' is a correct translation for 'Chinese'?
InsertGuiPair(menu_view_lang_russian, "&Ryska");
InsertGuiPair(menu_view_lang_swedish, "&Swedish");
InsertGuiPair(menu_view_close_program, "&Avsluta");
InsertGuiPair(menu_edit_undo, "&舗gra");
InsertGuiPair(menu_edit_paste, "&Klistra in");
InsertGuiPair(menu_edit_copy_result, "&Kopiera result");
InsertGuiPair(menu_help_help, "&Hj鋖p");
InsertGuiPair(menu_help_project_page, "&Projektsida");
InsertGuiPair(menu_help_about, "&Om");
InsertGuiPair(cant_init_calculations, "Ber鋕ningen kunde inte initieras!");
InsertGuiPair(message_box_error_caption,"TTCalc");
InsertGuiPair(cant_create_thread, "Den andra tr錮en f鰎 utr鋕ning kunde inte skapas");
InsertGuiPair(cant_create_main_window, "Applikationens huvudf鰊ster kunde inte skapas");
InsertGuiPair(cant_init_common_controls,"Inst鋖lningarna kunde inte initieras (InitCommonControlsEx)");
InsertGuiPair(about_text,
"Matematisk kalkylator TTCalc %d.%d.%d%s%s\r\n"
"Upphovsman: Tomasz Sowa\r\n"
"Kontakt: t.sowa@ttmath.org\r\n"
"Licens: BSD (open source)\r\n"
"Projektsida: http://ttcalc.sourceforge.net\r\n"
"Bignumbiblotek: TTMath %d.%d.%d%s\r\n"
"Programmeringsspr錵: C++\r\n"
"Kompilator: %s\r\n"
"%s" // for upx
"\r\n"
"TTCalc anv鋘der sig av TTMath bignum bibloteket"
" som kan hittas h鋜: http://sourceforge.net/projects/ttmath\r\n"
"\r\n"
#ifdef TTCALC_PORTABLE
"Detta 鋜 den portabla versionen av TTCalc. I denna version "
"kan du r鋕na med begr鋘sad precision, dvs (96 bitar f鰎 "
"mantissan och 32 bitar f鰎 exponenten) det 鋜 omkring +/-6.9e+646457021.\r\n"
"\r\n"
#endif
"Har du fr錱or, goda r錮 eller interessanta id閑r betr鋐fande"
" detta program eller vill du rentav bidra med din kompetens som"
" utvecklare eller programmerare 鋜 du v鋖kommen att kontakta upphovsmannen."
);
InsertGuiPair(about_text_portable_version, " transportabel version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
InsertGuiPair(about_box_title, "Om");
InsertGuiPair(about_box_button_close, "B鋠er");
InsertGuiPair(unknown_error, "Det har intr鋐fat ett ok鋘t fel");
InsertGuiPair(cant_find_help, "Kunde inte hitta n錱ra hj鋖pfiler");
InsertGuiPair(cant_open_project_page, "Projektsidan kunde inte 鰌pnas");
}

3
src/languages.h

@ -121,6 +121,7 @@ public:
menu_view_lang_danish,
menu_view_lang_chinese,
menu_view_lang_russian,
menu_view_lang_swedish,
menu_view_close_program,
menu_edit_undo,
menu_edit_paste,
@ -149,7 +150,7 @@ public:
// (after conversion to 'int' we pass it into the std::vector)
enum Country
{
en = 0, pl, sp, da, chn, ru
en = 0, pl, sp, da, chn, ru, swe
};

16
src/mainwindow.cpp

@ -408,6 +408,7 @@ HMENU menu = GetMenu(hWnd);
SetMenuLanguageItem(menu, IDM_LANGUAGE_DANISH, Languages::menu_view_lang_danish);
SetMenuLanguageItem(menu, IDM_LANGUAGE_CHINESE, Languages::menu_view_lang_chinese);
SetMenuLanguageItem(menu, IDM_LANGUAGE_RUSSIAN, Languages::menu_view_lang_russian);
SetMenuLanguageItem(menu, IDM_LANGUAGE_SWEDISH, Languages::menu_view_lang_swedish);
SetMenuLanguageItem(menu, IDM_CLOSE_PROGRAM, Languages::menu_view_close_program);
SetMenuLanguageItem(menu, IDM_EDIT_UNDO, Languages::menu_edit_undo);
SetMenuLanguageItem(menu, IDM_EDIT_PASTE, Languages::menu_edit_paste);
@ -772,6 +773,7 @@ void WmInitMenuPopUpView(HMENU menu)
CheckMenuItem(menu, IDM_LANGUAGE_DANISH, MF_BYCOMMAND|MF_UNCHECKED);
CheckMenuItem(menu, IDM_LANGUAGE_CHINESE, MF_BYCOMMAND|MF_UNCHECKED);
CheckMenuItem(menu, IDM_LANGUAGE_RUSSIAN, MF_BYCOMMAND|MF_UNCHECKED);
CheckMenuItem(menu, IDM_LANGUAGE_SWEDISH, MF_BYCOMMAND|MF_UNCHECKED);
Languages::Country lang = GetPrgRes()->GetLanguages()->GetCurrentLanguage();
@ -792,6 +794,9 @@ void WmInitMenuPopUpView(HMENU menu)
else
if( lang == Languages::ru )
CheckMenuItem(menu, IDM_LANGUAGE_RUSSIAN, MF_BYCOMMAND|MF_CHECKED);
else
if( lang == Languages::swe )
CheckMenuItem(menu, IDM_LANGUAGE_SWEDISH, MF_BYCOMMAND|MF_CHECKED);
}
@ -1087,6 +1092,16 @@ BOOL WmCommand_LanguageRussian(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
return true;
}
BOOL WmCommand_LanguageSwedish(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::swe);
SetMenuLanguage(hWnd);
SetOutputEditLanguage(hWnd);
TabWindowFunctions::SetLanguage( GetDlgItem(hWnd, IDC_TAB) );
return true;
}
BOOL WmHelp(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
@ -1159,6 +1174,7 @@ void CreateCommandMessagesTable(Messages & cmessages)
cmessages.Associate(IDM_LANGUAGE_DANISH, WmCommand_LanguageDanish);
cmessages.Associate(IDM_LANGUAGE_CHINESE, WmCommand_LanguageChinese);
cmessages.Associate(IDM_LANGUAGE_RUSSIAN, WmCommand_LanguageRussian);
cmessages.Associate(IDM_LANGUAGE_SWEDISH, WmCommand_LanguageSwedish);
cmessages.Associate(IDM_HELP_HELP, WmHelp);
cmessages.Associate(IDM_HELP_PROJECT_PAGE, WmProjectPage);
}

1
src/parsermanager.h

@ -110,7 +110,6 @@ public:
private:
#ifndef TTCALC_PORTABLE
ttmath::Parser<TTMathBig1> parser1;
ttmath::Parser<TTMathBig2> parser2;
ttmath::Parser<TTMathBig3> parser3;

3
src/programresources.cpp

@ -803,6 +803,9 @@ std::string ini_value[20];
SetDisplayRounding( atoi(ini_value[11].c_str()) );
SetRemovingZeroes( bool(atoi(ini_value[15].c_str())) );
if( ini_value[13] == "6" )
languages.SetCurrentLanguage(Languages::swe);
else
if( ini_value[13] == "5" )
languages.SetCurrentLanguage(Languages::ru);
else

1
src/resource.h

@ -198,6 +198,7 @@
#define IDM_LANGUAGE_DANISH 40013
#define IDM_LANGUAGE_CHINESE 40014
#define IDM_LANGUAGE_RUSSIAN 40015
#define IDM_LANGUAGE_SWEDISH 40016
#define IDM_CLOSE_PROGRAM 40020
#define IDM_EDIT_UNDO 40030
#define IDM_EDIT_PASTE 40031

1
src/resource.rc

@ -32,6 +32,7 @@ BEGIN
MENUITEM "&Danish", 40013
MENUITEM "&Chinese", 40014
MENUITEM "&Russian", 40015
MENUITEM "&Swedish", 40016
END
MENUITEM SEPARATOR
MENUITEM "&Close", 40020

318
src/stopcalculating.h

@ -1,159 +1,159 @@
/*
* This file is a part of TTCalc - a mathematical calculator
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@slimaczek.pl>
*/
/*
* Copyright (c) 2006-2008, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name Tomasz Sowa nor the names of contributors to this
* project may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef headerfilestopcalculating
#define headerfilestopcalculating
/*!
\file stopcalculating.h
\brief it tells us whether there was a stop signal or not
*/
#include <ttmath/ttmathtypes.h>
#include <windows.h>
/*!
\brief it tells us whether there was a stop signal or not
we can pass a pointer to the object of this class to the certain
calculating methods especially for the method which calculates the
Factorial (1*2*3*4....), such methods as the Factorial takes a lot of time
and sometimes we want to break the calculations for example when we've got
a new input string
those methods which take a lot of time check the object of type NewStopCalculating
and if there was a stop signal they stop and return immediately without returning
a correct result
the stop signal can be caused by another thread in our case by the first (gui) thread
there'll be only one object of this class
(it'll be as an variable of ThreadController class)
*/
class NewStopCalculating : public ttmath::StopCalculating
{
public:
/*!
the constructor
*/
NewStopCalculating()
{
stop = 0;
}
/*!
the destructor
*/
~NewStopCalculating()
{
if(stop) CloseHandle(stop);
}
/*!
it initializes an object of this class
this method will be called from Init() of the ThreadController object
*/
bool Init() volatile
{
char buffer[80];
// with 'GetTickCount()' we're generating an unique identifier of our event
// (there can be another window of ttcalc)
sprintf(buffer,"TTCalcStopEventForStoppingCalculations7756%u",
(unsigned int)GetTickCount());
// 'stop' will be manual-reseted and initialized as non-signaled
if( (stop = CreateEvent(0,true,false,buffer))==NULL)
return false;
return true;
}
/*!
when we want to stop the calculations for example when the user changed somewhat
we call the Stop() method from the first (gui) thread
*/
void Stop() volatile
{
SetEvent(stop);
}
/*!
when we start the calculations we call this method
(we call it from WaitForCalculatingAndBlockForStop() method of
ThreadController class)
*/
void Start() volatile
{
ResetEvent(stop);
}
/*!
it returns 'true' if there was a stop signal
it's useful for the second thread and functions which take plenty of time
for calculating, when this method returns 'true' those methods break the
calculations and return without returning a correct value
*/
virtual bool WasStopSignal() const volatile
{
if( WaitForSingleObject(stop,0) == WAIT_OBJECT_0 )
return true;
return false;
}
private:
// manual-reset, initialized as non-signaled
HANDLE stop;
};
#endif
/*
* This file is a part of TTCalc - a mathematical calculator
* and is distributed under the (new) BSD licence.
* Author: Tomasz Sowa <t.sowa@slimaczek.pl>
*/
/*
* Copyright (c) 2006-2008, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name Tomasz Sowa nor the names of contributors to this
* project may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef headerfilestopcalculating
#define headerfilestopcalculating
/*!
\file stopcalculating.h
\brief it tells us whether there was a stop signal or not
*/
#include <ttmath/ttmathtypes.h>
#include <windows.h>
/*!
\brief it tells us whether there was a stop signal or not
we can pass a pointer to the object of this class to the certain
calculating methods especially for the method which calculates the
Factorial (1*2*3*4....), such methods as the Factorial takes a lot of time
and sometimes we want to break the calculations for example when we've got
a new input string
those methods which take a lot of time check the object of type NewStopCalculating
and if there was a stop signal they stop and return immediately without returning
a correct result
the stop signal can be caused by another thread in our case by the first (gui) thread
there'll be only one object of this class
(it'll be as an variable of ThreadController class)
*/
class NewStopCalculating : public ttmath::StopCalculating
{
public:
/*!
the constructor
*/
NewStopCalculating()
{
stop = 0;
}
/*!
the destructor
*/
~NewStopCalculating()
{
if(stop) CloseHandle(stop);
}
/*!
it initializes an object of this class
this method will be called from Init() of the ThreadController object
*/
bool Init() volatile
{
char buffer[80];
// with 'GetTickCount()' we're generating an unique identifier of our event
// (there can be another window of ttcalc)
sprintf(buffer,"TTCalcStopEventForStoppingCalculations7756%u",
(unsigned int)GetTickCount());
// 'stop' will be manual-reseted and initialized as non-signaled
if( (stop = CreateEvent(0,true,false,buffer))==NULL)
return false;
return true;
}
/*!
when we want to stop the calculations for example when the user changed somewhat
we call the Stop() method from the first (gui) thread
*/
void Stop() volatile
{
SetEvent(stop);
}
/*!
when we start the calculations we call this method
(we call it from WaitForCalculatingAndBlockForStop() method of
ThreadController class)
*/
void Start() volatile
{
ResetEvent(stop);
}
/*!
it returns 'true' if there was a stop signal
it's useful for the second thread and functions which take plenty of time
for calculating, when this method returns 'true' those methods break the
calculations and return without returning a correct value
*/
virtual bool WasStopSignal() const volatile
{
if( WaitForSingleObject(stop,0) == WAIT_OBJECT_0 )
return true;
return false;
}
private:
// manual-reset, initialized as non-signaled
HANDLE stop;
};
#endif

3
src/winmain.cpp

@ -44,6 +44,7 @@
*/
#include <string>
#include <ttmath/ttmath.h>
/*!
@ -194,3 +195,5 @@ static Messages messages;
// so that we have the logarythmic time to find the special function to call
return messages.Call(message, hWnd, message, wParam, lParam);
}

Loading…
Cancel
Save