2007-02-08 18:54:37 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of TTCalc - a mathematical calculator
|
|
|
|
* and is distributed under the (new) BSD licence.
|
2009-11-04 18:59:42 +01:00
|
|
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
2007-02-08 18:54:37 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2011-01-30 16:00:07 +01:00
|
|
|
* Copyright (c) 2006-2011, Tomasz Sowa
|
2007-02-08 18:54:37 +01:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
#ifndef headerfilelanguages
|
|
|
|
#define headerfilelanguages
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
|
2008-10-13 06:17:57 +02:00
|
|
|
#include "bigtypes.h"
|
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
class Languages
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum GuiMsg
|
|
|
|
{
|
|
|
|
button_ok,
|
|
|
|
button_cancel,
|
|
|
|
message_box_caption,
|
|
|
|
dialog_box_add_variable_caption,
|
|
|
|
dialog_box_edit_variable_caption,
|
|
|
|
dialog_box_add_variable_incorrect_name,
|
|
|
|
dialog_box_add_variable_incorrect_value,
|
|
|
|
dialog_box_add_variable_variable_exists,
|
|
|
|
dialog_box_edit_variable_unknown_variable,
|
|
|
|
dialog_box_delete_variable_confirm,
|
|
|
|
dialog_box_variable_not_all_deleted,
|
|
|
|
dialog_box_add_function_caption,
|
|
|
|
dialog_box_edit_function_caption,
|
|
|
|
dialog_box_add_function_function_exists,
|
|
|
|
dialog_box_edit_function_unknown_function,
|
|
|
|
dialog_box_delete_function_confirm,
|
|
|
|
dialog_box_function_not_all_deleted,
|
2007-03-02 21:29:27 +01:00
|
|
|
dialog_box_add_function_incorrect_name,
|
2007-01-22 12:12:01 +01:00
|
|
|
list_variables_header_1,
|
|
|
|
list_variables_header_2,
|
|
|
|
list_functions_header_1,
|
|
|
|
list_functions_header_2,
|
|
|
|
list_functions_header_3,
|
|
|
|
button_add,
|
|
|
|
button_edit,
|
|
|
|
button_delete,
|
|
|
|
button_clear,
|
|
|
|
tab_standard,
|
|
|
|
tab_variables,
|
|
|
|
tab_functions,
|
|
|
|
tab_precision,
|
|
|
|
tab_display,
|
2007-08-20 12:44:37 +02:00
|
|
|
tab_convert,
|
2007-01-22 12:12:01 +01:00
|
|
|
radio_precision_1,
|
|
|
|
radio_precision_2,
|
|
|
|
radio_precision_3,
|
|
|
|
precision_1_info,
|
|
|
|
precision_2_info,
|
|
|
|
precision_3_info,
|
|
|
|
overflow_during_printing,
|
|
|
|
combo_rounding_none,
|
|
|
|
combo_rounding_integer,
|
|
|
|
combo_rounding_to_number,
|
|
|
|
combo_rounding_after_comma,
|
2008-04-12 10:52:21 +02:00
|
|
|
check_remove_zeroes,
|
2007-01-22 12:12:01 +01:00
|
|
|
display_input,
|
|
|
|
display_output,
|
|
|
|
display_rounding,
|
|
|
|
display_always_scientific,
|
|
|
|
display_not_always_scientific,
|
2009-05-09 03:13:54 +02:00
|
|
|
display_deg_rad_grad,
|
2009-11-03 22:00:05 +01:00
|
|
|
display_grouping,
|
|
|
|
display_grouping_none,
|
|
|
|
display_grouping_space,
|
2011-01-30 18:30:10 +01:00
|
|
|
display_grouping_digits,
|
2009-11-03 22:00:05 +01:00
|
|
|
display_input_decimal_point,
|
|
|
|
display_input_decimal_point_item1,
|
|
|
|
display_output_decimal_point,
|
|
|
|
display_param_sep,
|
|
|
|
display_param_sep_item2,
|
|
|
|
display_param_sep_item3,
|
2007-08-20 12:44:37 +02:00
|
|
|
convert_type,
|
|
|
|
convert_input,
|
|
|
|
convert_output,
|
|
|
|
convert_dynamic_output,
|
2007-01-22 12:12:01 +01:00
|
|
|
menu_view,
|
|
|
|
menu_edit,
|
|
|
|
menu_help,
|
|
|
|
menu_language,
|
|
|
|
menu_view_new_window,
|
|
|
|
menu_view_normal_view,
|
|
|
|
menu_view_compact_view,
|
|
|
|
menu_view_always_on_top,
|
2009-10-14 00:41:00 +02:00
|
|
|
menu_view_pad,
|
2007-01-22 12:12:01 +01:00
|
|
|
menu_view_lang_english,
|
|
|
|
menu_view_lang_polish,
|
2008-05-01 14:29:44 +02:00
|
|
|
menu_view_lang_spanish,
|
2009-05-01 00:59:06 +02:00
|
|
|
menu_view_lang_danish,
|
2009-06-11 18:07:18 +02:00
|
|
|
menu_view_lang_chinese,
|
2009-06-25 06:54:48 +02:00
|
|
|
menu_view_lang_russian,
|
2009-09-08 03:24:56 +02:00
|
|
|
menu_view_lang_swedish,
|
2010-09-14 18:45:31 +02:00
|
|
|
menu_view_lang_italian,
|
2011-01-30 16:00:07 +01:00
|
|
|
menu_view_lang_german,
|
2007-01-22 12:12:01 +01:00
|
|
|
menu_view_close_program,
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
menu_edit_undo,
|
2009-11-03 22:00:05 +01:00
|
|
|
menu_edit_cut,
|
|
|
|
menu_edit_copy,
|
|
|
|
menu_edit_paste,
|
|
|
|
menu_edit_del,
|
2009-11-03 00:22:25 +01:00
|
|
|
menu_edit_paste_formula,
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
menu_edit_copy_result,
|
2009-11-03 22:00:05 +01:00
|
|
|
menu_edit_copy_both,
|
|
|
|
menu_edit_select_all,
|
|
|
|
menu_edit_bracket,
|
2010-09-14 18:45:31 +02:00
|
|
|
menu_edit_swap,
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
menu_help_help,
|
|
|
|
menu_help_project_page,
|
2009-11-03 22:00:05 +01:00
|
|
|
menu_help_check_update,
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
menu_help_about,
|
2009-11-03 22:00:05 +01:00
|
|
|
menu_update_available,
|
2007-01-22 12:12:01 +01:00
|
|
|
cant_init_calculations,
|
|
|
|
message_box_error_caption,
|
|
|
|
cant_create_thread,
|
2009-10-14 00:41:00 +02:00
|
|
|
cant_create_pad,
|
2007-01-22 12:12:01 +01:00
|
|
|
cant_create_main_window,
|
|
|
|
cant_init_common_controls,
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
cant_find_help,
|
|
|
|
cant_open_project_page,
|
2009-11-03 22:00:05 +01:00
|
|
|
update_title,
|
|
|
|
update_button_next,
|
|
|
|
update_button_finish,
|
|
|
|
update_button_cancel,
|
|
|
|
update_check_at_startup,
|
|
|
|
update_check_for_info,
|
|
|
|
update_is_new_version,
|
2009-12-05 19:30:33 +01:00
|
|
|
update_no_new_version1,
|
|
|
|
update_no_new_version2,
|
2009-11-03 22:00:05 +01:00
|
|
|
update_download_from,
|
|
|
|
update_downloaded_info1,
|
|
|
|
update_downloaded_info2,
|
|
|
|
update_download_error,
|
2007-01-22 12:12:01 +01:00
|
|
|
about_text,
|
2007-06-24 22:11:14 +02:00
|
|
|
about_text_portable_version,
|
|
|
|
about_text_exe_packer,
|
2007-01-22 12:12:01 +01:00
|
|
|
about_box_title,
|
2007-03-08 20:15:55 +01:00
|
|
|
about_box_button_close,
|
2011-01-30 18:30:10 +01:00
|
|
|
display_as_scientific,
|
2009-11-03 22:00:05 +01:00
|
|
|
pad_title,
|
|
|
|
pad_menu_file,
|
|
|
|
pad_menu_edit,
|
|
|
|
pad_menu_file_new,
|
|
|
|
pad_menu_file_open,
|
|
|
|
pad_menu_file_saveas,
|
|
|
|
pad_menu_file_close,
|
|
|
|
pad_menu_edit_undo,
|
|
|
|
pad_menu_edit_cut,
|
|
|
|
pad_menu_edit_copy,
|
|
|
|
pad_menu_edit_paste,
|
|
|
|
pad_menu_edit_del,
|
|
|
|
pad_menu_edit_select_all,
|
2010-09-14 18:45:31 +02:00
|
|
|
cannot_open_file,
|
|
|
|
cannot_save_file,
|
|
|
|
file_too_long,
|
|
|
|
other_error,
|
2007-03-02 21:29:27 +01:00
|
|
|
unknown_error
|
2007-01-22 12:12:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// the first item must be with zero index
|
|
|
|
// and next items must be about one greater (0,1,2,3..)
|
|
|
|
// (after conversion to 'int' we pass it into the std::vector)
|
|
|
|
enum Country
|
|
|
|
{
|
2011-01-30 16:00:07 +01:00
|
|
|
en = 0, pl, sp, da, chn, ru, swe, it, ger
|
2007-01-22 12:12:01 +01:00
|
|
|
};
|
|
|
|
|
2007-08-22 23:16:19 +02:00
|
|
|
|
2007-11-03 23:56:43 +01:00
|
|
|
|
|
|
|
|
2008-10-13 06:17:57 +02:00
|
|
|
// TTMathBigMax foo_return;
|
2007-08-22 23:16:19 +02:00
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
Country current_country;
|
|
|
|
|
|
|
|
std::vector<std::map<ttmath::ErrorCode, std::string> > error_messages_tab;
|
|
|
|
std::vector<std::map<GuiMsg, std::string> > gui_messages_tab;
|
|
|
|
|
|
|
|
void InsertErrorPair(ttmath::ErrorCode code, const char * message);
|
|
|
|
void InitErrorMessagesTab();
|
|
|
|
|
|
|
|
void InsertGuiPair(GuiMsg code, const char * message);
|
|
|
|
void InitGuiMessagesTab();
|
|
|
|
|
2007-11-03 23:56:43 +01:00
|
|
|
|
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
|
2007-08-22 23:16:19 +02:00
|
|
|
|
|
|
|
public:
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
Languages()
|
|
|
|
{
|
|
|
|
current_country = en;
|
2008-10-13 06:17:57 +02:00
|
|
|
// foo_return = 0;
|
2007-01-22 12:12:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetCurrentLanguage(Country c)
|
|
|
|
{
|
|
|
|
current_country = c;
|
|
|
|
}
|
|
|
|
|
|
|
|
Country GetCurrentLanguage()
|
|
|
|
{
|
|
|
|
return current_country;
|
|
|
|
}
|
|
|
|
|
2007-11-04 22:56:55 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
we're using some methods from this class simultaneously in two threads,
|
|
|
|
this is to be sure that everything is initialized before the second thread is started
|
|
|
|
|
|
|
|
should be called before calling the second thread
|
|
|
|
*/
|
|
|
|
void InitAll()
|
|
|
|
{
|
|
|
|
InitErrorMessagesTab();
|
|
|
|
InitGuiMessagesTab();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
long form of methods
|
|
|
|
(with 'coutry')
|
|
|
|
|
|
|
|
these methods you can call from the second thread without having to
|
|
|
|
calling StopCalculating() and StartCalculating() from the thread controller
|
|
|
|
|
|
|
|
the methods return only static value - remember to call InitAll() somewhere
|
|
|
|
at the beginning e.g. in the first thread
|
|
|
|
*/
|
2007-01-22 12:12:01 +01:00
|
|
|
const char * ErrorMessage(Country country, ttmath::ErrorCode code);
|
|
|
|
const char * GuiMessage(Country country, GuiMsg code);
|
2008-10-13 06:17:57 +02:00
|
|
|
|
2007-09-18 22:08:47 +02:00
|
|
|
|
2007-11-04 22:56:55 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
short form of methods
|
|
|
|
(without 'country' - it's taken from a private variable 'current_country')
|
|
|
|
|
|
|
|
don't use these methods in the second thread - the parameter 'country' can be using
|
|
|
|
by the first thread, although the 'country' is simply enum and should be atomic
|
|
|
|
but in the future it may be changed
|
|
|
|
*/
|
|
|
|
const char * ErrorMessage(ttmath::ErrorCode code);
|
|
|
|
const char * GuiMessage(GuiMsg code);
|
2007-08-22 23:16:19 +02:00
|
|
|
|
2007-11-04 22:56:55 +01:00
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|