Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
783bebc269 | |||
19f4177691 | |||
b668b3765c | |||
b3f25face3 | |||
34500e3a5e | |||
e841dcfa70 | |||
ebc5359953 | |||
dd32ebd6cd | |||
e89901bbab | |||
87abe4ce7e | |||
e960c2adea | |||
6555140b9a | |||
04fbbaceca | |||
ff62d833c9 | |||
2ff2aebbee | |||
ec87cd8054 | |||
b7b52c9ebe | |||
4e75bda5fc | |||
ee05abc94d | |||
01ad539107 | |||
ae0a8dc911 | |||
d33a6925b1 | |||
f59f1e1580 | |||
000d884d36 | |||
758d881510 | |||
c232565953 | |||
af284466d6 | |||
97ec3123d9 |
213
CHANGELOG
213
CHANGELOG
@@ -1,60 +1,171 @@
|
|||||||
|
Version 0.8.6 (2009.06.30):
|
||||||
|
* added: new language: Russian
|
||||||
|
translation made by: Vladimir Gladilovich <vdgladilovich at gmail dot com>
|
||||||
|
|
||||||
|
|
||||||
|
Version 0.8.5 (2009.06.18):
|
||||||
|
* added: new language: Chinese
|
||||||
|
translation made by: Juis <zsyfly at gmail dot com>
|
||||||
|
* changed: version of the TTMath library: 0.8.5 now
|
||||||
|
|
||||||
|
Changes from TTMath 0.8.5 relating to TTCalc:
|
||||||
|
* fixed: Big::Mod(x) didn't correctly return a carry
|
||||||
|
and the result was sometimes very big (even greater than x)
|
||||||
|
* changed: factorial() function is much faster now
|
||||||
|
|
||||||
|
|
||||||
|
Version 0.8.4 (2009.05.08):
|
||||||
|
* added: new language: Danish
|
||||||
|
translation made by: Rune Bisgaard Vammen <runebisgaard at gmail dot com>
|
||||||
|
|
||||||
|
|
||||||
|
Version 0.8.3 (2009.04.06):
|
||||||
|
* fixed: calculating the size of the main window
|
||||||
|
now it looks good on MS Vista and when a user changes size of some
|
||||||
|
widgets such as a border, font size, etc.
|
||||||
|
* changed: variables and functions are case-sensitive now, e.g.
|
||||||
|
'x' is not the same as 'X'
|
||||||
|
* changed: precision:
|
||||||
|
small - the same as previous
|
||||||
|
medium - 288 bits for the mantissa, 64 bits for the exponent
|
||||||
|
big - 864 bits for the mantissa, 128 bits for the exponent
|
||||||
|
previous were:
|
||||||
|
medium - 192 bits for the mantissa, 64 bits for the exponent
|
||||||
|
big - 288 bits for the mantissa, 96 bits for the exponent
|
||||||
|
* changed: new version of TTMath bignum library: 0.8.3
|
||||||
|
* added: when a user presses CTRL+C then the result will be
|
||||||
|
copied into the clipboard (if the current control which
|
||||||
|
has a focus is not an edit control, or if it is an edit
|
||||||
|
but has no selection)
|
||||||
|
* added: when a user presses CTRL+V then the text from the clipboard
|
||||||
|
will be copied into the edit control
|
||||||
|
(the focus can be anywhere but it cannot be on another edit control)
|
||||||
|
* added: 'decimal point' option on the display tab
|
||||||
|
* added: variables and functions can have underline characters
|
||||||
|
in their names
|
||||||
|
* added: 'remove trailing zeroes' option on 'display' tab
|
||||||
|
* added: new language: Spanish
|
||||||
|
translation made by Alejandro S. Valdezate
|
||||||
|
alesanval at gmail dot com
|
||||||
|
* added: on display tab: we can select 'deg' 'rad' or 'grad' for calculating
|
||||||
|
in such functions: sin,cos,tan,cot,asin,acos,atan,acot
|
||||||
|
* added: when the program exits new variables and functions are read from
|
||||||
|
the configuration file and then the file is saved
|
||||||
|
(if you have inserted some variables or functions in a different
|
||||||
|
instance of TTCalc those variables or functions were previously
|
||||||
|
skipped)
|
||||||
|
* removed: 'cut off last non valid digits' on 'rounding' option
|
||||||
|
on 'display' tab
|
||||||
|
|
||||||
|
Changes from TTMath 0.8.3 relating to TTCalc:
|
||||||
|
* fixed: Big::Add incorrectly rounded 'this' when both exponents were equal
|
||||||
|
it caused that sometimes when adding a zero the result has changed
|
||||||
|
this had impact among other things on FromString() method
|
||||||
|
"0,8" had different binary representation from "0,80"
|
||||||
|
* fixed: Big::Pow(const Big<exp, man> & pow)
|
||||||
|
it's using PowInt() only when pow.exponent is in range (-man*TTMATH_BITS_PER_UINT; 0]
|
||||||
|
previously the powering 'hung' on an input like this: "(1+ 1e-10000) ^ 10e100000000"
|
||||||
|
(there was 10e100000000 iterations in PowInt())
|
||||||
|
* fixed: in function DegToRad(const ValueType & x, ErrorCode * err = 0) it is better
|
||||||
|
to make division first and then mutliplication -- the result is more
|
||||||
|
accurate especially when x is: 90,180,270 or 360
|
||||||
|
* fixed: the parser didn't correctly treat operators for changing the base
|
||||||
|
(radix) -- operators '#' and '&', e.g.:
|
||||||
|
'#sin(1)' was equal '0' -- there was a zero from '#' and then
|
||||||
|
it was multiplied by 'sin(1)'
|
||||||
|
the parser didn't check whether Big::FromString() has actually
|
||||||
|
read a proper value -- the method Big::FromString() didn't have
|
||||||
|
something to report such a situation
|
||||||
|
* fixed: Big::FromString() when the base is 10, the method reads the scientific
|
||||||
|
part only if such a part it correctly supplied, e.g:
|
||||||
|
'1234e10', '1234e+10', '1234e-5'
|
||||||
|
previous '1234e' was treated as: '1234e0' (now parsing stops on 'e' and
|
||||||
|
the 'e' can be parsed by other parsers, e.g. the mathematical
|
||||||
|
parser -- now in the parser would be: '1234e' = '1234 * e' = '3354,3597...' )
|
||||||
|
* changed: in the parser: the form with operators '#' and '&' is as follows:
|
||||||
|
[-|+][#|&]numeric_value
|
||||||
|
previous was: [-|+][#|&][-|+]numeric_value
|
||||||
|
* changed: the parser is allowed to recognize values which
|
||||||
|
begin with a dot, e.g '.5' is treated as '0.5'
|
||||||
|
* added: functions to the parser: gradtorad(grad), radtograd(rad), degtograd(deg),
|
||||||
|
degtograd(d,m,s), gradtodeg(grad)
|
||||||
|
* added: a short form of multiplication
|
||||||
|
(without the '*' character) e.g. '5y'
|
||||||
|
(it's used only if the second parameter is a variable
|
||||||
|
or function)
|
||||||
|
|
||||||
|
|
||||||
|
Version 0.8.2 portable (2007.07.01):
|
||||||
|
* added: the portable version of the program TTCalc
|
||||||
|
it uses *.ini config file from the same folder where
|
||||||
|
is the executable file, and it's much smaller in size
|
||||||
|
(in the portable version there's only one kind
|
||||||
|
of precision and the program is packed with UPX -
|
||||||
|
the Ultimate Packer for eXecutables)
|
||||||
|
there are no other differences between version 0.8.1 and this one
|
||||||
|
|
||||||
|
|
||||||
Version 0.8.1 (2007.04.17):
|
Version 0.8.1 (2007.04.17):
|
||||||
* changed: on win9x the configuration file is in a folder like:
|
* changed: on win9x the configuration file is in a folder like:
|
||||||
"c:\windows\data application\ttcalc\" now
|
"c:\windows\data application\ttcalc\" now
|
||||||
* changed: the program uses the TTMath 0.8.1 now
|
* changed: the program uses the TTMath 0.8.1 now
|
||||||
* added: from TTMath 0.8.1:
|
* added: from TTMath 0.8.1:
|
||||||
root(x, index), bitand(x,y), bitor(x,y), bitxor(x,y)
|
root(x, index), bitand(x,y), bitor(x,y), bitxor(x,y)
|
||||||
/band(x,y), bor(x,y), bxor(x,y)/
|
/band(x,y), bor(x,y), bxor(x,y)/
|
||||||
asinh(x), acosh(x), atanh(x), acoth(x) /atgh(x), actgh(x)/
|
asinh(x), acosh(x), atanh(x), acoth(x) /atgh(x), actgh(x)/
|
||||||
* changed: from TTMath 0.8.1: calculations are much faster now
|
* changed: from TTMath 0.8.1: calculations are much faster now
|
||||||
especially the factorial() function
|
especially the factorial() function
|
||||||
* changed: from TTMath 0.8.1: the way of parsing operators
|
* changed: from TTMath 0.8.1: the way of parsing operators
|
||||||
|
|
||||||
|
|
||||||
Version 0.8.0 (2007.04.02):
|
Version 0.8.0 (2007.04.02):
|
||||||
* added: the del key deletes a variable or a function now
|
* added: the del key deletes a variable or a function now
|
||||||
(if the focus is on the list)
|
(if the focus is on the list)
|
||||||
* added: a user can change the names of variables or functions now
|
* added: a user can change the names of variables or functions now
|
||||||
* changed: the program uses TTMath 0.8.0 now
|
* changed: the program uses TTMath 0.8.0 now
|
||||||
* added: functions: from TTMath 0.8.0:
|
* added: functions: from TTMath 0.8.0:
|
||||||
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
|
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
|
||||||
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
|
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
|
||||||
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
|
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
|
||||||
* added: a help
|
* added: help
|
||||||
* changed: from TTMath 0.8.0:
|
* changed: from TTMath 0.8.0:
|
||||||
renamed: CTan() into Cot() or Ctg()
|
renamed: CTan() into Cot() or Ctg()
|
||||||
renamed: ACTan() into ACot() or ACtg()
|
renamed: ACTan() into ACot() or ACtg()
|
||||||
Factorial() has a history log now (it can remember last
|
Factorial() has a history log now (it can remember last
|
||||||
10 calculated values)
|
10 calculated values)
|
||||||
* fixed: the vertical size of the main window when a user uses a different
|
* 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)
|
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
|
* fixed: on Windows 9x: the program hung when a user clicks on a control
|
||||||
on the first tab
|
on the first tab
|
||||||
* fixed: when a user started navigating from the keyboard the program showed
|
* fixed: when a user started navigating from the keyboard the program showed
|
||||||
a wrong variable or a funtion in the edit dialog
|
a wrong variable or a funtion in the edit dialog
|
||||||
|
|
||||||
|
|
||||||
Version 0.7.3 (2007.03.08):
|
Version 0.7.3 (2007.03.08):
|
||||||
* added: the program shows some kind of errors itself
|
* added: the program shows some kind of errors itself
|
||||||
* added: checking whether an user has inserted a correct value of a variable
|
* added: checking whether an user has inserted a correct value of a variable
|
||||||
or a function
|
or a function
|
||||||
* fixed: navigation from the keyboard
|
* fixed: navigation from the keyboard
|
||||||
* changed: the esc key selects the entire input text now (in the input edit)
|
* changed: the esc key selects the entire input text now (in the input edit)
|
||||||
* added: a test when the program is being starded which checks if the
|
* added: a test when the program is being starded which checks if the
|
||||||
coordinates of the main window actually pointing at the valid area (for
|
coordinates of the main window actually pointing at the valid area (for
|
||||||
example when someone took his configuration file into a new computer and
|
example when someone took his configuration file into a new computer and
|
||||||
the new computer has a smaller screen)
|
the new computer has a smaller screen)
|
||||||
|
|
||||||
|
|
||||||
Version 0.7.2 (2007.02.28):
|
Version 0.7.2 (2007.02.28):
|
||||||
* added buttons Sgn and Mod
|
* added: buttons Sgn and Mod
|
||||||
* the button 'err' is active when there's actually an error now
|
* changed: the button 'err' is active when there's actually an error now
|
||||||
* added buttons: ASin, ACos, ATan, ACTan
|
* added: buttons: ASin, ACos, ATan, ACTan
|
||||||
* fixed: the program didn't save the current language into the configuration file
|
* fixed: the program didn't save the current language into the configuration file
|
||||||
* fixed: the second thread didn't read the main window correctly and it caused
|
* fixed: the second thread didn't read the main window correctly and it caused
|
||||||
small problems when an user was typing into the first edit control
|
small problems when an user was typing into the first edit control
|
||||||
|
|
||||||
|
|
||||||
Version 0.7.1 (2007.02.08):
|
Version 0.7.1 (2007.02.08):
|
||||||
* added a button 'err' (error) on the first tab
|
* added: button 'err' (error) on the first tab
|
||||||
* the input edit can have 2048 characters now
|
* changed: the input edit can have 2048 characters now
|
||||||
* added remembering the vertical size into the config file
|
* added: remembering the vertical size into the config file
|
||||||
* fixed a problem with the 'tab' key
|
* fixed: a problem with the 'tab' key
|
||||||
* added a message 'Calculating...' when an user clicks on the 'err' button
|
* added: a message 'Calculating...' when an user clicks on the 'err' button
|
||||||
during calculating something
|
during calculating something
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2006-2007, Tomasz Sowa
|
Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
36
README
36
README
@@ -1,19 +1,23 @@
|
|||||||
TTCalc
|
TTCalc
|
||||||
|
|
||||||
TTCalc is a mathematical calculator. It has a nice user interface,
|
TTCalc is an open source bignum mathematical calculator. It features
|
||||||
formulas for calculating can be inserted by using a keyboard or a mouse.
|
arithmetical functions, trigonometric functions, inverse trigonometric
|
||||||
The result is automatically shown in a second window without using any
|
functions, hyperbolic functions, inverse hyperbolic functions, logical
|
||||||
additional keys such as 'equal'. The program possess trigonometric
|
operators, logarithms, functions for converting between degrees and radians
|
||||||
functions, inverse trigonometric functions, hyperbolic functions,
|
and so on. Additionally the program allows a user to define his own
|
||||||
logical operators, logarithms, functions for converting between degrees
|
variables and functions.
|
||||||
and radians and so on. Additionally the program allows the user to
|
|
||||||
define his own variables and functions. Calculations are performed by
|
|
||||||
using floating point numbers with three kind of precision, the biggest
|
|
||||||
has 288 bits for its mantissa and 96 bits for its exponent that is
|
|
||||||
about 2.551...e+11925026709067095507636213441 with 85 valid decimal
|
|
||||||
digits. The program independently allows to insert and display values
|
|
||||||
with the base (radix) from two to sixteen.
|
|
||||||
|
|
||||||
Author: Tomasz Sowa <t.sowa AnTispam slimaczek.pl>
|
The program possesses an easy to use interface. Calculations are performed
|
||||||
Project page: http://sourceforge.net/projects/ttcalc
|
by using binary floating point numbers with three kinds of precision,
|
||||||
Licence: BSD (open source)
|
the biggest has 864 bits for its mantissa and 128 bits for its exponent
|
||||||
|
that is about 6.70897699... * 10^51217599719369681875006054625051616609
|
||||||
|
with 258 valid decimal digits. TTCalc independently allows to insert and
|
||||||
|
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
|
||||||
|
Project page: http://ttcalc.sourceforge.net/
|
||||||
|
Bignum library: TTMath http://www.ttmath.org/
|
||||||
|
Operating systems: Microsoft Windows 9x/Me/NT/2000/XP/Vista
|
||||||
|
36
help/accuracy.html
Normal file
36
help/accuracy.html
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - accuracy</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="accuracy">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Accuracy</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
TTCalc uses binary floating point numbers. It means that your input values are first
|
||||||
|
converted to a binary representation and then the calculations are performed. After
|
||||||
|
calculating the result is again converted from the binary to the decimal (you can
|
||||||
|
select the input and output format on the display tab). You must remember that not
|
||||||
|
all values can be converted from binary to decimal (and vice versa) without loosing
|
||||||
|
accuracy. For example decimal '5' can be converted to binary '101' and the '101' is
|
||||||
|
exactly equal decimal 5. But decimal '0.3' has not a good binary representation, it
|
||||||
|
is '0.010011001100110011.....'. And when you put decimal '0.3' the calculations are
|
||||||
|
performed on an approximate value and the result is only an approximation too.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
For example try to calculate: 0.204 - 0.34*0.80 + 0.068, you would expect that the
|
||||||
|
result would be: 0 but TTCalc gives you: 3.15544362088404722164691426e-30 which is
|
||||||
|
a good approximation to the real zero (look at e-30 part which means 10^(-30)).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -6,48 +6,6 @@
|
|||||||
<title>TTCalc - arithmetic functions</title>
|
<title>TTCalc - arithmetic functions</title>
|
||||||
<link rel="stylesheet" href="styles.css" type="text/css">
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
<param name="Keyword" value="ln">
|
|
||||||
<param name="Keyword" value="log">
|
|
||||||
<param name="Keyword" value="exp">
|
|
||||||
<param name="Keyword" value="sin">
|
|
||||||
<param name="Keyword" value="cos">
|
|
||||||
<param name="Keyword" value="tan">
|
|
||||||
<param name="Keyword" value="tg">
|
|
||||||
<param name="Keyword" value="cot">
|
|
||||||
<param name="Keyword" value="ctg">
|
|
||||||
<param name="Keyword" value="asin">
|
|
||||||
<param name="Keyword" value="acos">
|
|
||||||
<param name="Keyword" value="atan">
|
|
||||||
<param name="Keyword" value="atg">
|
|
||||||
<param name="Keyword" value="acot">
|
|
||||||
<param name="Keyword" value="actg">
|
|
||||||
<param name="Keyword" value="sinh">
|
|
||||||
<param name="Keyword" value="cosh">
|
|
||||||
<param name="Keyword" value="tanh">
|
|
||||||
<param name="Keyword" value="tgh">
|
|
||||||
<param name="Keyword" value="coth">
|
|
||||||
<param name="Keyword" value="ctgh">
|
|
||||||
<param name="Keyword" value="asinh">
|
|
||||||
<param name="Keyword" value="acosh">
|
|
||||||
<param name="Keyword" value="atanh">
|
|
||||||
<param name="Keyword" value="atgh">
|
|
||||||
<param name="Keyword" value="acoth">
|
|
||||||
<param name="Keyword" value="actgh">
|
|
||||||
<param name="Keyword" value="degtodeg">
|
|
||||||
<param name="Keyword" value="degtorad">
|
|
||||||
<param name="Keyword" value="radtodeg">
|
|
||||||
<param name="Keyword" value="sqrt">
|
|
||||||
<param name="Keyword" value="root">
|
|
||||||
<param name="Keyword" value="factorial">
|
|
||||||
<param name="Keyword" value="abs">
|
|
||||||
<param name="Keyword" value="sgn">
|
|
||||||
<param name="Keyword" value="mod">
|
|
||||||
<param name="Keyword" value="int">
|
|
||||||
<param name="Keyword" value="round">
|
|
||||||
<param name="Keyword" value="ceil">
|
|
||||||
<param name="Keyword" value="floar">
|
|
||||||
<param name="Keyword" value="max">
|
|
||||||
<param name="Keyword" value="min">
|
|
||||||
<param name="Keyword" value="builtin functions">
|
<param name="Keyword" value="builtin functions">
|
||||||
</object>
|
</object>
|
||||||
</head>
|
</head>
|
||||||
@@ -58,142 +16,98 @@
|
|||||||
|
|
||||||
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
<dl>
|
<h2>Logarithm and Exponential</h2>
|
||||||
<dt>ln(x)</dt>
|
|
||||||
<dd>This function calculates the natural logarithm of x,<br>e.g. ln(123)=4.812...</dd>
|
|
||||||
|
|
||||||
<dt>log(x; base)</dt>
|
<ul>
|
||||||
<dd>This function calculates the logarithm of x with a base equal 'base'<br>log(123; 4)=3.471...</dd>
|
<li><a href="logarithm_exponential.html">ln(x)</a></li>
|
||||||
|
<li><a href="logarithm_exponential.html">log(x; base)</a></li>
|
||||||
|
<li><a href="logarithm_exponential.html">exp(x)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>exp(x)</dt>
|
|
||||||
<dd>This function calculates the exponent of x<br>exp(20)=e^20=485165195.409...</dd>
|
|
||||||
|
|
||||||
<dt>sin(x)</dt>
|
<h2>Trigonometric functions</h2>
|
||||||
<dd>This function returns the sine of x.<br>For example sin(0.8)=0.717...<br>The argument x is in radians, if you want to calculate
|
|
||||||
with degrees use the degtorad(x) function first e.g. sin(degtorad(30))=0.5 calculates the sine of 30 degrees.</dd>
|
|
||||||
|
|
||||||
<dt>cos(x)</dt>
|
<p><strong>Note:</strong> On the display tab you can select between degrees, radians and gradians. This affects the input value.</p>
|
||||||
<dd>Cosine of x<br>cos(1.3)=0.267...<br>The argument x is in radians.</dd>
|
|
||||||
|
|
||||||
<dt>tan(x) or tg(x)</dt>
|
<ul>
|
||||||
<dd>Tangent of x<br>tan(3.6)=0.493...<br>The argument x is in radians.</dd>
|
<li><a href="trigonometric_functions.html">sin(x)</a></li>
|
||||||
|
<li><a href="trigonometric_functions.html">cos(x)</a></li>
|
||||||
|
<li><a href="trigonometric_functions.html">tan(x) or tg(x)</a></li>
|
||||||
|
<li><a href="trigonometric_functions.html">cot(x) or ctg(x)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>cot(x) or ctg(x)</dt>
|
|
||||||
<dd>Cotangent of x<br>cot(2.3)=-0.893...<br>The argument x is in radians.</dd>
|
|
||||||
|
|
||||||
<dt>asin(x)</dt>
|
<h2>Inverse trigonometric functions</h2>
|
||||||
<dd>Inverse sine (arc sine) of x<br>e.g. asin(0.7)=0.775...<br>The result is in radians. If you want the result to be in degrees use
|
|
||||||
radtodeg function e.g. radtodeg(asin(0,5))=30</dd>
|
|
||||||
|
|
||||||
<dt>acos(x)</dt>
|
<p><strong>Note:</strong> On the display tab you can select between degrees, radians and gradians. This affects the output (result) value.</p>
|
||||||
<dd>Inverse cosine (arc cosine) of x<br>acos(0.9)=0.451...<br>The result is in radians.</dd>
|
|
||||||
|
|
||||||
<dt>atan(x) or atg(x)</dt>
|
<ul>
|
||||||
<dd>Inverse tangent (arc tangent) of x<br>atan(3.3)=1.276...<br>The result is in radians.</dd>
|
<li><a href="inverse_trigonometric_functions.html">asin(x)</a></li>
|
||||||
|
<li><a href="inverse_trigonometric_functions.html">acos(x)</a></li>
|
||||||
|
<li><a href="inverse_trigonometric_functions.html">atan(x) or atg(x)</a></li>
|
||||||
|
<li><a href="inverse_trigonometric_functions.html">acot(x) or actg(x)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>acot(x) or actg(x)</dt>
|
|
||||||
<dd>Inverse cotangent (arc cotangent) of x<br>acot(10)=0.099...<br>The result is in radians.</dd>
|
|
||||||
|
|
||||||
<dt>sinh(x)</dt>
|
<h2>Hyperbolic functions</h2>
|
||||||
<dd>This function returns hyperbolic sine of x<br>sinh(12)=81377.395...</dd>
|
|
||||||
|
|
||||||
<dt>cosh(x)</dt>
|
<ul>
|
||||||
<dd>Hyperbolic cosine of x<br>cosh(8.5)=2457.384...</dd>
|
<li><a href="hyperbolic_functions.html">sinh(x)</a></li>
|
||||||
|
<li><a href="hyperbolic_functions.html">cosh(x)</a></li>
|
||||||
|
<li><a href="hyperbolic_functions.html">tanh(x) or tgh(x)</a></li>
|
||||||
|
<li><a href="hyperbolic_functions.html">coth(x) or ctgh(x)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>tanh(x) or tgh(x)</dt>
|
|
||||||
<dd>Hyperbolic tangent of x<br>tanh(0.67)=0.584...</dd>
|
|
||||||
|
|
||||||
<dt>coth(x) or ctgh(x)</dt>
|
<h2>Inverse hyperbolic functions</h2>
|
||||||
<dd>Hyperbolic cotangent of x<br>coth(1.67)=1.073...</dd>
|
|
||||||
|
|
||||||
<dt>asinh(x)</dt>
|
<ul>
|
||||||
<dd>This function returns inverse hyperbolic sine of x<br>asinh(3.6)=1.992...</dd>
|
<li><a href="inverse_hyperbolic_functions.html">asinh(x)</a></li>
|
||||||
|
<li><a href="inverse_hyperbolic_functions.html">acosh(x)</a></li>
|
||||||
|
<li><a href="inverse_hyperbolic_functions.html">atanh(x) or atgh(x)</a></li>
|
||||||
|
<li><a href="inverse_hyperbolic_functions.html">acoth(x) or actgh(x)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>acosh(x)</dt>
|
|
||||||
<dd>This function returns inverse hyperbolic cosine of x<br>acosh(2.23)=1.440...</dd>
|
|
||||||
|
|
||||||
<dt>atanh(x) or atgh(x)</dt>
|
<h2>Conversions between radians, degrees and gradians</h2>
|
||||||
<dd>This function returns inverse hyperbolic tangent of x<br>atanh(0.67)=0.810...</dd>
|
|
||||||
|
|
||||||
<dt>acoth(x) or actgh(x)</dt>
|
<ul>
|
||||||
<dd>This function returns inverse hyperbolic cotangent of x<br>acoth(1.23)=1.135...</dd>
|
<li><a href="conversions_deg_rad_grad.html">degtodeg(deg; min; sec)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">degtorad(deg; min; sec)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">degtograd(deg; min; sec)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">degtorad(deg)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">degtograd(deg)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">radtodeg(rad)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">radtograd(rad)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">gradtorad(grad)</a></li>
|
||||||
|
<li><a href="conversions_deg_rad_grad.html">gradtodeg(grad)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>DegToDeg(deg; min; sec)</dt>
|
|
||||||
<dd>This function converts degrees from the long format with degres, minutes and seconds into only degrees.<br>
|
|
||||||
For example degtodeg(12; 30; 0)=12.5</dd>
|
|
||||||
|
|
||||||
<dt>DegToRad(deg)</dt>
|
<h2>Rounding functions</h2>
|
||||||
<dd>This function converts degrees into radians<br>degtorad(12.5)=0.218166...</dd>
|
|
||||||
|
|
||||||
<dt>DegToRad(deg; min; sec)</dt>
|
<ul>
|
||||||
<dd>This function converts degrees in the long format (degrees, minutes, seconds) to radians.<br>For example
|
<li><a href="rounding_functions.html">int(x)</a></li>
|
||||||
degtorad(12; 30; 0)=0.218166...</dd>
|
<li><a href="rounding_functions.html">round(x)</a></li>
|
||||||
|
<li><a href="rounding_functions.html">ceil(x)</a></li>
|
||||||
|
<li><a href="rounding_functions.html">floor(x)</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<dt>RadToDeg(rad)</dt>
|
|
||||||
<dd>This function converts radians into degrees<br>radtodeg(pi)=180</dd>
|
|
||||||
|
|
||||||
<dt>sqrt(x)</dt>
|
<h2>Other functions</h2>
|
||||||
<dd>Sqrt returns the square root of x<br>sqrt(9)=3</dd>
|
|
||||||
|
|
||||||
<dt>root(x ; n)</dt>
|
<ul>
|
||||||
<dd>The nth root of a 'x', 'n' must be integer and not negative, if 'n' is zero the result is one,
|
<li><a href="other_functions.html">sqrt(x)</a></li>
|
||||||
if 'x' is zero the result is zero and we assume that the root(0;0) is not defined, e.g.<br>
|
<li><a href="other_functions.html">root(x ; n)</a></li>
|
||||||
root(8;3)=2<br>
|
<li><a href="other_functions.html">factorial(x)</a></li>
|
||||||
root(-8;3)=-2
|
<li><a href="other_functions.html">abs(x)</a></li>
|
||||||
</dd>
|
<li><a href="other_functions.html">sgn(x)</a></li>
|
||||||
|
<li><a href="other_functions.html">mod(x; y)</a></li>
|
||||||
<dt>factorial(x)</dt>
|
<li><a href="other_functions.html">max(x1; x2; ...)</a></li>
|
||||||
<dd>The factorial function<br>factorial(6)=1*2*3*4*5*6=720</dd>
|
<li><a href="other_functions.html">min(x1; x2; ...)</a></li>
|
||||||
|
<li><a href="other_functions.html">sum(x1; x2; ...)</a></li>
|
||||||
<dt>abs(x)</dt>
|
<li><a href="other_functions.html">avg(x1; x2; ...)</a></li>
|
||||||
<dd>The absolute value of x<br>abs(-10)=10</dd>
|
</ul>
|
||||||
|
|
||||||
<dt>sgn(x)</dt>
|
|
||||||
<dd>This function returns the sign of x that means when the x is positive the result is 1, when the x is negative
|
|
||||||
the result is -1 and when the x is zero the result is zero too<br>
|
|
||||||
sgn(-10)=-1<br>
|
|
||||||
sgn(0)=0<br>
|
|
||||||
sgn(5)=1</dd>
|
|
||||||
|
|
||||||
<dt>mod(x,y)</dt>
|
|
||||||
<dd>Mod returns the remainder from the division x by y<br>mod(10; 2.2)=1.2 because 10=2.2*4 + 1.2</dd>
|
|
||||||
|
|
||||||
<dt>int(x)</dt>
|
|
||||||
<dd>This method returns only the integer part of x.<br>int(2.7)=2</dd>
|
|
||||||
|
|
||||||
<dt>round(x)</dt>
|
|
||||||
<dd>This method rounds the value of x to the nearest integer<br>
|
|
||||||
round(2.8)=3<br>
|
|
||||||
round(2.2)=2<br>
|
|
||||||
round(2)=2<br>
|
|
||||||
round(-4.8)=-5<br>
|
|
||||||
round(-4.1)=-4</dd>
|
|
||||||
|
|
||||||
<dt>ceil(x)</dt>
|
|
||||||
<dd>This function returns a value representing the smallest integer that is greater than or equal to x<br>
|
|
||||||
ceil(2.8)=3<br>
|
|
||||||
ceil(2.2)=3<br>
|
|
||||||
ceil(2)=2<br>
|
|
||||||
ceil(-4.8)=-4<br>
|
|
||||||
ceil(-4.1)=-4</dd>
|
|
||||||
|
|
||||||
<dt>floor(x)</dt>
|
|
||||||
<dd>This function returns a value representing the largest integer that is less than or equal to x<br>
|
|
||||||
floor(2.8)=2<br>
|
|
||||||
floor(2.2)=2<br>
|
|
||||||
floor(2)=2<br>
|
|
||||||
floor(-4.8)=-5<br>
|
|
||||||
floor(-4.1)=-5</dd>
|
|
||||||
|
|
||||||
<dt>max(x1; x2; ...)</dt>
|
|
||||||
<dd>This functions takes any number of arguments. It returns the max value of them. If there aren't arguments
|
|
||||||
the function returns the max value which can be held in this precision.</dd>
|
|
||||||
|
|
||||||
<dt>min(x1; x2; ...)</dt>
|
|
||||||
<dd>This functions takes any number of arguments. It returns the min value of them. If there aren't arguments
|
|
||||||
the function returns the min value which can be held in this precision.</dd>
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
49
help/bitwise_functions.html
Normal file
49
help/bitwise_functions.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - bitwise functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="bitand">
|
||||||
|
<param name="Keyword" value="bitor">
|
||||||
|
<param name="Keyword" value="bitxor">
|
||||||
|
<param name="Keyword" value="band">
|
||||||
|
<param name="Keyword" value="bor">
|
||||||
|
<param name="Keyword" value="bxor">
|
||||||
|
<param name="Keyword" value="bitwise functions">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Bitwise functions</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
There are bitwise functions in the program but they can operate only on non-negative values.
|
||||||
|
We don't define the BitNot() function too.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>bitand(x ; y) or band(x ; y)</dt>
|
||||||
|
<dd>Bitwise AND. For example:<br>
|
||||||
|
bitand(6; 2) = bitand(&110 ; &10) = &10 = 2<br>
|
||||||
|
bitand(6.5; 2.5) = bitand(&110.1 ; &10.1) = &10.1 = 2.5</dd>
|
||||||
|
|
||||||
|
<dt>bitor(x ; y) or bor(x ; y)</dt>
|
||||||
|
<dd>Bitwise OR. For example:<br>
|
||||||
|
bitor(6; 1) = bitor(&110 ; &1) = &111 = 7<br>
|
||||||
|
bitor(6.5; 1.5) = bitor(&110.1 ; &1.1) = &111.1 = 7.5</dd>
|
||||||
|
|
||||||
|
<dt>bitxor(x ; y) or bxor(x ; y)</dt>
|
||||||
|
<dd>Bitwise XOR. For example:<br>
|
||||||
|
bitxor(6; 3) = bitxor(&110 ; &11) = &101 = 5<br>
|
||||||
|
bitxor(6.5; 3.5) = bitxor(&110.1 ; &11.1) = &101.0 = 5</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
64
help/conversions_deg_rad_grad.html
Normal file
64
help/conversions_deg_rad_grad.html
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Conversions between radians, degrees and gradians</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="degtodeg">
|
||||||
|
<param name="Keyword" value="degtorad">
|
||||||
|
<param name="Keyword" value="degtograd">
|
||||||
|
<param name="Keyword" value="radtodeg">
|
||||||
|
<param name="Keyword" value="radtograd">
|
||||||
|
<param name="Keyword" value="gradtorad">
|
||||||
|
<param name="Keyword" value="gradtodeg">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Conversions between radians, degrees and gradians</h2>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>degtodeg(deg; min; sec)</dt>
|
||||||
|
<dd>This function converts degrees from the long format with degrees, minutes and seconds to degrees.<br>
|
||||||
|
For example: degtodeg(12; 30; 0)=12.5</dd>
|
||||||
|
|
||||||
|
<dt>degtorad(deg; min; sec)</dt>
|
||||||
|
<dd>This function converts degrees in the long format (degrees, minutes, seconds) to radians.<br>
|
||||||
|
degtorad(12; 30; 0)=0.218166...</dd>
|
||||||
|
|
||||||
|
<dt>degtograd(deg; min; sec)</dt>
|
||||||
|
<dd>This function converts degrees in the long format (degrees, minutes, seconds) to gradians<br>degtograd(12; 30; 0)=13.888...</dd>
|
||||||
|
|
||||||
|
<dt>degtorad(deg)</dt>
|
||||||
|
<dd>This function converts degrees to radians<br>degtorad(12.5)=0.218166...</dd>
|
||||||
|
|
||||||
|
<dt>degtograd(deg)</dt>
|
||||||
|
<dd>This function converts degrees to gradians<br>degtograd(12.5)=13.8888...</dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>radtodeg(rad)</dt>
|
||||||
|
<dd>This function converts radians to degrees<br>radtodeg(pi)=180</dd>
|
||||||
|
|
||||||
|
<dt>radtograd(rad)</dt>
|
||||||
|
<dd>This function converts radians to gradians<br>radtograd(pi)=200</dd>
|
||||||
|
|
||||||
|
<dt>gradtorad(grad)</dt>
|
||||||
|
<dd>This function converts gradians to radians<br>gradtorad(400)=6.2831....=2*pi</dd>
|
||||||
|
|
||||||
|
<dt>gradtodeg(grad)</dt>
|
||||||
|
<dd>This function converts gradians to degrees<br>gradtodeg(100)=90</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -1,7 +1,7 @@
|
|||||||
[OPTIONS]
|
[OPTIONS]
|
||||||
Auto Index=Yes
|
Auto Index=Yes
|
||||||
Compatibility=1.1 or later
|
Compatibility=1.1 or later
|
||||||
Compiled file=..\..\output\ttcalc.chm
|
Compiled file=ttcalc.chm
|
||||||
Contents file=toc.hhc
|
Contents file=toc.hhc
|
||||||
Default topic=index.html
|
Default topic=index.html
|
||||||
Display compile progress=No
|
Display compile progress=No
|
||||||
@@ -13,12 +13,21 @@ Title=TTCalc
|
|||||||
[FILES]
|
[FILES]
|
||||||
values_and_std_operators.html
|
values_and_std_operators.html
|
||||||
arithmetic_functions.html
|
arithmetic_functions.html
|
||||||
|
bitwise_functions.html
|
||||||
|
conversions_deg_rad_grad.html
|
||||||
|
hyperbolic_functions.html
|
||||||
|
index.html
|
||||||
|
inverse_hyperbolic_functions.html
|
||||||
|
inverse_trigonometric_functions.html
|
||||||
|
logarithm_exponential.html
|
||||||
logical_functions.html
|
logical_functions.html
|
||||||
operators_priority.html
|
operators_priority.html
|
||||||
userfunctions.html
|
other_functions.html
|
||||||
index.html
|
rounding_functions.html
|
||||||
tips.html
|
tips.html
|
||||||
bitwise_functions.html
|
trigonometric_functions.html
|
||||||
|
userfunctions.html
|
||||||
|
accuracy.html
|
||||||
|
|
||||||
[INFOTYPES]
|
[INFOTYPES]
|
||||||
|
|
||||||
|
46
help/hyperbolic_functions.html
Normal file
46
help/hyperbolic_functions.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Hyperbolic functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="sinh">
|
||||||
|
<param name="Keyword" value="cosh">
|
||||||
|
<param name="Keyword" value="tanh">
|
||||||
|
<param name="Keyword" value="tgh">
|
||||||
|
<param name="Keyword" value="coth">
|
||||||
|
<param name="Keyword" value="ctgh">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Hyperbolic functions</h2>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>sinh(x)</dt>
|
||||||
|
<dd>This function returns hyperbolic sine of x<br>sinh(12)=81377.395...</dd>
|
||||||
|
|
||||||
|
<dt>cosh(x)</dt>
|
||||||
|
<dd>Hyperbolic cosine of x<br>cosh(8.5)=2457.384...</dd>
|
||||||
|
|
||||||
|
<dt>tanh(x) or tgh(x)</dt>
|
||||||
|
<dd>Hyperbolic tangent of x<br>tanh(0.67)=0.584...</dd>
|
||||||
|
|
||||||
|
<dt>coth(x) or ctgh(x)</dt>
|
||||||
|
<dd>Hyperbolic cotangent of x<br>coth(1.67)=1.073...</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -7,9 +7,11 @@
|
|||||||
<link rel="stylesheet" href="styles.css" type="text/css">
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
<param name="Keyword" value="TTCalc">
|
<param name="Keyword" value="TTCalc">
|
||||||
|
<param name="Keyword" value="TTMath">
|
||||||
<param name="Keyword" value="author">
|
<param name="Keyword" value="author">
|
||||||
<param name="Keyword" value="contact">
|
<param name="Keyword" value="contact">
|
||||||
<param name="Keyword" value="licence">
|
<param name="Keyword" value="licence">
|
||||||
|
<param name="Keyword" value="interface language">
|
||||||
<param name="Keyword" value="operating systems">
|
<param name="Keyword" value="operating systems">
|
||||||
<param name="Keyword" value="project page">
|
<param name="Keyword" value="project page">
|
||||||
</object>
|
</object>
|
||||||
@@ -20,28 +22,33 @@
|
|||||||
<h1>TTCalc</h1>
|
<h1>TTCalc</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
TTCalc is a mathematical calculator. It has a nice user interface, formulas for
|
TTCalc is an open source bignum mathematical calculator. It features
|
||||||
calculating can be inserted by using a keyboard or a mouse. The result is automatically
|
arithmetical functions, trigonometric functions, inverse trigonometric
|
||||||
shown in a second window without using any additional keys such as 'equal'. The
|
functions, hyperbolic functions, inverse hyperbolic functions, logical
|
||||||
program possess trigonometric functions, inverse trigonometric functions, hyperbolic
|
operators, logarithms, functions for converting between degrees and radians
|
||||||
functions, logical operators, logarithms, functions for converting between degrees and
|
and so on. Additionally the program allows a user to define his own
|
||||||
radians and so on. Additionally the program allows the user to define his own
|
variables and functions.
|
||||||
variables and functions. Calculations are performed by using floating point numbers
|
|
||||||
with three kind of precision, the biggest has 288 bits for its mantissa and 96 bits
|
|
||||||
for its exponent that is about 2.551...e+11925026709067095507636213441 with 85 valid
|
|
||||||
decimal digits. The program independently allows to insert and display values with
|
|
||||||
the base (radix) from two to sixteen.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The program possesses an easy to use interface. Calculations are performed
|
||||||
|
by using binary floating point numbers with three kinds of precision,
|
||||||
|
the biggest has 864 bits for its mantissa and 128 bits for its exponent
|
||||||
|
that is about 6.70897699... * 10^51217599719369681875006054625051616609
|
||||||
|
with 258 valid decimal digits. TTCalc independently allows to insert and
|
||||||
|
display values with the base (radix) from two to sixteen.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr><td>Author:</td><td>Tomasz Sowa</td></tr>
|
<tr><td>Author:</td><td>Tomasz Sowa</td></tr>
|
||||||
<tr><td>Contact:</td><td>t.sowa@slimaczek.pl</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>Licence:</td><td>BSD (open source)</td></tr>
|
||||||
<tr><td>Operating systems:</td><td>Microsoft Windows 9x/Me/NT/2000/XP (Vista was not tested)</td></tr>
|
<tr><td>Interface:</td><td>English, Polish, Spanish, Danish, Chinese, Russian</td></tr>
|
||||||
<tr><td>Interface:</td><td>English, Polish</td></tr>
|
<tr><td>Project page:</td><td><a href="http://ttcalc.sourceforge.net/">http://ttcalc.sourceforge.net/</a></td></tr>
|
||||||
<tr><td>Project page:</td><td><a href="http://sourceforge.net/projects/ttcalc">http://sourceforge.net/projects/ttcalc</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>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
47
help/inverse_hyperbolic_functions.html
Normal file
47
help/inverse_hyperbolic_functions.html
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Inverse hyperbolic functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="asinh">
|
||||||
|
<param name="Keyword" value="acosh">
|
||||||
|
<param name="Keyword" value="atanh">
|
||||||
|
<param name="Keyword" value="atgh">
|
||||||
|
<param name="Keyword" value="acoth">
|
||||||
|
<param name="Keyword" value="actgh">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Inverse hyperbolic functions</h2>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>asinh(x)</dt>
|
||||||
|
<dd>This function returns inverse hyperbolic sine of x<br>asinh(3.6)=1.992...</dd>
|
||||||
|
|
||||||
|
<dt>acosh(x)</dt>
|
||||||
|
<dd>This function returns inverse hyperbolic cosine of x<br>acosh(2.23)=1.440...</dd>
|
||||||
|
|
||||||
|
<dt>atanh(x) or atgh(x)</dt>
|
||||||
|
<dd>This function returns inverse hyperbolic tangent of x<br>atanh(0.67)=0.810...</dd>
|
||||||
|
|
||||||
|
<dt>acoth(x) or actgh(x)</dt>
|
||||||
|
<dd>This function returns inverse hyperbolic cotangent of x<br>acoth(1.23)=1.135...</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
49
help/inverse_trigonometric_functions.html
Normal file
49
help/inverse_trigonometric_functions.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Inverse trigonometric functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="asin">
|
||||||
|
<param name="Keyword" value="acos">
|
||||||
|
<param name="Keyword" value="atan">
|
||||||
|
<param name="Keyword" value="atg">
|
||||||
|
<param name="Keyword" value="acot">
|
||||||
|
<param name="Keyword" value="actg">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Inverse trigonometric functions</h2>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> On the display tab you can select between degrees, radians and gradians. In these samples we assume that the 'rad' option is selected.
|
||||||
|
This affects the output (result) value.</p>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>asin(x)</dt>
|
||||||
|
<dd>Inverse sine (arc sine) of x<br>e.g. asin(0.7)=0.775...</dd>
|
||||||
|
|
||||||
|
<dt>acos(x)</dt>
|
||||||
|
<dd>Inverse cosine (arc cosine) of x<br>acos(0.9)=0.451...</dd>
|
||||||
|
|
||||||
|
<dt>atan(x) or atg(x)</dt>
|
||||||
|
<dd>Inverse tangent (arc tangent) of x<br>atan(3.3)=1.276...</dd>
|
||||||
|
|
||||||
|
<dt>acot(x) or actg(x)</dt>
|
||||||
|
<dd>Inverse cotangent (arc cotangent) of x<br>acot(10)=0.099...</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
39
help/logarithm_exponential.html
Normal file
39
help/logarithm_exponential.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Logarithm and Exponential</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="ln">
|
||||||
|
<param name="Keyword" value="log">
|
||||||
|
<param name="Keyword" value="exp">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
<h2>Logarithm and Exponential</h2>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<dt>ln(x)</dt>
|
||||||
|
<dd>This function calculates the natural logarithm of x,<br>e.g. ln(123)=4.812...</dd>
|
||||||
|
|
||||||
|
<dt>log(x; base)</dt>
|
||||||
|
<dd>This function calculates the logarithm of x with a base equal 'base'<br>
|
||||||
|
It's using the formula: log(x; base) = ln(x) / ln(base)<br>
|
||||||
|
log(123; 4)=3.471...</dd>
|
||||||
|
|
||||||
|
<dt>exp(x)</dt>
|
||||||
|
<dd>This function calculates the exponential function of x<br>exp(20)=e^20=485165195.409...</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<p>Below is a list of operators priority. At the top are operators with higher precedence.</p>
|
<p>Below is a list of operators priority. At the top are operators with higher precedence.</p>
|
||||||
|
|
||||||
<table>
|
<table class="operatorspriority">
|
||||||
<thead>
|
<thead>
|
||||||
<tr><td>Operator</td><td>Description</td><td>Sample</td></tr>
|
<tr><td>Operator</td><td>Description</td><td>Sample</td></tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
<tr><td>- + # &</td><td>unary minus and plus, and operators for changing the base (radix)</td><td>-10</td></tr>
|
<tr><td>- + # &</td><td>unary minus and plus, and operators for changing the base (radix)</td><td>-10</td></tr>
|
||||||
<tr><td>^</td><td>powering</td><td>3^2</td></tr>
|
<tr><td>^</td><td>powering</td><td>3^2</td></tr>
|
||||||
<tr><td>* /</td><td>multiplication and division</td><td>10*20</td></tr>
|
<tr><td>* /</td><td>multiplication and division</td><td>10*20</td></tr>
|
||||||
|
<tr><td>without an operator</td><td>short form of multiplication<br>(only if the second argument is a variable or function,<br>the same priority as a normal multiplication)</td><td>3y</td></tr>
|
||||||
<tr><td>+ -</td><td>addition and subtraction</td><td>10-30</td></tr>
|
<tr><td>+ -</td><td>addition and subtraction</td><td>10-30</td></tr>
|
||||||
<tr><td>== != < > <= >=</td><td>comparative operators</td><td>4<5</td></tr>
|
<tr><td>== != < > <= >=</td><td>comparative operators</td><td>4<5</td></tr>
|
||||||
<tr><td>&&</td><td>logical and</td><td>3>2 && 3<10</td></tr>
|
<tr><td>&&</td><td>logical and</td><td>3>2 && 3<10</td></tr>
|
||||||
|
87
help/other_functions.html
Normal file
87
help/other_functions.html
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Other functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="sqrt">
|
||||||
|
<param name="Keyword" value="root">
|
||||||
|
<param name="Keyword" value="factorial">
|
||||||
|
<param name="Keyword" value="abs">
|
||||||
|
<param name="Keyword" value="sgn">
|
||||||
|
<param name="Keyword" value="mod">
|
||||||
|
<param name="Keyword" value="max">
|
||||||
|
<param name="Keyword" value="min">
|
||||||
|
<param name="Keyword" value="sum">
|
||||||
|
<param name="Keyword" value="avg">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Other functions</h2>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>sqrt(x)</dt>
|
||||||
|
<dd>Sqrt returns the square root of x<br>sqrt(9)=3</dd>
|
||||||
|
|
||||||
|
<dt>root(x ; n)</dt>
|
||||||
|
<dd>The nth root of a 'x', 'n' must be integer and not negative, if 'n' is zero the result is one,
|
||||||
|
if 'x' is zero the result is zero and we assume that the root(0;0) is not defined, e.g.<br>
|
||||||
|
root(8;3)=2<br>
|
||||||
|
root(-8;3)=-2
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>factorial(x)</dt>
|
||||||
|
<dd>The factorial function<br>factorial(6)=1*2*3*4*5*6=720</dd>
|
||||||
|
|
||||||
|
<dt>abs(x)</dt>
|
||||||
|
<dd>The absolute value of x<br>abs(-10)=10</dd>
|
||||||
|
|
||||||
|
<dt>sgn(x)</dt>
|
||||||
|
<dd>This function returns the sign of x that means when the x is positive the result is 1, when the x is negative
|
||||||
|
the result is -1 and when the x is zero the result is zero too<br>
|
||||||
|
sgn(-10)=-1<br>
|
||||||
|
sgn(0)=0<br>
|
||||||
|
sgn(5)=1</dd>
|
||||||
|
|
||||||
|
<dt>mod(x ; y)</dt>
|
||||||
|
<dd>Mod returns the remainder from the division x by y<br>mod(10; 2.2)=1.2 because 10=2.2*4 + 1.2</dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>max(x1; x2; ...)</dt>
|
||||||
|
<dd>This functions takes any number of arguments. It returns the max value of them. If there aren't arguments
|
||||||
|
the function returns the max value which can be held in this precision.<br>
|
||||||
|
max(2;5;8;3)=8<br>
|
||||||
|
max()=6.97846825730330952352039893e+646457021 (assuming the small precision is selected)</dd>
|
||||||
|
|
||||||
|
<dt>min(x1; x2; ...)</dt>
|
||||||
|
<dd>This functions takes any number of arguments. It returns the min value of them. If there aren't arguments
|
||||||
|
the function returns the min value which can be held in this precision.<br>
|
||||||
|
min(45;-23;18;19)=-23<br>
|
||||||
|
min()=-6.97846825730330952352039893e+646457021 (assuming the small precision is selected)
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>sum(x1; x2; ...)</dt>
|
||||||
|
<dd>This functions takes one or more arguments. It returns the sum of them.<br>
|
||||||
|
sum(4;2;9;3)=18
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>avg(x1; x2; ...)</dt>
|
||||||
|
<dd>This functions takes one or more arguments. It returns the arithmetic mean. (The sum divided by
|
||||||
|
the number of arguments)<br>
|
||||||
|
avg(4;2;9;3)=4.5
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
67
help/rounding_functions.html
Normal file
67
help/rounding_functions.html
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Rounding functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="int">
|
||||||
|
<param name="Keyword" value="round">
|
||||||
|
<param name="Keyword" value="ceil">
|
||||||
|
<param name="Keyword" value="floor">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Rounding functions</h2>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>int(x)</dt>
|
||||||
|
<dd>This method returns only the integer part of x.<br>
|
||||||
|
int(2.8)=2<br>
|
||||||
|
int(2.2)=2<br>
|
||||||
|
int(2)=2<br>
|
||||||
|
int(-4.1)=-4<br>
|
||||||
|
int(-4.8)=-4<br>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>round(x)</dt>
|
||||||
|
<dd>This method rounds the value of x to the nearest integer<br>
|
||||||
|
round(2.8)=3<br>
|
||||||
|
round(2.2)=2<br>
|
||||||
|
round(2)=2<br>
|
||||||
|
round(-4.1)=-4<br>
|
||||||
|
round(-4.8)=-5</dd>
|
||||||
|
|
||||||
|
<dt>ceil(x)</dt>
|
||||||
|
<dd>This function returns a value representing the smallest integer that is greater than or equal to x<br>
|
||||||
|
ceil(2.8)=3<br>
|
||||||
|
ceil(2.2)=3<br>
|
||||||
|
ceil(2)=2<br>
|
||||||
|
ceil(-4.1)=-4<br>
|
||||||
|
ceil(-4.8)=-4</dd>
|
||||||
|
|
||||||
|
<dt>floor(x)</dt>
|
||||||
|
<dd>This function returns a value representing the largest integer that is less than or equal to x<br>
|
||||||
|
floor(2.8)=2<br>
|
||||||
|
floor(2.2)=2<br>
|
||||||
|
floor(2)=2<br>
|
||||||
|
floor(-4.1)=-5<br>
|
||||||
|
floor(-4.8)=-5</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -7,23 +7,33 @@ padding: 0;
|
|||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: Tahoma, Arial, Sans-serif;
|
font-family: Verdana, Tahoma, Arial, Sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0 0 20px 20px;
|
margin: 0 20px 20px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
font-family: Arial, Tahoma, Sans-serif;
|
font-family: Arial, Tahoma, Verdana, Sans-serif;
|
||||||
margin: 1.4em 0 1em 0;
|
margin: 1.4em 0 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-family: Arial, Tahoma, Verdana, Sans-serif;
|
||||||
|
margin: 2em 0 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 1em 0 1em 0;
|
margin: 1em 0 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dl {
|
||||||
|
margin: 3em 0 3em 0;
|
||||||
|
}
|
||||||
|
|
||||||
dt {
|
dt {
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
@@ -42,7 +52,27 @@ td {
|
|||||||
padding: 0 2em 0 0;
|
padding: 0 2em 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.operatorspriority {
|
||||||
|
border: 1px solid black;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
table.operatorspriority td {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 0.5em 0.5em 0.5em 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ul.tips {
|
||||||
|
list-style-type: disc;
|
||||||
|
margin-left: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.tips li {
|
||||||
|
padding: 1em 0 1em 0;
|
||||||
|
}
|
||||||
|
@@ -11,6 +11,8 @@
|
|||||||
<param name="Keyword" value="#">
|
<param name="Keyword" value="#">
|
||||||
<param name="Keyword" value="&">
|
<param name="Keyword" value="&">
|
||||||
<param name="Keyword" value="global semicolon">
|
<param name="Keyword" value="global semicolon">
|
||||||
|
<param name="Keyword" value="CTRL+C">
|
||||||
|
<param name="Keyword" value="CTRL+V">
|
||||||
</object>
|
</object>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -18,22 +20,36 @@
|
|||||||
|
|
||||||
<h1>Tips</h1>
|
<h1>Tips</h1>
|
||||||
|
|
||||||
<p>
|
<ul class="tips">
|
||||||
If you want to clear the input edit or if you want to put something in and the focus is
|
<li>
|
||||||
somewhere on the tabs just type ESC, the entire edit will be selected and have a focus.
|
If you want to clear the input edit or if you want to put something in and the focus is not on the first edit — just type ESC,
|
||||||
</p>
|
the entire edit will be selected and have a focus.
|
||||||
|
</li>
|
||||||
|
|
||||||
<p>
|
<li>
|
||||||
If you want to insert a value with a base (radix) 2 or 16 use the unary operator & (for the base 2)
|
If you want to insert a value with a base (radix) 2 or 16 use the unary operator & (for the base 2)
|
||||||
or # (for the base 16).
|
or # (for the base 16).
|
||||||
For example &10=2 (decimal), #10=16 (decimal). When you're using these operators
|
For example &10=2 (decimal), #10=16 (decimal). When you're using these operators
|
||||||
then 'input' mode on the 'display' tab is ignored.
|
then 'input' mode on the 'display' tab is ignored.
|
||||||
</p>
|
</li>
|
||||||
|
|
||||||
<p>
|
<li>
|
||||||
You can calculate more than one formula at the same time. To achive this use a semicolon
|
You can calculate more than one formula at the same time. To achive this use a semicolon
|
||||||
in the global space, for example type '2+4 ; 5*10' and the result will be '6 50'.
|
in the global space, for example type '2+4 ; 5*10' and the result will be '6 50'.
|
||||||
</p>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
You can use CTRL+C to copy the result from the output edit into the clipboard
|
||||||
|
(if a control which has a focus is not an edit control, or if it is an edit but
|
||||||
|
has no selection)
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
Also you can use CTRL+V to paste a text from the clipboard into the input control
|
||||||
|
(if a control which has a focus is not an edit control)
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
38
help/toc.hhc
38
help/toc.hhc
@@ -21,6 +21,40 @@
|
|||||||
<param name="Name" value="Arithmetic functions">
|
<param name="Name" value="Arithmetic functions">
|
||||||
<param name="Local" value="arithmetic_functions.html">
|
<param name="Local" value="arithmetic_functions.html">
|
||||||
</OBJECT>
|
</OBJECT>
|
||||||
|
<UL>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Logarithm and Exponential">
|
||||||
|
<param name="Local" value="logarithm_exponential.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Trigonometric functions">
|
||||||
|
<param name="Local" value="trigonometric_functions.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Inverse trigonometric functions">
|
||||||
|
<param name="Local" value="inverse_trigonometric_functions.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Hyperbolic functions">
|
||||||
|
<param name="Local" value="hyperbolic_functions.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Inverse hyperbolic functions">
|
||||||
|
<param name="Local" value="inverse_hyperbolic_functions.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Conversions between radians, degrees and gradians">
|
||||||
|
<param name="Local" value="conversions_deg_rad_grad.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Rounding functions">
|
||||||
|
<param name="Local" value="rounding_functions.html">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Other functions">
|
||||||
|
<param name="Local" value="other_functions.html">
|
||||||
|
</OBJECT>
|
||||||
|
</UL>
|
||||||
<LI> <OBJECT type="text/sitemap">
|
<LI> <OBJECT type="text/sitemap">
|
||||||
<param name="Name" value="Logical operators and functions">
|
<param name="Name" value="Logical operators and functions">
|
||||||
<param name="Local" value="logical_functions.html">
|
<param name="Local" value="logical_functions.html">
|
||||||
@@ -37,6 +71,10 @@
|
|||||||
<param name="Name" value="Operators priority">
|
<param name="Name" value="Operators priority">
|
||||||
<param name="Local" value="operators_priority.html">
|
<param name="Local" value="operators_priority.html">
|
||||||
</OBJECT>
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Name" value="Accuracy">
|
||||||
|
<param name="Local" value="accuracy.html">
|
||||||
|
</OBJECT>
|
||||||
<LI> <OBJECT type="text/sitemap">
|
<LI> <OBJECT type="text/sitemap">
|
||||||
<param name="Name" value="Tips">
|
<param name="Name" value="Tips">
|
||||||
<param name="Local" value="tips.html">
|
<param name="Local" value="tips.html">
|
||||||
|
48
help/trigonometric_functions.html
Normal file
48
help/trigonometric_functions.html
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>TTCalc - Trigonometric functions</title>
|
||||||
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
|
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||||
|
<param name="Keyword" value="sin">
|
||||||
|
<param name="Keyword" value="cos">
|
||||||
|
<param name="Keyword" value="tan">
|
||||||
|
<param name="Keyword" value="tg">
|
||||||
|
<param name="Keyword" value="cot">
|
||||||
|
<param name="Keyword" value="ctg">
|
||||||
|
</object>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Arithmetic functions</h1>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> If a function takes more than one argument, the arguments are separated with semicolon ';'.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Trigonometric functions</h2>
|
||||||
|
|
||||||
|
<p><strong>Note:</strong> On the display tab you can select between degrees, radians and gradians. In these samples we assume that the 'rad' option is selected.
|
||||||
|
This affects the input value.</p>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
<dt>sin(x)</dt>
|
||||||
|
<dd>This function returns the sine of x.<br>For example sin(0.8)=0.717...</dd>
|
||||||
|
|
||||||
|
<dt>cos(x)</dt>
|
||||||
|
<dd>Cosine of x<br>cos(1.3)=0.267...</dd>
|
||||||
|
|
||||||
|
<dt>tan(x) or tg(x)</dt>
|
||||||
|
<dd>Tangent of x<br>tan(3.6)=0.493...</dd>
|
||||||
|
|
||||||
|
<dt>cot(x) or ctg(x)</dt>
|
||||||
|
<dd>Cotangent of x<br>cot(2.3)=-0.893...</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -16,19 +16,24 @@
|
|||||||
<h1>User defined variables and functions</h1>
|
<h1>User defined variables and functions</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
You are allowed to define your own variables and functions. As a name of a variable or a function
|
You are allowed to define your own variables and functions. As a name of a variable or function
|
||||||
can be a name consists of letters and digits but the first character must be a letter. Names are case-insensitive
|
can be a name consists of letters, digits or an underline character (only the first character must be a letter).
|
||||||
that means 'name' is the same as 'NaMe'. For example these
|
From version 0.8.3 names are case-sensitive that means 'name' is not the same as 'NaMe'. For example these
|
||||||
are correct names: a, b, c3, myname, etc. During defining variables and functions you can call another
|
are correct names: a, b, c3, MyName. During defining variables and functions you can call another
|
||||||
variables and functions but you cannot call a variable or a function twice. Recurrence calling are not allowed.
|
variables and functions.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Functions can get maximum 9 parameters. You have to specify how many parameters your function takes and
|
Functions can get maximum 9 parameters. You have to specify how many parameters your function takes and
|
||||||
you can refer to them by using the variable 'x' with a number from 1 to 9 ('x' without a number means 'x1').
|
you can refer to them by using the variable 'x' with a number from 1 to 9 ('x' without a number means 'x1').
|
||||||
For example you can define a function 'xy' as 'x1*x2' (of course without apostrophes), set the 'parameters' on 2
|
For example you can define a function 'xy' as 'x1*x2' (of course without apostrophes), set the 'parameters' to '2'
|
||||||
and then put into the edit box an expression 'xy(10;20)', the result will be 200. Note that we use a semicolon
|
and then put into the edit box expression 'xy(10;20)', the result will be '200'. Note that we use a semicolon
|
||||||
to separate arguments in a function.
|
to separate arguments in the function.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
More complex example: myfunction(x) which returns sin(x) when the x is negative, 0 when the x is 0, and cos(x) when the x is greater than 0: <br>
|
||||||
|
myfunction(x)='if(x==0; 0; if(x<0; sin(x); cos(x)))'
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@@ -12,11 +12,14 @@
|
|||||||
<param name="Keyword" value="standard operators">
|
<param name="Keyword" value="standard operators">
|
||||||
<param name="Keyword" value="builtin variables">
|
<param name="Keyword" value="builtin variables">
|
||||||
<param name="Keyword" value="e">
|
<param name="Keyword" value="e">
|
||||||
|
<param name="Keyword" value="pi">
|
||||||
<param name="Keyword" value="^">
|
<param name="Keyword" value="^">
|
||||||
<param name="Keyword" value="*">
|
<param name="Keyword" value="*">
|
||||||
<param name="Keyword" value="/">
|
<param name="Keyword" value="/">
|
||||||
<param name="Keyword" value="+">
|
<param name="Keyword" value="+">
|
||||||
<param name="Keyword" value="-">
|
<param name="Keyword" value="-">
|
||||||
|
<param name="Keyword" value="#">
|
||||||
|
<param name="Keyword" value="&">
|
||||||
</object>
|
</object>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -24,31 +27,41 @@
|
|||||||
|
|
||||||
<h1>Numbers</h1>
|
<h1>Numbers</h1>
|
||||||
|
|
||||||
You can type numbers directly using a keyboard or insert them by a mouse. This is a simple edit window,
|
<p>
|
||||||
you can use arrow keys etc. and copy&paste a text by using standard shortcuts such as CTRL+C and CTRL+V.
|
You can type numbers directly using your keyboard or insert them by a mouse. This is a simple edit window,
|
||||||
As the decimal point can be either a comma or a dot that means 1,234 is the same as 1.234.
|
you can use arrow keys etc. and copy&paste text by using standard shortcuts such as CTRL+C and CTRL+V.
|
||||||
|
Decimal point can be either a comma or a dot that means 1,234 is the same as 1.234.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h1>Standard operators</h1>
|
<h1>Standard operators</h1>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>^</dt>
|
<dt>^</dt>
|
||||||
<dd>Powering</dd>
|
<dd>Powering, e.g.: 2^3=8</dd>
|
||||||
|
|
||||||
<dt>*</dt>
|
<dt>*</dt>
|
||||||
<dd>Multiplication</dd>
|
<dd>Multiplication, e.g.: 2*3=6</dd>
|
||||||
|
|
||||||
<dt>/</dt>
|
<dt>/</dt>
|
||||||
<dd>Division</dd>
|
<dd>Division, e.g.: 2/3 = 0.6666...</dd>
|
||||||
|
|
||||||
<dt>+</dt>
|
<dt>+</dt>
|
||||||
<dd>Addition</dd>
|
<dd>Addition, e.g.: 2+3=5<br>
|
||||||
|
Unary plus, e.g.: +2</dd>
|
||||||
|
|
||||||
<dt>-</dt>
|
<dt>-</dt>
|
||||||
<dd>Subtraction</dd>
|
<dd>Subtraction, e.g.: 2-3=-1<br>
|
||||||
|
Unary minus, e.g.: -2</dd>
|
||||||
|
|
||||||
|
<dt>#</dt>
|
||||||
|
<dd>Operator for changing the base (radix) to 16 (hex), e.g.: #ff=255</dd>
|
||||||
|
|
||||||
|
<dt>&</dt>
|
||||||
|
<dd>Operator for changing the base (radix) to 2 (bin), e.g.: -&110=-6</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p>Of course you can use the parentheses ( and ). Look at the <a href="operators_priority.html">operators priority</a> as well.</p>
|
<p>Of course you can use parentheses ( and ). Look at <a href="operators_priority.html">operators priority</a> as well.</p>
|
||||||
|
|
||||||
<h1>Built-in variables</h1>
|
<h1>Built-in variables</h1>
|
||||||
|
|
||||||
|
BIN
res/icon02.ico
Normal file
BIN
res/icon02.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2006-2007, Tomasz Sowa
|
Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
@@ -3,34 +3,46 @@
|
|||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppName=TTCalc
|
AppName=TTCalc
|
||||||
AppVerName=TTCalc 0.8.1
|
AppVerName=TTCalc 0.8.6
|
||||||
|
AppVersion=0.8.6
|
||||||
AppPublisher=Tomasz Sowa
|
AppPublisher=Tomasz Sowa
|
||||||
AppPublisherURL=http://sourceforge.net/projects/ttcalc
|
AppPublisherURL=http://ttcalc.sourceforge.net
|
||||||
AppSupportURL=http://sourceforge.net/projects/ttcalc
|
AppSupportURL=http://ttcalc.sourceforge.net
|
||||||
AppUpdatesURL=http://sourceforge.net/projects/ttcalc
|
AppUpdatesURL=http://ttcalc.sourceforge.net
|
||||||
DefaultDirName={pf}\TTCalc
|
DefaultDirName={pf}\TTCalc
|
||||||
DefaultGroupName=TTCalc
|
DefaultGroupName=TTCalc
|
||||||
AllowNoIcons=yes
|
AllowNoIcons=yes
|
||||||
|
; special COPYRIGHT version (without a new line characters in the clause -- it is better displayed in the setup window)
|
||||||
LicenseFile=COPYRIGHT
|
LicenseFile=COPYRIGHT
|
||||||
OutputDir=..\..\output_setup
|
OutputDir=..\setup
|
||||||
OutputBaseFilename=ttcalc-setup
|
OutputBaseFilename=ttcalc-setup
|
||||||
Compression=lzma
|
Compression=lzma
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
|
ShowUndisplayableLanguages=yes
|
||||||
|
PrivilegesRequired=none
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
|
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
|
||||||
|
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
|
||||||
|
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
|
||||||
|
Name: "chinese"; MessagesFile: "compiler:Languages\ChineseSimp-12-5.1.11.isl"
|
||||||
|
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
|
||||||
|
|
||||||
|
[InstallDelete]
|
||||||
|
; prior to 0.8.3 we were using mingwm10.dll (now it is not needed and will be deleted if exists)
|
||||||
|
Type: files; Name: "{app}\mingwm10.dll"
|
||||||
|
|
||||||
[Tasks]
|
[Tasks]
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\..\output\ttcalc.exe"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\src\ttcalc.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\..\output\mingwm10.dll"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\help\ttcalc.chm"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\..\output\ttcalc.chm"; DestDir: "{app}"; Flags: ignoreversion
|
|
||||||
Source: "..\COPYRIGHT"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\COPYRIGHT"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "ttcalc.ini"; DestDir: "{userappdata}\TTCalc"; Flags: onlyifdoesntexist
|
Source: "..\CHANGELOG"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "..\README"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
; now we do not use *.ini file in the installer
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
|
@@ -1,21 +0,0 @@
|
|||||||
# the configuration file of the program ttcalc
|
|
||||||
|
|
||||||
[GLOBAL]
|
|
||||||
always.on.top = 0
|
|
||||||
view = 0
|
|
||||||
maximized = 0
|
|
||||||
x = 0
|
|
||||||
y = 0
|
|
||||||
size.x = 402
|
|
||||||
size.y = 288
|
|
||||||
precision = 0
|
|
||||||
disp.input = 10
|
|
||||||
disp.output = 10
|
|
||||||
language = 0
|
|
||||||
disp.alw.scientific = 0
|
|
||||||
disp.when.scientific = 15
|
|
||||||
disp.rounding = -2
|
|
||||||
|
|
||||||
[variables]
|
|
||||||
|
|
||||||
[functions]
|
|
43
src/Makefile
43
src/Makefile
@@ -1,40 +1,43 @@
|
|||||||
CC = g++
|
CC = g++
|
||||||
o = resource.o calculation.o functions.o iniparser.o languages.o mainwindow.o parsermanager.o programresources.o tabs.o variables.o winmain.o
|
#CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath -DTTCALC_CONVERT
|
||||||
CFLAGS = -Wall -pedantic -s -O2 -mwindows -mthreads -I../../../ttmath
|
CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath
|
||||||
name = ttcalc.exe
|
name = ttcalc.exe
|
||||||
dir_output = ../../output
|
|
||||||
|
|
||||||
|
# the name of the help is also set in the html help workshop project file
|
||||||
|
helpname = ttcalc.chm
|
||||||
|
|
||||||
|
# the name of the setup is also set in the Inno Setup config file
|
||||||
|
setupname = ttcalc-setup.exe
|
||||||
|
|
||||||
.SUFFIXES: .cpp .o
|
|
||||||
|
|
||||||
.cpp.o:
|
|
||||||
$(CC) -c $(CFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
all: ttcalc
|
all: ttcalc
|
||||||
|
|
||||||
|
|
||||||
|
include Makefile.dep
|
||||||
|
|
||||||
|
|
||||||
ttcalc: $(o)
|
ttcalc: $(o)
|
||||||
$(CC) -o $(dir_output)/$(name) $(CFLAGS) $(o) -lcomctl32
|
$(CC) -o $(name) $(CFLAGS) $(o) -lcomctl32
|
||||||
|
|
||||||
|
|
||||||
resource.o: resource.rc
|
resource.o: resource.rc
|
||||||
|
#windres -DTTCALC_CONVERT resource.rc resource.o
|
||||||
windres resource.rc resource.o
|
windres resource.rc resource.o
|
||||||
|
|
||||||
calculation.o: calculation.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h tabs.h messages.h
|
|
||||||
functions.o: functions.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
help: $(helpdep)
|
||||||
iniparser.o: iniparser.cpp compileconfig.h iniparser.h
|
Makefile.help.sh
|
||||||
languages.o: languages.cpp compileconfig.h languages.h
|
|
||||||
mainwindow.o: mainwindow.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h resource.h messages.h tabs.h
|
|
||||||
parsermanager.o: parsermanager.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
|
||||||
programresources.o: programresources.cpp compileconfig.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
setup: $(setupdep)
|
||||||
tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
iscc ../setup/innosetup.iss
|
||||||
variables.o: variables.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
|
||||||
winmain.o: winmain.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h resource.h messages.h tabs.h
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
rm -f *.s
|
rm -f $(name)
|
||||||
rm -f $(dir_output)/$(name)
|
rm -f ttcalcp.exe
|
||||||
|
rm -f ../help/$(helpname)
|
||||||
|
rm -f ../setup/$(setupname)
|
||||||
|
45
src/Makefile.dep
Normal file
45
src/Makefile.dep
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
o = resource.o calculation.o convert.o functions.o iniparser.o languages.o mainwindow.o parsermanager.o programresources.o tabs.o variables.o winmain.o
|
||||||
|
|
||||||
|
calculation.o: calculation.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h
|
||||||
|
convert.o: convert.cpp convert.h compileconfig.h bigtypes.h
|
||||||
|
functions.o: functions.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h
|
||||||
|
iniparser.o: iniparser.cpp compileconfig.h iniparser.h
|
||||||
|
languages.o: languages.cpp compileconfig.h languages.h bigtypes.h
|
||||||
|
mainwindow.o: mainwindow.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h
|
||||||
|
parsermanager.o: parsermanager.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h
|
||||||
|
programresources.o: programresources.cpp compileconfig.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h
|
||||||
|
tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h
|
||||||
|
variables.o: variables.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h
|
||||||
|
winmain.o: winmain.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h
|
||||||
|
|
||||||
|
|
||||||
|
.SUFFIXES: .cpp .o
|
||||||
|
|
||||||
|
.cpp.o:
|
||||||
|
$(CC) -c $(CFLAGS) $<
|
||||||
|
|
||||||
|
|
||||||
|
helpdep = ../help/accuracy.html \
|
||||||
|
../help/arithmetic_functions.html \
|
||||||
|
../help/bitwise_functions.html \
|
||||||
|
../help/conversions_deg_rad_grad.html \
|
||||||
|
../help/help.hhp \
|
||||||
|
../help/hyperbolic_functions.html \
|
||||||
|
../help/index.hhk \
|
||||||
|
../help/index.html \
|
||||||
|
../help/inverse_hyperbolic_functions.html \
|
||||||
|
../help/inverse_trigonometric_functions.html \
|
||||||
|
../help/logarithm_exponential.html \
|
||||||
|
../help/logical_functions.html \
|
||||||
|
../help/operators_priority.html \
|
||||||
|
../help/other_functions.html \
|
||||||
|
../help/rounding_functions.html \
|
||||||
|
../help/styles.css \
|
||||||
|
../help/tips.html \
|
||||||
|
../help/toc.hhc \
|
||||||
|
../help/trigonometric_functions.html \
|
||||||
|
../help/userfunctions.html \
|
||||||
|
../help/values_and_std_operators.html
|
||||||
|
|
||||||
|
|
||||||
|
setupdep = ttcalc help ../setup/innosetup.iss ../setup/COPYRIGHT ../COPYRIGHT ../CHANGELOG ../README
|
16
src/Makefile.help.sh
Normal file
16
src/Makefile.help.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# we provide a small wrapper for Html Help Workshop because the Html HW returns 1 when
|
||||||
|
# it has compiled the help and the 'make' program then stops
|
||||||
|
|
||||||
|
hhc ../help/help.hhp
|
||||||
|
|
||||||
|
if [ $? == 0 ]
|
||||||
|
then
|
||||||
|
# there was an error
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# there was a success
|
||||||
|
|
||||||
|
exit 0
|
21
src/Makefileportable
Normal file
21
src/Makefileportable
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
CC = g++
|
||||||
|
CFLAGS = -Wall -pedantic -s -Os -fno-default-inline -mwindows -I../../ttmath -DTTCALC_PORTABLE
|
||||||
|
name = ttcalcp.exe
|
||||||
|
compressor = upx
|
||||||
|
|
||||||
|
all: ttcalc
|
||||||
|
|
||||||
|
include Makefile.dep
|
||||||
|
|
||||||
|
ttcalc: $(o)
|
||||||
|
$(CC) -o $(name) $(CFLAGS) $(o) -lcomctl32
|
||||||
|
$(compressor) -7 $(name)
|
||||||
|
|
||||||
|
resource.o: resource.rc
|
||||||
|
windres -DTTCALC_PORTABLE resource.rc resource.o
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o
|
||||||
|
rm -f $(name)
|
||||||
|
rm -f ../help/$(helpname)
|
||||||
|
|
75
src/bigtypes.h
Normal file
75
src/bigtypes.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* 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-2009, 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 bigtypesheader
|
||||||
|
#define bigtypesheader
|
||||||
|
|
||||||
|
#include "compileconfig.h"
|
||||||
|
|
||||||
|
//#define TTMATH_RELEASE
|
||||||
|
#include <ttmath/ttmath.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
|
/*
|
||||||
|
// old ones
|
||||||
|
ttmath::Big<1,3>
|
||||||
|
ttmath::Big<2,6>
|
||||||
|
ttmath::Big<3,9>
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef ttmath::Big<1,3> TTMathBig1;
|
||||||
|
typedef ttmath::Big<2,9> TTMathBig2;
|
||||||
|
typedef ttmath::Big<4,27> TTMathBig3;
|
||||||
|
typedef TTMathBig3 TTMathBigMax;
|
||||||
|
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* portable */
|
||||||
|
|
||||||
|
typedef ttmath::Big<1,3> TTMathBig1;
|
||||||
|
typedef TTMathBig1 TTMathBigMax;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -65,6 +65,9 @@ unsigned __stdcall CalculationsProcedure(void *)
|
|||||||
SetDlgItemText(main_window, IDC_OUTPUT_EDIT, "");
|
SetDlgItemText(main_window, IDC_OUTPUT_EDIT, "");
|
||||||
PostMessage(main_window, WM_SET_LAST_ERROR, (WPARAM)ttmath::err_still_calculating, 0);
|
PostMessage(main_window, WM_SET_LAST_ERROR, (WPARAM)ttmath::err_still_calculating, 0);
|
||||||
|
|
||||||
|
// we're showing info about converting
|
||||||
|
parser_manager.ShowConvertingInfo();
|
||||||
|
|
||||||
// and finally we're parsing the input string
|
// and finally we're parsing the input string
|
||||||
parser_manager.Parse();
|
parser_manager.Parse();
|
||||||
|
|
||||||
@@ -74,7 +77,10 @@ unsigned __stdcall CalculationsProcedure(void *)
|
|||||||
// at the end we're printing the result
|
// at the end we're printing the result
|
||||||
// if there was a stop signal we continue the main loop without printing any values
|
// if there was a stop signal we continue the main loop without printing any values
|
||||||
if( ! GetPrgRes()->GetThreadController()->WasStopSignal() )
|
if( ! GetPrgRes()->GetThreadController()->WasStopSignal() )
|
||||||
parser_manager.PrintResult();
|
if( parser_manager.PrintResult() )
|
||||||
|
PostMessage(main_window, WM_SET_LAST_ERROR, (WPARAM)parser_manager.GetLastCode(), 0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
*/
|
*/
|
||||||
#define TTCALC_MAJOR_VER 0
|
#define TTCALC_MAJOR_VER 0
|
||||||
#define TTCALC_MINOR_VER 8
|
#define TTCALC_MINOR_VER 8
|
||||||
#define TTCALC_REVISION_VER 1
|
#define TTCALC_REVISION_VER 6
|
||||||
#define TTCALC_PRERELEASE_VER 0
|
#define TTCALC_PRERELEASE_VER 0
|
||||||
|
|
||||||
|
|
||||||
@@ -68,6 +68,8 @@
|
|||||||
#pragma warning (disable : 4800)
|
#pragma warning (disable : 4800)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32_IE
|
||||||
#define _WIN32_IE 0x0501
|
#define _WIN32_IE 0x0501
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
444
src/convert.cpp
Normal file
444
src/convert.cpp
Normal file
@@ -0,0 +1,444 @@
|
|||||||
|
/*
|
||||||
|
* 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-2009, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "convert.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Convert::Convert()
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
current_conv_type = 0;
|
||||||
|
CheckCurrentUnits();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::AddType(const char * name)
|
||||||
|
{
|
||||||
|
if( type_tab.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Type temp;
|
||||||
|
temp.name = name;
|
||||||
|
|
||||||
|
type_tab.back().push_back(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::AddUnit(const char * name, const char * abbr, int numerator, int denominator)
|
||||||
|
{
|
||||||
|
if( type_tab.empty() || type_tab.back().empty() || unit_tab.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit temp;
|
||||||
|
temp.name = name;
|
||||||
|
|
||||||
|
if( abbr != 0 )
|
||||||
|
temp.abbr = abbr;
|
||||||
|
|
||||||
|
|
||||||
|
temp.type = int(type_tab.back().size()-1);
|
||||||
|
|
||||||
|
|
||||||
|
temp.value_numerator.FromInt(numerator);
|
||||||
|
|
||||||
|
if( denominator != 1 )
|
||||||
|
{
|
||||||
|
// value_denominator is set into one (default)
|
||||||
|
temp.value_denominator.FromInt(denominator);
|
||||||
|
}
|
||||||
|
|
||||||
|
unit_tab.back().push_back(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::AddUnit(const char * name, const char * abbr, const char * v)
|
||||||
|
{
|
||||||
|
if( type_tab.empty() || type_tab.back().empty() || unit_tab.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit temp;
|
||||||
|
temp.name = name;
|
||||||
|
temp.abbr = abbr;
|
||||||
|
temp.type = int(type_tab.back().size()-1);
|
||||||
|
temp.value_numerator.FromString(v, 16);
|
||||||
|
|
||||||
|
unit_tab.back().push_back(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::Init()
|
||||||
|
{
|
||||||
|
// en
|
||||||
|
type_tab.push_back( std::vector<Type>() );
|
||||||
|
unit_tab.push_back( std::vector<Unit>() );
|
||||||
|
|
||||||
|
AddType("none");
|
||||||
|
|
||||||
|
/*
|
||||||
|
yard = 0.9144 metre
|
||||||
|
foot = 1/3 yard = 0.3048 metre
|
||||||
|
inch = 1/36 yard = 1/12 foot = 0.0254 metre
|
||||||
|
|
||||||
|
In 1958 the United States and countries of the Commonwealth of Nations
|
||||||
|
defined the length of the international yard to be precisely 0.9144 metres.
|
||||||
|
|
||||||
|
1 point (Didot's system) = 1 / 2660 m
|
||||||
|
1 point (pica - USA and UK) = 1 / 72 inch
|
||||||
|
*/
|
||||||
|
AddType("length"); // base: 10000 metre
|
||||||
|
AddUnit("inch", "in", 254);
|
||||||
|
AddUnit("foot", "ft", 3048);
|
||||||
|
AddUnit("yard", "yd", 9144);
|
||||||
|
AddUnit("metre", "m", 10000);
|
||||||
|
AddUnit("mile (land)", "mi", 16093440); // 1 land mile = 1609.344 metres
|
||||||
|
AddUnit("mile (nautical)", "nmi", 18520000); // 1 nautical mile = 1852 metres
|
||||||
|
AddUnit("point (Didot)", "p", 10000, 2660);
|
||||||
|
AddUnit("point (pica)", "p", 18288, 5184);
|
||||||
|
AddUnit("light year", "ly", "520F0AA65AAEBAC00"); // 1 ly = 9 460 730 472 580 800 metres
|
||||||
|
// 520F0AA65AAEBAC00 (hex) = 94607304725808000000 (dec)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
yard^2 = 0.83612736 metre^2
|
||||||
|
foot^2 = 1/9 yard^2 = 0.09290304 metre^2
|
||||||
|
inch^2 = 1/1296 yard^2 = 1/144 foot^ = 0.00064516 metre^2
|
||||||
|
|
||||||
|
ar = 100 metre^2
|
||||||
|
hectere = 10000 metre^2
|
||||||
|
*/
|
||||||
|
|
||||||
|
// !!! give a smaller base here
|
||||||
|
AddType("area"); // base: 100 000 000 metre^2
|
||||||
|
AddUnit("inch^2", "in^2", 64516);
|
||||||
|
AddUnit("foot^2", "ft^2", 9290304);
|
||||||
|
AddUnit("yard^2", "yd^2", 83612736);
|
||||||
|
AddUnit("metre^2", "m^2", 100000000);
|
||||||
|
AddUnit("are", "a", "2540BE400"); // 10000000000 (dec)
|
||||||
|
AddUnit("hectare", "ha", "E8D4A51000"); // 1000000000000 (dec)
|
||||||
|
AddUnit("mile (land)^2", "mi^2", "EB8EDC210000" ); // 258998811033600 (dec), 1 land mile^2 = 2589988.110336 metres^2
|
||||||
|
AddUnit("mile (nautical)^2", "nmi^2", "137F2ACF41000"); // 342990400000000 (dec), 1 nautical mile^2 = 3429904 metres^2
|
||||||
|
AddUnit("light year^2", "ly^2", "1A4DA3B4D207FB4C43D08391653B900000"); // 1 ly = 89505421074818927300612528640000 metres^2
|
||||||
|
// 1A4DA3B4D207FB4C43D08391653B900000 (hex) = 8950542107481892730061252864000000000000 (dec)
|
||||||
|
|
||||||
|
|
||||||
|
AddType("time"); // base: second
|
||||||
|
AddUnit("second", "s", 1);
|
||||||
|
AddUnit("minute", "m", 60);
|
||||||
|
AddUnit("hour", "h", 3600);
|
||||||
|
AddUnit("day", "d", 86400);
|
||||||
|
AddUnit("week", "w", 604800);
|
||||||
|
AddUnit("fortnight", "fn", 1209600);
|
||||||
|
AddUnit("month", "m", 2592000);
|
||||||
|
AddUnit("year", "y", 31536000);
|
||||||
|
AddUnit("year (mean)", "my", 31557600);
|
||||||
|
AddUnit("year (leap)", "ly", 31622400);
|
||||||
|
AddUnit("decade", "dc", 315360000);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// pl
|
||||||
|
// the 'value' param we're using only from the english
|
||||||
|
type_tab.push_back( std::vector<Type>() );
|
||||||
|
unit_tab.push_back( std::vector<Unit>() );
|
||||||
|
|
||||||
|
AddType("brak");
|
||||||
|
|
||||||
|
AddType("d<EFBFBD>ugo<EFBFBD><EFBFBD>");
|
||||||
|
AddUnit("cal");
|
||||||
|
AddUnit("stopa");
|
||||||
|
AddUnit("jard");
|
||||||
|
AddUnit("metr");
|
||||||
|
AddUnit("mila (angielska)");
|
||||||
|
AddUnit("mila (morska)");
|
||||||
|
AddUnit("punkt (Didot)");
|
||||||
|
AddUnit("punkt (pica)");
|
||||||
|
AddUnit("rok <20>wietlny");
|
||||||
|
|
||||||
|
AddType("powierzchnia");
|
||||||
|
AddUnit("cal^2");
|
||||||
|
AddUnit("stopa^2");
|
||||||
|
AddUnit("jard^2");
|
||||||
|
AddUnit("metr^2");
|
||||||
|
AddUnit("ar", "");
|
||||||
|
AddUnit("hektar");
|
||||||
|
AddUnit("mila (angielska)^2");
|
||||||
|
AddUnit("mila (morska)^2");
|
||||||
|
AddUnit("rok <20>wietlny^2");
|
||||||
|
|
||||||
|
|
||||||
|
AddType("czas");
|
||||||
|
AddUnit("sekunda");
|
||||||
|
AddUnit("minuta");
|
||||||
|
AddUnit("godzina");
|
||||||
|
AddUnit("dzie<EFBFBD>");
|
||||||
|
AddUnit("tydzie<EFBFBD>");
|
||||||
|
AddUnit("dwa tygodnie");
|
||||||
|
AddUnit("miesi<EFBFBD>c");
|
||||||
|
AddUnit("rok");
|
||||||
|
AddUnit("rok (<28>redni)");
|
||||||
|
AddUnit("rok (przest<73>pny)");
|
||||||
|
AddUnit("dekada");
|
||||||
|
|
||||||
|
CheckAfterInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::ErrorMessage()
|
||||||
|
{
|
||||||
|
MessageBox(0, "Internal error: tables for converting have incorrect values",
|
||||||
|
"Internal error", MB_ICONERROR);
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::CheckAfterInit()
|
||||||
|
{
|
||||||
|
unsigned int i, len;
|
||||||
|
|
||||||
|
if( type_tab.size() != unit_tab.size() )
|
||||||
|
return ErrorMessage();
|
||||||
|
|
||||||
|
if( type_tab.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
len = (unsigned int)type_tab[0].size();
|
||||||
|
for(i=1 ; i<type_tab.size() ; ++i)
|
||||||
|
{
|
||||||
|
if( len != type_tab[i].size() )
|
||||||
|
return ErrorMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
len = (unsigned int)unit_tab[0].size();
|
||||||
|
for(i=1 ; i<unit_tab.size() ; ++i)
|
||||||
|
{
|
||||||
|
if( len != unit_tab[i].size() )
|
||||||
|
return ErrorMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
cid - country id
|
||||||
|
|
||||||
|
*/
|
||||||
|
const char * Convert::GetTypeName(int cid, int id)
|
||||||
|
{
|
||||||
|
const char * unk_err = "unknown";
|
||||||
|
|
||||||
|
if( type_tab.empty() )
|
||||||
|
return unk_err;
|
||||||
|
|
||||||
|
if( cid >= (int)type_tab.size() )
|
||||||
|
cid = 0;
|
||||||
|
|
||||||
|
if( id< 0 || id >= int(type_tab[cid].size()) )
|
||||||
|
return unk_err;
|
||||||
|
|
||||||
|
return type_tab[cid][id].name.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const char * Convert::GetUnitName(int cid, int id)
|
||||||
|
{
|
||||||
|
const char * unk_err = "unknown";
|
||||||
|
|
||||||
|
if( unit_tab.empty() )
|
||||||
|
return unk_err;
|
||||||
|
|
||||||
|
if( cid >= (int)unit_tab.size() )
|
||||||
|
cid = 0;
|
||||||
|
|
||||||
|
if( id < 0 || id >= int(unit_tab[cid].size()) )
|
||||||
|
return unk_err;
|
||||||
|
|
||||||
|
return unit_tab[cid][id].name.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const char * Convert::GetUnitAbbr(int cid, int id)
|
||||||
|
{
|
||||||
|
const char * unk_err = "unknown";
|
||||||
|
|
||||||
|
if( unit_tab.empty() )
|
||||||
|
return unk_err;
|
||||||
|
|
||||||
|
if( cid >= (int)unit_tab.size() )
|
||||||
|
cid = 0;
|
||||||
|
|
||||||
|
if( id < 0 || id >= int(unit_tab[cid].size()) )
|
||||||
|
return unk_err;
|
||||||
|
|
||||||
|
if( !unit_tab[cid][id].abbr.empty() )
|
||||||
|
return unit_tab[cid][id].abbr.c_str();
|
||||||
|
|
||||||
|
/*
|
||||||
|
if there is no defined an abbreviation in the specific
|
||||||
|
language, we return the abbreviation from english
|
||||||
|
*/
|
||||||
|
|
||||||
|
return unit_tab[0][id].abbr.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int Convert::GetTypeSize()
|
||||||
|
{
|
||||||
|
if( type_tab.empty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return int(type_tab[0].size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Convert::GetUnitSize()
|
||||||
|
{
|
||||||
|
if( unit_tab.empty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return int(unit_tab[0].size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Convert::GetUnitType(int id)
|
||||||
|
{
|
||||||
|
if( unit_tab.empty() )
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if( id >= int(unit_tab[0].size()) )
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return unit_tab[0][id].type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// value is taken only from english
|
||||||
|
bool Convert::GetUnitValue(int id, TTMathBigMax & numerator, TTMathBigMax & denominator)
|
||||||
|
{
|
||||||
|
if( unit_tab.empty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( id >= int(unit_tab[0].size()) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
numerator = unit_tab[0][id].value_numerator;
|
||||||
|
denominator = unit_tab[0][id].value_denominator;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// gui
|
||||||
|
|
||||||
|
void Convert::SetCurrentType(int c)
|
||||||
|
{
|
||||||
|
current_conv_type = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Convert::GetCurrentType()
|
||||||
|
{
|
||||||
|
return current_conv_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::CheckUnitIndex(int type)
|
||||||
|
{
|
||||||
|
if( current_conv_unit[type].input < -1 || current_conv_unit[type].input >= GetUnitSize() )
|
||||||
|
current_conv_unit[type].input = 0; // maybe better to -1 ?
|
||||||
|
|
||||||
|
if( current_conv_unit[type].output < -1 || current_conv_unit[type].output >= GetUnitSize() )
|
||||||
|
current_conv_unit[type].output = 0; // the same
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::CheckCurrentUnits()
|
||||||
|
{
|
||||||
|
int len = GetTypeSize();
|
||||||
|
|
||||||
|
if( static_cast<int>( current_conv_unit.size() ) != len )
|
||||||
|
current_conv_unit.resize(len);
|
||||||
|
|
||||||
|
for(int i = 0 ; i<len ; ++i)
|
||||||
|
CheckUnitIndex(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Convert::SetCurrentUnit(int type, int input, int output)
|
||||||
|
{
|
||||||
|
int len = GetTypeSize();
|
||||||
|
|
||||||
|
if( type >= len )
|
||||||
|
return;
|
||||||
|
|
||||||
|
current_conv_unit[type].input = input;
|
||||||
|
current_conv_unit[type].output = output;
|
||||||
|
CheckUnitIndex(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Convert::GetCurrentUnit(int type, int & input, int & output)
|
||||||
|
{
|
||||||
|
int len = GetTypeSize();
|
||||||
|
|
||||||
|
if( type >= len )
|
||||||
|
{
|
||||||
|
input = output = -1;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
input = current_conv_unit[type].input;
|
||||||
|
output = current_conv_unit[type].output;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
176
src/convert.h
Normal file
176
src/convert.h
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
/*
|
||||||
|
* 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-2009, 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 convertheader
|
||||||
|
#define convertheader
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <string>
|
||||||
|
#include "compileconfig.h"
|
||||||
|
#include "bigtypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class Convert
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
Convert();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
none, length, area, time,
|
||||||
|
*/
|
||||||
|
struct Type
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct Unit
|
||||||
|
{
|
||||||
|
std::string name, abbr;
|
||||||
|
int type;
|
||||||
|
TTMathBigMax value_numerator, value_denominator;
|
||||||
|
|
||||||
|
Unit()
|
||||||
|
{
|
||||||
|
type = -1;
|
||||||
|
value_numerator.SetZero();
|
||||||
|
value_denominator.SetOne();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<std::vector<Type> > type_tab;
|
||||||
|
std::vector<std::vector<Unit> > unit_tab;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void AddType(const char * name);
|
||||||
|
void AddUnit(const char * name, const char * abbr = 0, int numerator = 0, int denominator = 1);
|
||||||
|
void AddUnit(const char * name, const char * abbr, const char * v);
|
||||||
|
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
|
||||||
|
const char * GetTypeName(int cid, int id);
|
||||||
|
|
||||||
|
const char * GetUnitName(int cid, int id);
|
||||||
|
const char * GetUnitAbbr(int cid, int id);
|
||||||
|
int GetUnitType(int id);
|
||||||
|
|
||||||
|
int GetTypeSize();
|
||||||
|
int GetUnitSize();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
the return value is the same for all languages
|
||||||
|
(in fact we're taking it from english)
|
||||||
|
*/
|
||||||
|
bool GetUnitValue(int id, TTMathBigMax & numerator, TTMathBigMax & denominator);
|
||||||
|
|
||||||
|
void ErrorMessage();
|
||||||
|
void CheckAfterInit();
|
||||||
|
|
||||||
|
|
||||||
|
template<class ValueType>
|
||||||
|
int Conversion(int conv_input_unit, int conv_output_unit, ValueType & result)
|
||||||
|
{
|
||||||
|
int c = 0;
|
||||||
|
|
||||||
|
ValueType v1_n, v1_d; // input
|
||||||
|
ValueType v2_n, v2_d; // output
|
||||||
|
|
||||||
|
TTMathBigMax v1_n_, v1_d_; // input
|
||||||
|
TTMathBigMax v2_n_, v2_d_; // output
|
||||||
|
|
||||||
|
if( !GetUnitValue(conv_input_unit, v1_n_, v1_d_) )
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if( !GetUnitValue(conv_output_unit, v2_n_, v2_d_) )
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
v1_n.FromBig( v1_n_ );
|
||||||
|
v1_d.FromBig( v1_d_ );
|
||||||
|
v2_n.FromBig( v2_n_ );
|
||||||
|
v2_d.FromBig( v2_d_ );
|
||||||
|
|
||||||
|
// result = result * (v1_n * v2_d) / (v1_d * v2_n)
|
||||||
|
c += result.Mul(v1_n);
|
||||||
|
c += result.Mul(v2_d);
|
||||||
|
c += v1_d.Mul(v2_n);
|
||||||
|
c += result.Div(v1_d);
|
||||||
|
|
||||||
|
return (c==0)? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
for the interface
|
||||||
|
*/
|
||||||
|
|
||||||
|
int current_conv_type; // selected type of converting: none, length, area, ...
|
||||||
|
|
||||||
|
struct CurrentConvUnit
|
||||||
|
{
|
||||||
|
int input, output;
|
||||||
|
CurrentConvUnit() { input = output = -1; }
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<CurrentConvUnit> current_conv_unit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SetCurrentType(int c);
|
||||||
|
int GetCurrentType();
|
||||||
|
void CheckUnitIndex(int type);
|
||||||
|
void CheckCurrentUnits();
|
||||||
|
void SetCurrentUnit(int type, int input, int output);
|
||||||
|
bool GetCurrentUnit(int type, int & input, int & output);
|
||||||
|
|
||||||
|
// end part of gui
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -97,10 +97,10 @@ int i;
|
|||||||
pchar = new char[temporary_buffer_size];
|
pchar = new char[temporary_buffer_size];
|
||||||
|
|
||||||
GetDlgItemText(hWnd, IDC_EDIT_FUNCTION_NAME, pchar, temporary_buffer_size);
|
GetDlgItemText(hWnd, IDC_EDIT_FUNCTION_NAME, pchar, temporary_buffer_size);
|
||||||
name = Variables::ChangeToSmallLetters( Variables::StripWhiteCharacters(pchar) );
|
name = Variables::StripWhiteCharacters(pchar);
|
||||||
|
|
||||||
GetDlgItemText(hWnd, IDC_EDIT_FUNCTION_VALUE, pchar, temporary_buffer_size);
|
GetDlgItemText(hWnd, IDC_EDIT_FUNCTION_VALUE, pchar, temporary_buffer_size);
|
||||||
value = Variables::ChangeToSmallLetters( Variables::StripWhiteCharacters(pchar) );
|
value = Variables::StripWhiteCharacters(pchar);
|
||||||
|
|
||||||
parameters = (int)SendDlgItemMessage(hWnd,IDC_COMBO_FUNCTION_PARAM,CB_GETCURSEL,0,0);
|
parameters = (int)SendDlgItemMessage(hWnd,IDC_COMBO_FUNCTION_PARAM,CB_GETCURSEL,0,0);
|
||||||
|
|
||||||
@@ -223,6 +223,7 @@ BOOL WmTabCommand_AddFunction(HWND, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
GetPrgRes()->GetThreadController()->StopCalculating();
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
code = GetPrgRes()->GetFunctions()->Add(name, value, parameters);
|
code = GetPrgRes()->GetFunctions()->Add(name, value, parameters);
|
||||||
|
GetPrgRes()->FunctionsChanged();
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
if( code != ttmath::err_ok )
|
if( code != ttmath::err_ok )
|
||||||
@@ -290,6 +291,7 @@ adding = false;
|
|||||||
// if we've changed the name then we're changing the value and parameters
|
// if we've changed the name then we're changing the value and parameters
|
||||||
code = GetPrgRes()->GetFunctions()->EditValue(name, value, parameters);
|
code = GetPrgRes()->GetFunctions()->EditValue(name, value, parameters);
|
||||||
|
|
||||||
|
GetPrgRes()->FunctionsChanged();
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
if( code != ttmath::err_ok )
|
if( code != ttmath::err_ok )
|
||||||
@@ -339,9 +341,12 @@ int items = ListView_GetSelectedCount(list);
|
|||||||
all_deleted = false;
|
all_deleted = false;
|
||||||
else
|
else
|
||||||
ListView_DeleteItem(list, id);
|
ListView_DeleteItem(list, id);
|
||||||
|
|
||||||
|
GetPrgRes()->FunctionsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -44,6 +44,26 @@ IniParser::IniParser()
|
|||||||
{
|
{
|
||||||
strip_white_characters_from_value = true;
|
strip_white_characters_from_value = true;
|
||||||
convert_value_to_small_letters = true;
|
convert_value_to_small_letters = true;
|
||||||
|
section_case_sensitive = false;
|
||||||
|
pattern_case_sensitive = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void IniParser::ConvertValueToSmallLetters(bool conv)
|
||||||
|
{
|
||||||
|
convert_value_to_small_letters = conv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void IniParser::SectionCaseSensitive(bool sens)
|
||||||
|
{
|
||||||
|
section_case_sensitive = sens;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void IniParser::PatternCaseSensitive(bool sens)
|
||||||
|
{
|
||||||
|
pattern_case_sensitive = sens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -148,7 +168,10 @@ IniParser::Error IniParser::ReadSection(std::string & section)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while( IsSectionCharacter( (c = ReadCharacter()) ) )
|
while( IsSectionCharacter( (c = ReadCharacter()) ) )
|
||||||
section += LowerCase(c);
|
if( section_case_sensitive )
|
||||||
|
section += c;
|
||||||
|
else
|
||||||
|
section += LowerCase(c);
|
||||||
|
|
||||||
if( c != ']' )
|
if( c != ']' )
|
||||||
{
|
{
|
||||||
@@ -220,7 +243,11 @@ IniParser::Error IniParser::ReadExpression(std::string & pattern, std::string &
|
|||||||
|
|
||||||
while( IsPatternCharacter(c) )
|
while( IsPatternCharacter(c) )
|
||||||
{
|
{
|
||||||
pattern += LowerCase(c);
|
if( pattern_case_sensitive )
|
||||||
|
pattern += c;
|
||||||
|
else
|
||||||
|
pattern += LowerCase(c);
|
||||||
|
|
||||||
c = ReadCharacter();
|
c = ReadCharacter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file iniparser.h
|
\file iniparser.h
|
||||||
\brief A Parser witch we use for parsing 'ini' files
|
\brief A Parser which we use for parsing 'ini' files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -133,6 +133,34 @@ public:
|
|||||||
Error ReadFromFile(const char * path);
|
Error ReadFromFile(const char * path);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
when true the names of sections will be case-sensitive
|
||||||
|
e.g.
|
||||||
|
when true: '[foo]' is not equal '[Foo]'
|
||||||
|
|
||||||
|
default: false
|
||||||
|
*/
|
||||||
|
void SectionCaseSensitive(bool sens);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
when true the names of patterns will be case-sensitive
|
||||||
|
e.g.
|
||||||
|
when true: 'foo = 4' is not equal 'Foo = 4'
|
||||||
|
|
||||||
|
default: false
|
||||||
|
*/
|
||||||
|
void PatternCaseSensitive(bool sens);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
if conv=true (default) that the whole characters in a value
|
||||||
|
will be changed into small letters
|
||||||
|
*/
|
||||||
|
void ConvertValueToSmallLetters(bool conv);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef std::map<std::string, std::string *> Table;
|
typedef std::map<std::string, std::string *> Table;
|
||||||
@@ -144,6 +172,8 @@ private:
|
|||||||
int line;
|
int line;
|
||||||
bool strip_white_characters_from_value;
|
bool strip_white_characters_from_value;
|
||||||
bool convert_value_to_small_letters;
|
bool convert_value_to_small_letters;
|
||||||
|
bool section_case_sensitive;
|
||||||
|
bool pattern_case_sensitive;
|
||||||
|
|
||||||
Error Read();
|
Error Read();
|
||||||
Error ReadSection(std::string & section);
|
Error ReadSection(std::string & section);
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -36,14 +36,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "compileconfig.h"
|
#include "compileconfig.h"
|
||||||
|
|
||||||
#include "languages.h"
|
#include "languages.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char * Languages::ErrorMessage(Country country, ttmath::ErrorCode code)
|
const char * Languages::ErrorMessage(Country country, ttmath::ErrorCode code)
|
||||||
{
|
{
|
||||||
const char * unk_err = "unknown error";
|
const char * unk_err = "unknown error";
|
||||||
@@ -85,6 +82,9 @@ void Languages::InitErrorMessagesTab()
|
|||||||
{
|
{
|
||||||
error_messages_tab.push_back( std::map<ttmath::ErrorCode, std::string>() );
|
error_messages_tab.push_back( std::map<ttmath::ErrorCode, std::string>() );
|
||||||
|
|
||||||
|
/*
|
||||||
|
english messages relating to ttmath library
|
||||||
|
*/
|
||||||
InsertErrorPair(ttmath::err_ok,"ok");
|
InsertErrorPair(ttmath::err_ok,"ok");
|
||||||
InsertErrorPair(ttmath::err_nothing_has_read,"");
|
InsertErrorPair(ttmath::err_nothing_has_read,"");
|
||||||
InsertErrorPair(ttmath::err_unknown_character,"An unknown character");
|
InsertErrorPair(ttmath::err_unknown_character,"An unknown character");
|
||||||
@@ -111,7 +111,11 @@ void Languages::InitErrorMessagesTab()
|
|||||||
InsertErrorPair(ttmath::err_still_calculating,"Calculating...");
|
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");
|
||||||
|
|
||||||
// pl
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
polish messages relating to ttmath library
|
||||||
|
*/
|
||||||
|
|
||||||
error_messages_tab.push_back( std::map<ttmath::ErrorCode, std::string>() );
|
error_messages_tab.push_back( std::map<ttmath::ErrorCode, std::string>() );
|
||||||
|
|
||||||
@@ -142,8 +146,133 @@ void Languages::InitErrorMessagesTab()
|
|||||||
InsertErrorPair(ttmath::err_too_big_factorial,"Zbyt du<64>y argument dla funkcji factorial()");
|
InsertErrorPair(ttmath::err_too_big_factorial,"Zbyt du<64>y argument dla funkcji factorial()");
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
spanish 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,"Un caracter desconocido");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_final_bracket,"corchete final inesperado");
|
||||||
|
InsertErrorPair(ttmath::err_stack_not_clear,"caracter desconocido a la izquierda");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_variable,"Variable desconocida");
|
||||||
|
InsertErrorPair(ttmath::err_division_by_zero,"Division por cero");
|
||||||
|
InsertErrorPair(ttmath::err_interrupt,"El calculo se ha colapsado");
|
||||||
|
InsertErrorPair(ttmath::err_overflow,"Overflow");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_function,"Funcion desconocida");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_operator,"Operador desconocida");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"punto y coma inesperado");
|
||||||
|
InsertErrorPair(ttmath::err_improper_amount_of_arguments,"numero de argumentos incorrecto");
|
||||||
|
InsertErrorPair(ttmath::err_improper_argument,"argumento incorrecto");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_end,"Fin inexperado");
|
||||||
|
InsertErrorPair(ttmath::err_internal_error,"Error interno");
|
||||||
|
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_name,"nombre incorrecto de variable o funcion");
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_value,"valor incorrecto de variable o funcion");
|
||||||
|
InsertErrorPair(ttmath::err_variable_exists,"Variable ya existe");
|
||||||
|
InsertErrorPair(ttmath::err_variable_loop,"Recurrencia entre variables");
|
||||||
|
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()");
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
danish 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,"Et ukendt tegn");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_final_bracket,"En uforventet endelig klasse");
|
||||||
|
InsertErrorPair(ttmath::err_stack_not_clear,"Et ukendt tegn er v<>k");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_variable,"En ukendt variabel");
|
||||||
|
InsertErrorPair(ttmath::err_division_by_zero,"Division med nul");
|
||||||
|
InsertErrorPair(ttmath::err_interrupt,"Beregningen er blevet afbrydt");
|
||||||
|
InsertErrorPair(ttmath::err_overflow,"Overflow fejl");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_function,"En ukendt funktion");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_operator,"En ukendt operator");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"En ukendt semikolon operator");
|
||||||
|
InsertErrorPair(ttmath::err_improper_amount_of_arguments,"Ukorrekt m<>ngde af argumenter");
|
||||||
|
InsertErrorPair(ttmath::err_improper_argument,"U<EFBFBD>gte argumentation");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_end,"Uforventet slutning");
|
||||||
|
InsertErrorPair(ttmath::err_internal_error,"En intern fejl");
|
||||||
|
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_name,"Ukorrekt navn for en variabel eller function");
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_value,"Ukorrekt v<>rdi for en variabel eller funktion");
|
||||||
|
InsertErrorPair(ttmath::err_variable_exists,"Denne variabel eksisterer allerede");
|
||||||
|
InsertErrorPair(ttmath::err_variable_loop,"Det er en gentagelse mellem variabler");
|
||||||
|
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 <20>n v<>rdi");
|
||||||
|
InsertErrorPair(ttmath::err_still_calculating,"Regner...");
|
||||||
|
InsertErrorPair(ttmath::err_too_big_factorial,"Et for stort argument for factorial() funktionen");
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
chinese messages relating to ttmath library
|
||||||
|
*/
|
||||||
|
error_messages_tab.push_back( std::map<ttmath::ErrorCode, std::string>() );
|
||||||
|
|
||||||
|
InsertErrorPair(ttmath::err_ok,"ȷ<EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_nothing_has_read,"");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_character,"δ֪<EFBFBD>ַ<EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_final_bracket,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_stack_not_clear,"δ֪<EFBFBD>ַ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_variable,"δ֪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_division_by_zero,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_interrupt,"<EFBFBD><EFBFBD><EFBFBD>㱻<EFBFBD>ж<EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_overflow,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_function,"δ֪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_operator,"δ֪<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķֺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_improper_amount_of_arguments,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_improper_argument,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_end,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĩ<EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_internal_error,"<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_name,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_value,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ");
|
||||||
|
InsertErrorPair(ttmath::err_variable_exists,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_variable_loop,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_functions_loop,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_must_be_only_one_value,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><EFBFBD><EFBFBD>ֵ");
|
||||||
|
InsertErrorPair(ttmath::err_still_calculating,"<EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><EFBFBD><EFBFBD>...");
|
||||||
|
InsertErrorPair(ttmath::err_too_big_factorial,"<EFBFBD>׳˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
russian 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,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_final_bracket,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_stack_not_clear,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_variable,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_division_by_zero,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_interrupt,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_overflow,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_function,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unknown_operator,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ;");
|
||||||
|
InsertErrorPair(ttmath::err_improper_amount_of_arguments,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_improper_argument,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_unexpected_end,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_internal_error,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_name,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_incorrect_value,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_variable_exists,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_variable_loop,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_functions_loop,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_must_be_only_one_value,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertErrorPair(ttmath::err_still_calculating,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
||||||
|
InsertErrorPair(ttmath::err_too_big_factorial,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> factorial()");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,10 +303,15 @@ const char * unk_msg = "unknown";
|
|||||||
return i->second.c_str();
|
return i->second.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char * Languages::GuiMessage(GuiMsg code)
|
const char * Languages::GuiMessage(GuiMsg code)
|
||||||
{
|
{
|
||||||
return GuiMessage(current_country, code);
|
return GuiMessage(current_country, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Languages::InsertGuiPair(GuiMsg code, const char * message)
|
void Languages::InsertGuiPair(GuiMsg code, const char * message)
|
||||||
{
|
{
|
||||||
if( gui_messages_tab.empty() )
|
if( gui_messages_tab.empty() )
|
||||||
@@ -187,9 +321,13 @@ void Languages::InsertGuiPair(GuiMsg code, const char * message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Languages::InitGuiMessagesTab()
|
void Languages::InitGuiMessagesTab()
|
||||||
{
|
{
|
||||||
// en
|
/*
|
||||||
|
english gui messages
|
||||||
|
*/
|
||||||
|
|
||||||
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
||||||
|
|
||||||
InsertGuiPair(button_ok,"Ok");
|
InsertGuiPair(button_ok,"Ok");
|
||||||
@@ -227,28 +365,37 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(tab_functions,"Functions");
|
InsertGuiPair(tab_functions,"Functions");
|
||||||
InsertGuiPair(tab_precision,"Precision");
|
InsertGuiPair(tab_precision,"Precision");
|
||||||
InsertGuiPair(tab_display,"Display");
|
InsertGuiPair(tab_display,"Display");
|
||||||
|
InsertGuiPair(tab_convert,"Convert");
|
||||||
|
|
||||||
InsertGuiPair(radio_precision_1,"Small - 96 bits for the mantissa, 32 bits for the exponent");
|
InsertGuiPair(radio_precision_1,"Small - 96 bits for the mantissa, 32 bits for the exponent");
|
||||||
InsertGuiPair(radio_precision_2,"Medium - 192 bits for the mantissa, 64 bits for the exponent");
|
InsertGuiPair(radio_precision_2,"Medium - 288 bits for the mantissa, 64 bits for the exponent");
|
||||||
InsertGuiPair(radio_precision_3,"Big - 288 bits for the mantissa, 96 bits for the exponent");
|
InsertGuiPair(radio_precision_3,"Big - 864 bits for the mantissa, 128 bits for the exponent");
|
||||||
|
|
||||||
|
|
||||||
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 valid digits (decimal)");
|
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 valid digits (decimal)");
|
||||||
InsertGuiPair(precision_2_info,"(+/-)4.3 e+2776511644261678623, 56 valid digits");
|
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 valid digits");
|
||||||
InsertGuiPair(precision_3_info,"(+/-)2.5 e+11925026709067095507636213441, 85 valid digits");
|
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 digits");
|
||||||
|
|
||||||
InsertGuiPair(overflow_during_printing,"Overflow during printing");
|
InsertGuiPair(overflow_during_printing,"Overflow during printing");
|
||||||
|
|
||||||
InsertGuiPair(combo_rounding_none,"None");
|
InsertGuiPair(combo_rounding_none,"None");
|
||||||
InsertGuiPair(combo_rounding_cut_last_digits,"Cut off last non-valid digits");
|
InsertGuiPair(combo_rounding_integer,"to integer");
|
||||||
InsertGuiPair(combo_rounding_integer,"Round to the nearest integer");
|
|
||||||
InsertGuiPair(combo_rounding_to_number,"to");
|
InsertGuiPair(combo_rounding_to_number,"to");
|
||||||
InsertGuiPair(combo_rounding_after_comma,"digit(s) after comma");
|
InsertGuiPair(combo_rounding_after_comma,"digit(s)");
|
||||||
|
InsertGuiPair(check_remove_zeroes,"Remove last trailing zeroes");
|
||||||
|
|
||||||
InsertGuiPair(display_input, "Input");
|
InsertGuiPair(display_input, "Input");
|
||||||
InsertGuiPair(display_output, "Output");
|
InsertGuiPair(display_output, "Output");
|
||||||
InsertGuiPair(display_rounding, "Rounding");
|
InsertGuiPair(display_rounding, "Rounding");
|
||||||
InsertGuiPair(display_always_scientific,"Always");
|
InsertGuiPair(display_always_scientific,"Always");
|
||||||
InsertGuiPair(display_not_always_scientific,"When the exponent is greater than:");
|
InsertGuiPair(display_not_always_scientific,"When the exponent is greater than:");
|
||||||
InsertGuiPair(display_group_scientific, "Print the result as the scientific value");
|
InsertGuiPair(display_group_scientific, "Print the result as the scientific value");
|
||||||
|
InsertGuiPair(display_decimal_point, "Decimal point");
|
||||||
|
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, "&View");
|
InsertGuiPair(menu_view, "&View");
|
||||||
InsertGuiPair(menu_edit, "&Edit");
|
InsertGuiPair(menu_edit, "&Edit");
|
||||||
@@ -260,6 +407,10 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(menu_view_always_on_top, "&Always on top");
|
InsertGuiPair(menu_view_always_on_top, "&Always on top");
|
||||||
InsertGuiPair(menu_view_lang_english, "&English");
|
InsertGuiPair(menu_view_lang_english, "&English");
|
||||||
InsertGuiPair(menu_view_lang_polish, "&Polish");
|
InsertGuiPair(menu_view_lang_polish, "&Polish");
|
||||||
|
InsertGuiPair(menu_view_lang_spanish, "&Spanish");
|
||||||
|
InsertGuiPair(menu_view_lang_danish, "&Danish");
|
||||||
|
InsertGuiPair(menu_view_lang_chinese, "&Chinese");
|
||||||
|
InsertGuiPair(menu_view_lang_russian, "&Russian");
|
||||||
InsertGuiPair(menu_view_close_program, "&Close");
|
InsertGuiPair(menu_view_close_program, "&Close");
|
||||||
InsertGuiPair(menu_edit_undo, "&Undo");
|
InsertGuiPair(menu_edit_undo, "&Undo");
|
||||||
InsertGuiPair(menu_edit_paste, "&Paste");
|
InsertGuiPair(menu_edit_paste, "&Paste");
|
||||||
@@ -267,35 +418,49 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(menu_help_help, "&Help");
|
InsertGuiPair(menu_help_help, "&Help");
|
||||||
InsertGuiPair(menu_help_project_page, "&Project page");
|
InsertGuiPair(menu_help_project_page, "&Project page");
|
||||||
InsertGuiPair(menu_help_about, "&About");
|
InsertGuiPair(menu_help_about, "&About");
|
||||||
InsertGuiPair(cant_init_calculations, "I could not initialize the module of calculations");
|
InsertGuiPair(cant_init_calculations, "I could not initialize the module for calculations");
|
||||||
InsertGuiPair(message_box_error_caption,"TTCalc");
|
InsertGuiPair(message_box_error_caption,"TTCalc");
|
||||||
InsertGuiPair(cant_create_thread, "I could not create the second thread for calculating");
|
InsertGuiPair(cant_create_thread, "I could not create the second thread for calculating");
|
||||||
InsertGuiPair(cant_create_main_window, "I could not create the main window of the application");
|
InsertGuiPair(cant_create_main_window, "I could not create the main window of the application");
|
||||||
InsertGuiPair(cant_init_common_controls,"I could not initialize the common controls (InitCommonControlsEx)");
|
InsertGuiPair(cant_init_common_controls,"I could not initialize the common controls (InitCommonControlsEx)");
|
||||||
InsertGuiPair(about_text,
|
InsertGuiPair(about_text,
|
||||||
"Mathematical calculator TTCalc %d.%d.%d%s\r\n"
|
"Mathematical calculator TTCalc %d.%d.%d%s%s\r\n"
|
||||||
"Author: Tomasz Sowa\r\n"
|
"Author: Tomasz Sowa\r\n"
|
||||||
"Contact: t.sowa@slimaczek.pl\r\n"
|
"Contact: t.sowa@ttmath.org\r\n"
|
||||||
"Licence: (New) BSD licence\r\n"
|
"Licence: BSD (open source)\r\n"
|
||||||
"Project page: http://sourceforge.net/projects/ttcalc\r\n"
|
"Project page: http://ttcalc.sourceforge.net\r\n"
|
||||||
"Bignum library: TTMath %d.%d.%d%s\r\n"
|
"Bignum library: TTMath %d.%d.%d%s\r\n"
|
||||||
"Programming language: C++\r\n"
|
"Programming language: C++\r\n"
|
||||||
"Compiler: %s\r\n"
|
"Compiler: %s\r\n"
|
||||||
|
"%s" // for upx
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"This program uses the TTMath bignum library"
|
"TTCalc uses the TTMath bignum library"
|
||||||
" which can be found at http://sourceforge.net/projects/ttmath\r\n"
|
" which can be found at http://sourceforge.net/projects/ttmath\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
|
#ifdef TTCALC_PORTABLE
|
||||||
|
"This is the portable version of the program TTCalc. In this version "
|
||||||
|
"you can calculate only with one kind of precision (96 bits for the "
|
||||||
|
"mantissa and 32 bits for the exponent) it's about +/-6.9e+646457021.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#endif
|
||||||
"If you have any questions, advices or interesting ideas about"
|
"If you have any questions, advices or interesting ideas about"
|
||||||
" this program or if you want to join to this project as"
|
" this program or if you want to join to this project as"
|
||||||
" a developer or programmer feel free to contant with the author."
|
" a developer or a programmer feel free to contant with the author."
|
||||||
);
|
);
|
||||||
|
InsertGuiPair(about_text_portable_version, " portable version");
|
||||||
|
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
|
||||||
InsertGuiPair(about_box_title, "About");
|
InsertGuiPair(about_box_title, "About");
|
||||||
InsertGuiPair(about_box_button_close, "Close");
|
InsertGuiPair(about_box_button_close, "Close");
|
||||||
InsertGuiPair(unknown_error, "An unknown error has occurred");
|
InsertGuiPair(unknown_error, "An unknown error has occurred");
|
||||||
InsertGuiPair(cant_find_help, "I can't find any help files");
|
InsertGuiPair(cant_find_help, "I can't find any help files");
|
||||||
InsertGuiPair(cant_open_project_page, "I can't open the project webpage");
|
InsertGuiPair(cant_open_project_page, "I can't open the project webpage");
|
||||||
|
|
||||||
// pl
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
polish gui messages
|
||||||
|
*/
|
||||||
|
|
||||||
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
||||||
|
|
||||||
InsertGuiPair(button_ok,"Ok");
|
InsertGuiPair(button_ok,"Ok");
|
||||||
@@ -334,22 +499,23 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(tab_functions,"Funkcje");
|
InsertGuiPair(tab_functions,"Funkcje");
|
||||||
InsertGuiPair(tab_precision,"Precyzja");
|
InsertGuiPair(tab_precision,"Precyzja");
|
||||||
InsertGuiPair(tab_display,"Wy<EFBFBD>wietlanie");
|
InsertGuiPair(tab_display,"Wy<EFBFBD>wietlanie");
|
||||||
|
InsertGuiPair(tab_convert,"Konwersja");
|
||||||
|
|
||||||
InsertGuiPair(radio_precision_1,"Ma<EFBFBD>a - 96 bitowa mantysa, 32 bitowy wyk<79>adnik");
|
InsertGuiPair(radio_precision_1,"Ma<EFBFBD>a - 96 bitowa mantysa, 32 bitowy wyk<79>adnik");
|
||||||
InsertGuiPair(radio_precision_2,"<EFBFBD>rednia - 192 bitowa mantysa, 64 bitowy wyk<79>adnik");
|
InsertGuiPair(radio_precision_2,"<EFBFBD>rednia - 288 bitowa mantysa, 64 bitowy wyk<79>adnik");
|
||||||
InsertGuiPair(radio_precision_3,"Du<EFBFBD>a - 288 bitowa mantysa, 96 bitowy wyk<79>adnik");
|
InsertGuiPair(radio_precision_3,"Du<EFBFBD>a - 864 bitowa mantysa, 128 bitowy wyk<79>adnik");
|
||||||
|
|
||||||
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 cyfr znacz<63>cych (w rozwini<6E>ciu dziesi<73>tnym)");
|
InsertGuiPair(precision_1_info,"(+/-)6.9e+646457021, 26 cyfr znacz<63>cych (w rozwini<6E>ciu dziesi<73>tnym)");
|
||||||
InsertGuiPair(precision_2_info,"(+/-)4.3 e+2776511644261678623, 56 cyfr znacz<63>cych");
|
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 cyfr znacz<63>cych");
|
||||||
InsertGuiPair(precision_3_info,"(+/-)2.5 e+11925026709067095507636213441, 85 cyfr znacz<63>cych");
|
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 cyfr");
|
||||||
|
|
||||||
InsertGuiPair(overflow_during_printing,"Przepe<EFBFBD>nienie podczas wypisywania");
|
InsertGuiPair(overflow_during_printing,"Przepe<EFBFBD>nienie podczas wypisywania");
|
||||||
|
|
||||||
InsertGuiPair(combo_rounding_none,"bez zaokr<EFBFBD>glania");
|
InsertGuiPair(combo_rounding_none,"bez zmian");
|
||||||
InsertGuiPair(combo_rounding_cut_last_digits,"skasowa<EFBFBD> nie znacz<63>ce zera");
|
InsertGuiPair(combo_rounding_integer,"do ca<63>kowitej");
|
||||||
InsertGuiPair(combo_rounding_integer,"do najbli<6C>szej ca<63>kowitej");
|
|
||||||
InsertGuiPair(combo_rounding_to_number,"do");
|
InsertGuiPair(combo_rounding_to_number,"do");
|
||||||
InsertGuiPair(combo_rounding_after_comma,"cyfr(y) po przecinku");
|
InsertGuiPair(combo_rounding_after_comma,"cyfr(y)");
|
||||||
|
InsertGuiPair(check_remove_zeroes,"Skasuj nieznacz<63>ce zera");
|
||||||
|
|
||||||
InsertGuiPair(display_input,"Wej<EFBFBD>cie");
|
InsertGuiPair(display_input,"Wej<EFBFBD>cie");
|
||||||
InsertGuiPair(display_output,"Wyj<EFBFBD>cie");
|
InsertGuiPair(display_output,"Wyj<EFBFBD>cie");
|
||||||
@@ -357,6 +523,12 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(display_always_scientific,"Zawsze");
|
InsertGuiPair(display_always_scientific,"Zawsze");
|
||||||
InsertGuiPair(display_not_always_scientific,"Je<EFBFBD>li eksponent jest wi<77>kszy ni<6E>:");
|
InsertGuiPair(display_not_always_scientific,"Je<EFBFBD>li eksponent jest wi<77>kszy ni<6E>:");
|
||||||
InsertGuiPair(display_group_scientific, "Wy<EFBFBD>wietl wynik w postaci naukowej");
|
InsertGuiPair(display_group_scientific, "Wy<EFBFBD>wietl wynik w postaci naukowej");
|
||||||
|
InsertGuiPair(display_decimal_point, "Przecinek dziesi<73>tny");
|
||||||
|
InsertGuiPair(display_deg_rad_grad, "sin/cos asin/acos");
|
||||||
|
InsertGuiPair(convert_type, "Typ");
|
||||||
|
InsertGuiPair(convert_input, "Wej<EFBFBD>cie");
|
||||||
|
InsertGuiPair(convert_output, "Wyj<EFBFBD>cie");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "Automatyczny prefiks");
|
||||||
|
|
||||||
InsertGuiPair(menu_view, "&Widok");
|
InsertGuiPair(menu_view, "&Widok");
|
||||||
InsertGuiPair(menu_edit, "&Edycja");
|
InsertGuiPair(menu_edit, "&Edycja");
|
||||||
@@ -366,8 +538,12 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(menu_view_normal_view, "Widok no&rmalny");
|
InsertGuiPair(menu_view_normal_view, "Widok no&rmalny");
|
||||||
InsertGuiPair(menu_view_compact_view, "Widok &kompaktowy");
|
InsertGuiPair(menu_view_compact_view, "Widok &kompaktowy");
|
||||||
InsertGuiPair(menu_view_always_on_top, "Zawsze na &wierzchu");
|
InsertGuiPair(menu_view_always_on_top, "Zawsze na &wierzchu");
|
||||||
InsertGuiPair(menu_view_lang_english, "J<EFBFBD>zyk &angielski");
|
InsertGuiPair(menu_view_lang_english, "&Angielski");
|
||||||
InsertGuiPair(menu_view_lang_polish, "J<EFBFBD>zyk &polski");
|
InsertGuiPair(menu_view_lang_polish, "&Polski");
|
||||||
|
InsertGuiPair(menu_view_lang_spanish, "&Hiszpa<70>ski");
|
||||||
|
InsertGuiPair(menu_view_lang_danish, "&Du<44>ski");
|
||||||
|
InsertGuiPair(menu_view_lang_chinese, "&Chi<68>ski");
|
||||||
|
InsertGuiPair(menu_view_lang_russian, "&Russian");
|
||||||
InsertGuiPair(menu_view_close_program, "&Zamknij");
|
InsertGuiPair(menu_view_close_program, "&Zamknij");
|
||||||
InsertGuiPair(menu_edit_undo, "&Cofnij");
|
InsertGuiPair(menu_edit_undo, "&Cofnij");
|
||||||
InsertGuiPair(menu_edit_paste, "&Wklej");
|
InsertGuiPair(menu_edit_paste, "&Wklej");
|
||||||
@@ -381,26 +557,571 @@ void Languages::InitGuiMessagesTab()
|
|||||||
InsertGuiPair(cant_create_main_window, "Nie uda<64>o si<73> utworzy<7A> g<><67>wnego okna aplikacji");
|
InsertGuiPair(cant_create_main_window, "Nie uda<64>o si<73> utworzy<7A> g<><67>wnego okna aplikacji");
|
||||||
InsertGuiPair(cant_init_common_controls,"Nie uda<64>o si<73> zainicjalizowa<77> obs<62>ugi Common Controls (InitCommonControlsEx)");
|
InsertGuiPair(cant_init_common_controls,"Nie uda<64>o si<73> zainicjalizowa<77> obs<62>ugi Common Controls (InitCommonControlsEx)");
|
||||||
InsertGuiPair(about_text,
|
InsertGuiPair(about_text,
|
||||||
"Kalkulator matematyczny TTCalc %d.%d.%d%s\r\n"
|
"Kalkulator matematyczny TTCalc %d.%d.%d%s%s\r\n"
|
||||||
"Autor: Tomasz Sowa\r\n"
|
"Autor: Tomasz Sowa\r\n"
|
||||||
"Kontakt: t.sowa@slimaczek.pl\r\n"
|
"Kontakt: t.sowa@ttmath.org\r\n"
|
||||||
"Licencja: (New) BSD\r\n"
|
"Licencja: BSD (open source)\r\n"
|
||||||
"Strona projektu: http://sourceforge.net/projects/ttcalc\r\n"
|
"Strona projektu: http://ttcalc.sourceforge.net\r\n"
|
||||||
"Biblioteka du<64>ych liczb: TTMath %d.%d.%d%s\r\n"
|
"Biblioteka du<64>ych liczb: TTMath %d.%d.%d%s\r\n"
|
||||||
"J<EFBFBD>zyk programowania: C++\r\n"
|
"J<EFBFBD>zyk programowania: C++\r\n"
|
||||||
"Kompilator: %s\r\n"
|
"Kompilator: %s\r\n"
|
||||||
|
"%s" // for upx
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"Ten program u<>ywa biblioteki du<64>ych liczb TTMath"
|
"Ten program u<>ywa biblioteki du<64>ych liczb TTMath"
|
||||||
" kt<6B>ra jest dost<73>pna na http://sourceforge.net/projects/ttmath\r\n"
|
" kt<6B>ra jest dost<73>pna na http://sourceforge.net/projects/ttmath\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
|
#ifdef TTCALC_PORTABLE
|
||||||
|
"To jest wersja portable programu TTCalc. W tej wersji mo<6D>esz dokonywa<77> "
|
||||||
|
"oblicze<EFBFBD> jedynie z jednym rodzajem precyzji (96 bitowa mantysa "
|
||||||
|
"oraz 32 bitowy wyk<79>adnik) to jest oko<6B>o +/-6.9e+646457021.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#endif
|
||||||
"Je<EFBFBD>eli masz jakie<69> pytania, rady, ciekawe pomys<79>y dotycz<63>ce"
|
"Je<EFBFBD>eli masz jakie<69> pytania, rady, ciekawe pomys<79>y dotycz<63>ce"
|
||||||
" tego programu lub chcia<69>by<62> do<64><6F>czy<7A> jako projektant/programista"
|
" tego programu lub chcia<69>by<62> do<64><6F>czy<7A> jako projektant/programista"
|
||||||
" poprostu skontaktuj si<73> z autorem."
|
" poprostu skontaktuj si<73> z autorem."
|
||||||
);
|
);
|
||||||
|
InsertGuiPair(about_text_portable_version, " wersja portable");
|
||||||
|
InsertGuiPair(about_text_exe_packer, "Paker exe: UPX 3.03\r\n");
|
||||||
InsertGuiPair(about_box_title, "O programie");
|
InsertGuiPair(about_box_title, "O programie");
|
||||||
InsertGuiPair(about_box_button_close, "Zamknij");
|
InsertGuiPair(about_box_button_close, "Zamknij");
|
||||||
InsertGuiPair(unknown_error, "Nieznany kod b<><62>du");
|
InsertGuiPair(unknown_error, "Nieznany kod b<><62>du");
|
||||||
InsertGuiPair(cant_find_help, "Nie mog<6F> znale<6C><65> <20>adnych plik<69>w pomocy");
|
InsertGuiPair(cant_find_help, "Nie mog<6F> znale<6C><65> <20>adnych plik<69>w pomocy");
|
||||||
InsertGuiPair(cant_open_project_page, "Nie mog<6F> otworzy<7A> strony projektu");
|
InsertGuiPair(cant_open_project_page, "Nie mog<6F> otworzy<7A> strony projektu");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
spanish gui messages
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
||||||
|
|
||||||
|
InsertGuiPair(button_ok,"Ok");
|
||||||
|
InsertGuiPair(button_cancel,"Cancelar");
|
||||||
|
InsertGuiPair(message_box_caption,"TTCalc");
|
||||||
|
|
||||||
|
InsertGuiPair(dialog_box_add_variable_caption,"A<EFBFBD>adir nueva variable");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_caption,"Editar variable");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_name,"Nombre incorrecto de variable");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_value,"Valor incorrecto de variable");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_variable_exists,"Esta variable ya existe");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_unknown_variable,"No hay variable en mi tabla!. Seguramente haya un error interno!");
|
||||||
|
InsertGuiPair(dialog_box_delete_variable_confirm,"Quiere borrar las variables internas?");
|
||||||
|
InsertGuiPair(dialog_box_variable_not_all_deleted,"Hay algunas variables que no se pueden borrar. Probablemente hay un error interno!");
|
||||||
|
InsertGuiPair(dialog_box_add_function_caption,"A<EFBFBD>adir funcion");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_caption,"Editar funcion");
|
||||||
|
InsertGuiPair(dialog_box_add_function_function_exists,"Esta funcion ya existe");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_unknown_function,"No existe esta funcion en mi tabla. Problablemente error interno!");
|
||||||
|
InsertGuiPair(dialog_box_delete_function_confirm,"Quiere borrar estas funciones?");
|
||||||
|
InsertGuiPair(dialog_box_function_not_all_deleted,"Hay algunas funciones que no se pueden borrar. Probablmenete error interno!");
|
||||||
|
InsertGuiPair(dialog_box_add_function_incorrect_name,"Nombre incorrecto de la funcion");
|
||||||
|
|
||||||
|
InsertGuiPair(list_variables_header_1,"Nombre");
|
||||||
|
InsertGuiPair(list_variables_header_2,"Valor");
|
||||||
|
InsertGuiPair(list_functions_header_1,"Nombre");
|
||||||
|
InsertGuiPair(list_functions_header_2,"Param.");
|
||||||
|
InsertGuiPair(list_functions_header_3,"Valor");
|
||||||
|
|
||||||
|
InsertGuiPair(button_add,"A<EFBFBD>adir");
|
||||||
|
InsertGuiPair(button_edit,"Editar");
|
||||||
|
InsertGuiPair(button_delete,"Borrar");
|
||||||
|
InsertGuiPair(button_clear,"C");
|
||||||
|
InsertGuiPair(tab_standard,"Standard");
|
||||||
|
InsertGuiPair(tab_variables,"Variables");
|
||||||
|
InsertGuiPair(tab_functions,"Funciones");
|
||||||
|
InsertGuiPair(tab_precision,"Precision");
|
||||||
|
InsertGuiPair(tab_display,"Pantalla");
|
||||||
|
InsertGuiPair(tab_convert,"Convertir");
|
||||||
|
|
||||||
|
InsertGuiPair(radio_precision_1,"Peque<EFBFBD>o - 96 bits para la mantissa, 32 bits para el exponente");
|
||||||
|
InsertGuiPair(radio_precision_2,"Mediano - 288 bits para la mantissa, 64 bits para el exponente");
|
||||||
|
InsertGuiPair(radio_precision_3,"Grande - 864 bits para la mantissa, 128 bits para el exponente");
|
||||||
|
|
||||||
|
|
||||||
|
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 digitos validos (decimal)");
|
||||||
|
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 digitos validos");
|
||||||
|
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 digitos");
|
||||||
|
|
||||||
|
InsertGuiPair(overflow_during_printing,"Sobredimensi<EFBFBD>n durante impresi<73>n");
|
||||||
|
|
||||||
|
InsertGuiPair(combo_rounding_none,"Ninguno");
|
||||||
|
InsertGuiPair(combo_rounding_integer,"a entero");
|
||||||
|
//InsertGuiPair(combo_rounding_to_number,"a numero");
|
||||||
|
// this text was too long (the combobox is shorter now) -- I'm not sure whether this is correct now... (I don't know spanish at all)
|
||||||
|
InsertGuiPair(combo_rounding_to_number,"a");
|
||||||
|
InsertGuiPair(combo_rounding_after_comma,"digito(s)");
|
||||||
|
InsertGuiPair(check_remove_zeroes,"Eliminar ceros no-significativos");
|
||||||
|
|
||||||
|
InsertGuiPair(display_input, "Entrada");
|
||||||
|
InsertGuiPair(display_output, "Salida");
|
||||||
|
InsertGuiPair(display_rounding, "Redondeo");
|
||||||
|
InsertGuiPair(display_always_scientific,"Siempre");
|
||||||
|
InsertGuiPair(display_not_always_scientific,"Cuando el exponente es mas grande que:");
|
||||||
|
InsertGuiPair(display_group_scientific, "Imprimir el resultado como valor cientifico");
|
||||||
|
InsertGuiPair(display_decimal_point, "Decimal point");
|
||||||
|
InsertGuiPair(display_deg_rad_grad, "sin/cos asin/acos");
|
||||||
|
InsertGuiPair(convert_type, "Tipo");
|
||||||
|
InsertGuiPair(convert_input, "Entrada");
|
||||||
|
InsertGuiPair(convert_output, "Salida");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "Auto prefijo");
|
||||||
|
|
||||||
|
InsertGuiPair(menu_view, "&Ver");
|
||||||
|
InsertGuiPair(menu_edit, "&Editar");
|
||||||
|
InsertGuiPair(menu_help, "&Ayuda");
|
||||||
|
InsertGuiPair(menu_language, "&Idioma");
|
||||||
|
InsertGuiPair(menu_view_new_window, "&Nueva ventana");
|
||||||
|
InsertGuiPair(menu_view_normal_view, "Vista No&rmal");
|
||||||
|
InsertGuiPair(menu_view_compact_view, "Vista C&ompacta");
|
||||||
|
InsertGuiPair(menu_view_always_on_top, "&Siempre arriba");
|
||||||
|
InsertGuiPair(menu_view_lang_english, "&Ingles");
|
||||||
|
InsertGuiPair(menu_view_lang_polish, "&Polaco");
|
||||||
|
InsertGuiPair(menu_view_lang_spanish, "&Espa<70>ol");
|
||||||
|
InsertGuiPair(menu_view_lang_danish, "&Dan<61>s"); // 'Dan<61>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_close_program, "&Close");
|
||||||
|
InsertGuiPair(menu_edit_undo, "&Deshacer");
|
||||||
|
InsertGuiPair(menu_edit_paste, "&Pegar");
|
||||||
|
InsertGuiPair(menu_edit_copy_result, "&Copiar resultado");
|
||||||
|
InsertGuiPair(menu_help_help, "&Ayuda");
|
||||||
|
InsertGuiPair(menu_help_project_page, "&Pagina del proyecto");
|
||||||
|
InsertGuiPair(menu_help_about, "&Acerca de");
|
||||||
|
InsertGuiPair(cant_init_calculations, "No se puede inicializar el modulo de calculo");
|
||||||
|
InsertGuiPair(message_box_error_caption,"TTCalc");
|
||||||
|
InsertGuiPair(cant_create_thread, "No se puede crear la segunda hebra para calcular");
|
||||||
|
InsertGuiPair(cant_create_main_window, "No se puede crear la ventana principal par ala aplicacion");
|
||||||
|
InsertGuiPair(cant_init_common_controls,"No se pueden inicializar los controles comunes (InitCommonControlsEx)");
|
||||||
|
InsertGuiPair(about_text,
|
||||||
|
"Calculadora matematica TTCalc %d.%d.%d%s%s\r\n"
|
||||||
|
"Autor: Tomasz Sowa\r\n"
|
||||||
|
"Contacto: t.sowa@ttmath.org\r\n"
|
||||||
|
"Licencia: BSD (open source)\r\n"
|
||||||
|
"Pagina del proyecto: http://ttcalc.sourceforge.net\r\n"
|
||||||
|
"Biblioteca Bignum: TTMath %d.%d.%d%s\r\n"
|
||||||
|
"Lenguaje de programacion: C++\r\n"
|
||||||
|
"Compilador: %s\r\n"
|
||||||
|
"%s" // for upx
|
||||||
|
"\r\n"
|
||||||
|
"TTCalc usa la biblioteca TTMath bignum"
|
||||||
|
" la cual puede ser encontrada en http://sourceforge.net/projects/ttmath\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#ifdef TTCALC_PORTABLE
|
||||||
|
"Esta es la version portatil del programa TTCalc. En esta version "
|
||||||
|
"se puede calcular con una precision tal que (96 bits para la "
|
||||||
|
"mantisa y 32 bits para el exponente) que es aproximadamente +/-6.9e+646457021.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#endif
|
||||||
|
"Si tienes preguntas, consejos o ideas interesantes sobre"
|
||||||
|
" este programa o si quieres unirte a este proyecto como"
|
||||||
|
" desarrollador o programador, no dudes en contactar con el autor."
|
||||||
|
);
|
||||||
|
InsertGuiPair(about_text_portable_version, " version portatil");
|
||||||
|
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
|
||||||
|
InsertGuiPair(about_box_title, "Acerca de");
|
||||||
|
InsertGuiPair(about_box_button_close, "Cerrar");
|
||||||
|
InsertGuiPair(unknown_error, "Ocurrio un error desconocido");
|
||||||
|
InsertGuiPair(cant_find_help, "No se encuentran los ficheros de ayuda");
|
||||||
|
InsertGuiPair(cant_open_project_page, "No se puede abrir la pagina dle proyecto");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
danish gui messages
|
||||||
|
*/
|
||||||
|
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
||||||
|
|
||||||
|
InsertGuiPair(button_ok,"Ok");
|
||||||
|
InsertGuiPair(button_cancel,"Anuller");
|
||||||
|
InsertGuiPair(message_box_caption,"TTCalc");
|
||||||
|
|
||||||
|
InsertGuiPair(dialog_box_add_variable_caption,"Tilf<EFBFBD>j en ny variabel");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_caption,"Rediger en variabel");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_name,"Et ukorrekt navn for variablen");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_value,"En ukorrekt v<>rdi for variablen");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_variable_exists,"Denne variabel eksisterer allerede");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_unknown_variable,"Der er ikke denne variabel i min tabel. Der er sandsynligvis en intern fejl!");
|
||||||
|
InsertGuiPair(dialog_box_delete_variable_confirm,"Vil du slette disse variabler?");
|
||||||
|
InsertGuiPair(dialog_box_variable_not_all_deleted,"Der er nogle variabler det ikke var mugligt at slette. Sandsynligvis en intern fejl!");
|
||||||
|
InsertGuiPair(dialog_box_add_function_caption,"Tilf<EFBFBD>j en ny funktion");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_caption,"Rediger en funktion");
|
||||||
|
InsertGuiPair(dialog_box_add_function_function_exists,"Denne funktion eksisterer allerede");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_unknown_function,"Der er ikke denne funktion i min tabel. Der er sandsynligvis en intern fejl!");
|
||||||
|
InsertGuiPair(dialog_box_delete_function_confirm,"Vil du slette disse funktioner?");
|
||||||
|
InsertGuiPair(dialog_box_function_not_all_deleted,"Der er nogle funktioner det ikke var mugligt at slette. Sandsynligvis en intern fejl!");
|
||||||
|
InsertGuiPair(dialog_box_add_function_incorrect_name,"Et ukorrekt navn for funktionen");
|
||||||
|
|
||||||
|
InsertGuiPair(list_variables_header_1,"Navn");
|
||||||
|
InsertGuiPair(list_variables_header_2,"V<EFBFBD>rdi");
|
||||||
|
InsertGuiPair(list_functions_header_1,"Navn");
|
||||||
|
InsertGuiPair(list_functions_header_2,"Param.");
|
||||||
|
InsertGuiPair(list_functions_header_3,"V<EFBFBD>rdi");
|
||||||
|
|
||||||
|
InsertGuiPair(button_add,"Tilf<EFBFBD>j");
|
||||||
|
InsertGuiPair(button_edit,"Rediger");
|
||||||
|
InsertGuiPair(button_delete,"Slet");
|
||||||
|
InsertGuiPair(button_clear,"C");
|
||||||
|
InsertGuiPair(tab_standard,"Standard");
|
||||||
|
InsertGuiPair(tab_variables,"Variabler");
|
||||||
|
InsertGuiPair(tab_functions,"Funktioner");
|
||||||
|
InsertGuiPair(tab_precision,"Pr<EFBFBD>cision");
|
||||||
|
InsertGuiPair(tab_display,"Visning");
|
||||||
|
InsertGuiPair(tab_convert,"Konverter");
|
||||||
|
|
||||||
|
InsertGuiPair(radio_precision_1,"Lille - 96 bits for mantissen, 32 bits for exponenten");
|
||||||
|
InsertGuiPair(radio_precision_2,"Mellem - 288 bits for mantissen, 64 bits for exponenten");
|
||||||
|
InsertGuiPair(radio_precision_3,"Stor - 864 bits for mantissen, 128 bits for exponenten");
|
||||||
|
|
||||||
|
|
||||||
|
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 gyldige cifre (decimaler)");
|
||||||
|
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 gyldige cifre");
|
||||||
|
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 cifre");
|
||||||
|
|
||||||
|
InsertGuiPair(overflow_during_printing,"Overflow under printning");
|
||||||
|
|
||||||
|
InsertGuiPair(combo_rounding_none,"Ingen");
|
||||||
|
InsertGuiPair(combo_rounding_integer,"til heltal");
|
||||||
|
InsertGuiPair(combo_rounding_to_number,"til");
|
||||||
|
InsertGuiPair(combo_rounding_after_comma,"ciffer(cifre)");
|
||||||
|
InsertGuiPair(check_remove_zeroes,"Fjern sidste overfl<66>dige nuller");
|
||||||
|
|
||||||
|
|
||||||
|
InsertGuiPair(display_input, "Input");
|
||||||
|
InsertGuiPair(display_output, "Output");
|
||||||
|
InsertGuiPair(display_rounding, "Afrunding");
|
||||||
|
InsertGuiPair(display_always_scientific,"Altid");
|
||||||
|
InsertGuiPair(display_not_always_scientific,"N<EFBFBD>r exponenten er st<73>rre end:");
|
||||||
|
InsertGuiPair(display_group_scientific, "Print resultatet som den videnskablige v<>rdi");
|
||||||
|
InsertGuiPair(display_decimal_point, "Decimal punkt");
|
||||||
|
InsertGuiPair(display_deg_rad_grad, "sin/cos asin/acos");
|
||||||
|
InsertGuiPair(convert_type, "Type");
|
||||||
|
InsertGuiPair(convert_input, "Input");
|
||||||
|
InsertGuiPair(convert_output, "Udput");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "Auto pr<70>fix");
|
||||||
|
|
||||||
|
InsertGuiPair(menu_view, "&Vis");
|
||||||
|
InsertGuiPair(menu_edit, "&Rediger");
|
||||||
|
InsertGuiPair(menu_help, "&Hj<48>lp");
|
||||||
|
InsertGuiPair(menu_language, "&Sprog");
|
||||||
|
InsertGuiPair(menu_view_new_window, "&Nyt vindue");
|
||||||
|
InsertGuiPair(menu_view_normal_view, "No&rmal visning");
|
||||||
|
InsertGuiPair(menu_view_compact_view, "K&ompakt visning");
|
||||||
|
InsertGuiPair(menu_view_always_on_top, "&Altid <20>verst");
|
||||||
|
InsertGuiPair(menu_view_lang_english, "&Engelsk");
|
||||||
|
InsertGuiPair(menu_view_lang_polish, "&Polsk");
|
||||||
|
InsertGuiPair(menu_view_lang_spanish, "&Spansk");
|
||||||
|
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_close_program, "&Afslut");
|
||||||
|
InsertGuiPair(menu_edit_undo, "&Fortryd");
|
||||||
|
InsertGuiPair(menu_edit_paste, "&S<>t ind");
|
||||||
|
InsertGuiPair(menu_edit_copy_result, "&Kopier resultatet");
|
||||||
|
InsertGuiPair(menu_help_help, "&Hj<48>lp");
|
||||||
|
InsertGuiPair(menu_help_project_page, "&Projekt side");
|
||||||
|
InsertGuiPair(menu_help_about, "&Om");
|
||||||
|
InsertGuiPair(cant_init_calculations, "Moduelt for uregninger kunne ikke s<>ttes i gang");
|
||||||
|
InsertGuiPair(message_box_error_caption,"TTCalc");
|
||||||
|
InsertGuiPair(cant_create_thread, "Den anden tr<74>d for udregning kunne ikke laves");
|
||||||
|
InsertGuiPair(cant_create_main_window, "Applikationens hovedvindue kunne ikke laves");
|
||||||
|
InsertGuiPair(cant_init_common_controls,"De f<>lles kontrol indstillinger kunne ikke s<>ttes i gang (InitCommonControlsEx)");
|
||||||
|
InsertGuiPair(about_text,
|
||||||
|
"Matematisk lommeregner TTCalc %d.%d.%d%s%s\r\n"
|
||||||
|
"Forfatter: Tomasz Sowa\r\n"
|
||||||
|
"Kontakt: t.sowa@ttmath.org\r\n"
|
||||||
|
"Licens: BSD (open source)\r\n"
|
||||||
|
"Projekt side: http://ttcalc.sourceforge.net\r\n"
|
||||||
|
"Bignum biblotek: TTMath %d.%d.%d%s\r\n"
|
||||||
|
"Programmerings sprog: C++\r\n"
|
||||||
|
"Kompilator: %s\r\n"
|
||||||
|
"%s" // for upx
|
||||||
|
"\r\n"
|
||||||
|
"TTCalc bruger TTMath bignum bibloteket"
|
||||||
|
" som kan findes ved http://sourceforge.net/projects/ttmath\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#ifdef TTCALC_PORTABLE
|
||||||
|
"Dette er den transportable version af programmet TTCalc. I denne version "
|
||||||
|
"kan du kun udregne med <20>n slags pr<70>cision (96 bits for "
|
||||||
|
"mantissen og 32 bits for exponenten) det er omkring +/-6.9e+646457021.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#endif
|
||||||
|
"Hvis du har sp<73>rgsm<73>l, gode r<>d eller interessante id<69>r vedr<64>rende"
|
||||||
|
" dette program eller hvis du vil tilslutte dig dette projekt som"
|
||||||
|
" en udvikler eller en programm<6D>r er du velkommen til at kontakte forfatteren."
|
||||||
|
);
|
||||||
|
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, "Luk");
|
||||||
|
InsertGuiPair(unknown_error, "Der er sket en ukendt fejl");
|
||||||
|
InsertGuiPair(cant_find_help, "Der kunne ikke findes nogen hj<68>lp filer");
|
||||||
|
InsertGuiPair(cant_open_project_page, "Projekt siden kunne ikke <20>bnes");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
chinese gui messages
|
||||||
|
*/
|
||||||
|
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
||||||
|
|
||||||
|
InsertGuiPair(button_ok,"ȷ<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(button_cancel,"ȡ<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(message_box_caption,"TTCalc");
|
||||||
|
|
||||||
|
InsertGuiPair(dialog_box_add_variable_caption,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_caption,"<EFBFBD>༭<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_name,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_value,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ֵ");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_variable_exists,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_unknown_variable,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д˱<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_delete_variable_confirm,"<EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_variable_not_all_deleted,"һЩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_function_caption,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>º<EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_caption,"<EFBFBD>༭<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_function_function_exists,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_unknown_function,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_delete_function_confirm,"<EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_function_not_all_deleted,"һЩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_function_incorrect_name,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(list_variables_header_1,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_variables_header_2,"ֵ");
|
||||||
|
InsertGuiPair(list_functions_header_1,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_functions_header_2,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_functions_header_3,"ֵ");
|
||||||
|
|
||||||
|
InsertGuiPair(button_add,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(button_edit,"<EFBFBD>༭");
|
||||||
|
InsertGuiPair(button_delete,"ɾ<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(button_clear,"C");
|
||||||
|
InsertGuiPair(tab_standard,"<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_variables,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_functions,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_precision,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_display,"<EFBFBD><EFBFBD>ʾ");
|
||||||
|
InsertGuiPair(tab_convert,"ת<EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(radio_precision_1,"С - 96 bits β<><CEB2>, 32 bits ָ<><D6B8>");
|
||||||
|
InsertGuiPair(radio_precision_2,"<EFBFBD><EFBFBD> - 288 bits β<><CEB2>, 64 bits ָ<><D6B8>");
|
||||||
|
InsertGuiPair(radio_precision_3,"<EFBFBD><EFBFBD> - 864 bits β<><CEB2>, 128 bits for ָ<><D6B8>");
|
||||||
|
|
||||||
|
|
||||||
|
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26λ<36><CEBB>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>(ʮ<><CAAE><EFBFBD><EFBFBD>)");
|
||||||
|
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85λ<35><CEBB>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258λ<38><CEBB>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(overflow_during_printing,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(combo_rounding_none,"<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(combo_rounding_integer,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(combo_rounding_to_number,"ת<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(combo_rounding_after_comma,"λ<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(check_remove_zeroes,"ȥ<EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(display_input, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_output, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_rounding, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_always_scientific,"һֱ");
|
||||||
|
InsertGuiPair(display_not_always_scientific,"<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
||||||
|
InsertGuiPair(display_group_scientific, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_decimal_point, "С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_deg_rad_grad, "sin/cos asin/acos");
|
||||||
|
InsertGuiPair(convert_type, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(convert_input, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(convert_output, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "<EFBFBD>Զ<EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(menu_view, "&<26>鿴");
|
||||||
|
InsertGuiPair(menu_edit, "&<26>༭");
|
||||||
|
InsertGuiPair(menu_help, "&<26><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_language, "&<26><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_new_window, "&<26>´<EFBFBD><C2B4><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_normal_view, "&<26><>ͨ<EFBFBD><CDA8>ͼ");
|
||||||
|
InsertGuiPair(menu_view_compact_view, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ");
|
||||||
|
InsertGuiPair(menu_view_always_on_top, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ");
|
||||||
|
InsertGuiPair(menu_view_lang_english, "&Ӣ<><D3A2>");
|
||||||
|
InsertGuiPair(menu_view_lang_polish, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_spanish, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_danish, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_chinese, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_russian, "&Russian");
|
||||||
|
InsertGuiPair(menu_view_close_program, "&<26>ر<EFBFBD>");
|
||||||
|
InsertGuiPair(menu_edit_undo, "&ȡ<><C8A1>");
|
||||||
|
InsertGuiPair(menu_edit_paste, "&ճ<><D5B3>");
|
||||||
|
InsertGuiPair(menu_edit_copy_result, "&<26><><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_help_help, "&<26><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_help_project_page, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ");
|
||||||
|
InsertGuiPair(menu_help_about, "&<26><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_init_calculations, "<EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(message_box_error_caption,"TTCalc");
|
||||||
|
InsertGuiPair(cant_create_thread, "<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_create_main_window, "<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_init_common_controls,"<EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD>ʼ<EFBFBD><EFBFBD>ͨ<EFBFBD>ÿؼ<EFBFBD>(InitCommonControlsEx)");
|
||||||
|
InsertGuiPair(about_text,
|
||||||
|
"Mathematical calculator TTCalc %d.%d.%d%s%s\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Tomasz Sowa\r\n"
|
||||||
|
"<EFBFBD><EFBFBD>ϵ: t.sowa@ttmath.org\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: BSD (<28><>Դ<EFBFBD><D4B4>Ŀ)\r\n"
|
||||||
|
"<EFBFBD><EFBFBD>ҳ: http://ttcalc.sourceforge.net\r\n"
|
||||||
|
"Bignum library: TTMath %d.%d.%d%s\r\n"
|
||||||
|
"Programming language: C++\r\n"
|
||||||
|
"Compiler: %s\r\n"
|
||||||
|
"%s" // for upx
|
||||||
|
"\r\n"
|
||||||
|
"TTCalc uses the TTMath bignum library"
|
||||||
|
" which can be found at http://sourceforge.net/projects/ttmath\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#ifdef TTCALC_PORTABLE
|
||||||
|
"This is the portable version of the program TTCalc. In this version "
|
||||||
|
"you can calculate only with one kind of precision (96 bits for the "
|
||||||
|
"mantissa and 32 bits for the exponent) it's about +/-6.9e+646457021.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#endif
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κδ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⡢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD>뷨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뿪<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>"
|
||||||
|
);
|
||||||
|
InsertGuiPair(about_text_portable_version, " portable version");
|
||||||
|
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
|
||||||
|
InsertGuiPair(about_box_title, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(about_box_button_close, "<EFBFBD>ر<EFBFBD>");
|
||||||
|
InsertGuiPair(unknown_error, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ֪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_find_help, "û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>");
|
||||||
|
InsertGuiPair(cant_open_project_page, "<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
russian gui messages
|
||||||
|
*/
|
||||||
|
gui_messages_tab.push_back( std::map<GuiMsg, std::string>() );
|
||||||
|
|
||||||
|
InsertGuiPair(button_ok,"Ok");
|
||||||
|
InsertGuiPair(button_cancel,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(message_box_caption,"TTCalc");
|
||||||
|
|
||||||
|
InsertGuiPair(dialog_box_add_variable_caption,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_caption,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_name,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_incorrect_value,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_variable_variable_exists,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_variable_unknown_variable,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
||||||
|
InsertGuiPair(dialog_box_delete_variable_confirm,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?");
|
||||||
|
InsertGuiPair(dialog_box_variable_not_all_deleted,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
||||||
|
InsertGuiPair(dialog_box_add_function_caption,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_caption,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_add_function_function_exists,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(dialog_box_edit_function_unknown_function,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
||||||
|
InsertGuiPair(dialog_box_delete_function_confirm,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?");
|
||||||
|
InsertGuiPair(dialog_box_function_not_all_deleted,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
||||||
|
InsertGuiPair(dialog_box_add_function_incorrect_name,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(list_variables_header_1,"<EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_variables_header_2,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_functions_header_1,"<EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_functions_header_2,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(list_functions_header_3,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(button_add,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(button_edit,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(button_delete,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(button_clear,"C");
|
||||||
|
InsertGuiPair(tab_standard,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_variables,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_functions,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_precision,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_display,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(tab_convert,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(radio_precision_1,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 96 <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 32 <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(radio_precision_2,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 288 <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 64 <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(radio_precision_3,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 864 <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 128 <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
|
||||||
|
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)");
|
||||||
|
InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 <20><><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(overflow_during_printing,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(combo_rounding_none,"<EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(combo_rounding_integer,"<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(combo_rounding_to_number,"<EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(combo_rounding_after_comma,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(check_remove_zeroes,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(display_input, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_output, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_rounding, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_always_scientific,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_not_always_scientific,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_group_scientific, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_decimal_point, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(display_deg_rad_grad, "sin/cos asin/acos");
|
||||||
|
InsertGuiPair(convert_type, "<EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(convert_input, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(convert_output, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
|
InsertGuiPair(menu_view, "&<26><><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_edit, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_help, "<EFBFBD>&<26><><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_language, "&<26><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_new_window, "&<26><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_normal_view, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_compact_view, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_always_on_top, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_english, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_polish, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_spanish, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_danish, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_chinese, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_lang_russian, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_view_close_program, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_edit_undo, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_edit_paste, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_edit_copy_result, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_help_help, "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_help_project_page, "&<26><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(menu_help_about, "&<26> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_init_calculations, "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(message_box_error_caption,"TTCalc");
|
||||||
|
InsertGuiPair(cant_create_thread, "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_create_main_window, "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_init_common_controls,"<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (InitCommonControlsEx)");
|
||||||
|
InsertGuiPair(about_text,
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TTCalc %d.%d.%d%s%s\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Tomasz Sowa\r\n"
|
||||||
|
"e-mail: t.sowa@ttmath.org\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: BSD (open source)\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: http://ttcalc.sourceforge.net\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Bignum: TTMath %d.%d.%d%s\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: C++\r\n"
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %s\r\n"
|
||||||
|
"%s" // for upx
|
||||||
|
"\r\n"
|
||||||
|
"TTCalc <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> TTMath,"
|
||||||
|
" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>: http://sourceforge.net/projects/ttmath\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#ifdef TTCALC_PORTABLE
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (96 <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,"
|
||||||
|
" 32 <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><> <20><><EFBFBD><EFBFBD> +/-6.9e+646457021.\r\n"
|
||||||
|
"\r\n"
|
||||||
|
#endif
|
||||||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>"
|
||||||
|
" <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||||
|
" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>a, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
||||||
|
);
|
||||||
|
InsertGuiPair(about_text_portable_version, " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(about_text_exe_packer, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EXE: UPX 3.03\r\n");
|
||||||
|
InsertGuiPair(about_box_title, "<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(about_box_button_close, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(unknown_error, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_find_help, "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
InsertGuiPair(cant_open_project_page, "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <ttmath/ttmathtypes.h>
|
#include "bigtypes.h"
|
||||||
|
|
||||||
|
|
||||||
class Languages
|
class Languages
|
||||||
@@ -83,6 +83,7 @@ public:
|
|||||||
tab_functions,
|
tab_functions,
|
||||||
tab_precision,
|
tab_precision,
|
||||||
tab_display,
|
tab_display,
|
||||||
|
tab_convert,
|
||||||
radio_precision_1,
|
radio_precision_1,
|
||||||
radio_precision_2,
|
radio_precision_2,
|
||||||
radio_precision_3,
|
radio_precision_3,
|
||||||
@@ -91,15 +92,21 @@ public:
|
|||||||
precision_3_info,
|
precision_3_info,
|
||||||
overflow_during_printing,
|
overflow_during_printing,
|
||||||
combo_rounding_none,
|
combo_rounding_none,
|
||||||
combo_rounding_cut_last_digits,
|
|
||||||
combo_rounding_integer,
|
combo_rounding_integer,
|
||||||
combo_rounding_to_number,
|
combo_rounding_to_number,
|
||||||
combo_rounding_after_comma,
|
combo_rounding_after_comma,
|
||||||
|
check_remove_zeroes,
|
||||||
display_input,
|
display_input,
|
||||||
display_output,
|
display_output,
|
||||||
display_rounding,
|
display_rounding,
|
||||||
display_always_scientific,
|
display_always_scientific,
|
||||||
display_not_always_scientific,
|
display_not_always_scientific,
|
||||||
|
display_decimal_point,
|
||||||
|
display_deg_rad_grad,
|
||||||
|
convert_type,
|
||||||
|
convert_input,
|
||||||
|
convert_output,
|
||||||
|
convert_dynamic_output,
|
||||||
menu_view,
|
menu_view,
|
||||||
menu_edit,
|
menu_edit,
|
||||||
menu_help,
|
menu_help,
|
||||||
@@ -110,6 +117,10 @@ public:
|
|||||||
menu_view_always_on_top,
|
menu_view_always_on_top,
|
||||||
menu_view_lang_english,
|
menu_view_lang_english,
|
||||||
menu_view_lang_polish,
|
menu_view_lang_polish,
|
||||||
|
menu_view_lang_spanish,
|
||||||
|
menu_view_lang_danish,
|
||||||
|
menu_view_lang_chinese,
|
||||||
|
menu_view_lang_russian,
|
||||||
menu_view_close_program,
|
menu_view_close_program,
|
||||||
menu_edit_undo,
|
menu_edit_undo,
|
||||||
menu_edit_paste,
|
menu_edit_paste,
|
||||||
@@ -125,6 +136,8 @@ public:
|
|||||||
cant_find_help,
|
cant_find_help,
|
||||||
cant_open_project_page,
|
cant_open_project_page,
|
||||||
about_text,
|
about_text,
|
||||||
|
about_text_portable_version,
|
||||||
|
about_text_exe_packer,
|
||||||
about_box_title,
|
about_box_title,
|
||||||
about_box_button_close,
|
about_box_button_close,
|
||||||
display_group_scientific,
|
display_group_scientific,
|
||||||
@@ -136,9 +149,14 @@ public:
|
|||||||
// (after conversion to 'int' we pass it into the std::vector)
|
// (after conversion to 'int' we pass it into the std::vector)
|
||||||
enum Country
|
enum Country
|
||||||
{
|
{
|
||||||
en = 0, pl
|
en = 0, pl, sp, da, chn, ru
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TTMathBigMax foo_return;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Country current_country;
|
Country current_country;
|
||||||
@@ -152,13 +170,16 @@ private:
|
|||||||
void InsertGuiPair(GuiMsg code, const char * message);
|
void InsertGuiPair(GuiMsg code, const char * message);
|
||||||
void InitGuiMessagesTab();
|
void InitGuiMessagesTab();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Languages()
|
Languages()
|
||||||
{
|
{
|
||||||
current_country = en;
|
current_country = en;
|
||||||
|
// foo_return = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetCurrentLanguage(Country c)
|
void SetCurrentLanguage(Country c)
|
||||||
@@ -171,11 +192,47 @@ public:
|
|||||||
return current_country;
|
return current_country;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
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
|
||||||
|
*/
|
||||||
const char * ErrorMessage(Country country, ttmath::ErrorCode code);
|
const char * ErrorMessage(Country country, ttmath::ErrorCode code);
|
||||||
const char * ErrorMessage(ttmath::ErrorCode code);
|
|
||||||
const char * GuiMessage(Country country, GuiMsg code);
|
const char * GuiMessage(Country country, GuiMsg code);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
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);
|
const char * GuiMessage(GuiMsg code);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -238,6 +238,114 @@ return false;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ToLower(int c)
|
||||||
|
{
|
||||||
|
if( c>='A' && c<='Z' )
|
||||||
|
return c - 'A' + 'a';
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
this function compares two strings
|
||||||
|
(case insensitive)
|
||||||
|
*/
|
||||||
|
bool EqualStrings(const char * str1, const char * str2)
|
||||||
|
{
|
||||||
|
for( ; ToLower(*str1) == ToLower(*str2) ; ++str1, ++str2 )
|
||||||
|
if( *str1 == 0 )
|
||||||
|
return true; // *str2 will be 0 too
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
this function is called when CTRL+C has been pressed
|
||||||
|
|
||||||
|
we're testing what type of control has a focus
|
||||||
|
if it is not an edit control we will copy the result from the output edit
|
||||||
|
and if is is an edit control we're checking whether the edit has a selecion or not,
|
||||||
|
if it has not a selection we will copy the result otherwise we return 'false'
|
||||||
|
and the CTRL+C will be passed into the standard procedure
|
||||||
|
*/
|
||||||
|
bool CopyResult()
|
||||||
|
{
|
||||||
|
char buffer[30];
|
||||||
|
DWORD sel_start, sel_end;
|
||||||
|
HWND focus = GetFocus();
|
||||||
|
bool copy = true;
|
||||||
|
|
||||||
|
GetClassName( focus, buffer, sizeof(buffer)/sizeof(char) );
|
||||||
|
|
||||||
|
if( EqualStrings(buffer, "edit") )
|
||||||
|
{
|
||||||
|
SendMessage(focus, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
|
||||||
|
|
||||||
|
if( sel_start != sel_end )
|
||||||
|
// the control has a selection
|
||||||
|
copy = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( copy )
|
||||||
|
{
|
||||||
|
// the control has no selection
|
||||||
|
HWND main_window = GetPrgRes()->GetMainWindow();
|
||||||
|
HWND output_edit = GetDlgItem(main_window, IDC_OUTPUT_EDIT);
|
||||||
|
DWORD out_sel_start, out_sel_end;
|
||||||
|
|
||||||
|
// we're getting the selection on the output edit
|
||||||
|
// there may be no selection
|
||||||
|
SendMessage(output_edit, EM_GETSEL, (WPARAM)&out_sel_start, (LPARAM)&out_sel_end);
|
||||||
|
// setting the selection for the whole control
|
||||||
|
SendMessage(output_edit, EM_SETSEL, 0, -1);
|
||||||
|
// copying the result
|
||||||
|
SendMessage(output_edit, WM_COPY, 0, 0);
|
||||||
|
// and restoring the selection to the previous state
|
||||||
|
SendMessage(output_edit, EM_SETSEL, out_sel_start, out_sel_end);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
this function is called when CTRL+V has been pressed
|
||||||
|
|
||||||
|
if a focus is not on an edit control (or it can be on an edit
|
||||||
|
but the edit must be read only) we're sending WM_PASTE into the
|
||||||
|
input edit and setting a focus on it
|
||||||
|
*/
|
||||||
|
bool Paste()
|
||||||
|
{
|
||||||
|
char buffer[30];
|
||||||
|
HWND focus = GetFocus();
|
||||||
|
|
||||||
|
GetClassName( focus, buffer, sizeof(buffer)/sizeof(char) );
|
||||||
|
|
||||||
|
if( EqualStrings(buffer, "edit") )
|
||||||
|
{
|
||||||
|
if( (GetWindowLong(focus, GWL_STYLE) & ES_READONLY) == 0 )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// it's an edit but it has ES_READONLY style set
|
||||||
|
}
|
||||||
|
|
||||||
|
HWND main_window = GetPrgRes()->GetMainWindow();
|
||||||
|
HWND input_edit = GetDlgItem(main_window, IDC_INPUT_EDIT);
|
||||||
|
|
||||||
|
SendMessage(input_edit, WM_PASTE, 0, 0);
|
||||||
|
SetFocus(input_edit);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SetActiveTab(unsigned int i)
|
void SetActiveTab(unsigned int i)
|
||||||
{
|
{
|
||||||
static int last_shown_dialog = -1;
|
static int last_shown_dialog = -1;
|
||||||
@@ -296,6 +404,10 @@ HMENU menu = GetMenu(hWnd);
|
|||||||
SetMenuLanguageItem(menu, IDM_ALWAYS_ON_TOP, Languages::menu_view_always_on_top);
|
SetMenuLanguageItem(menu, IDM_ALWAYS_ON_TOP, Languages::menu_view_always_on_top);
|
||||||
SetMenuLanguageItem(menu, IDM_LANGUAGE_ENGLISH, Languages::menu_view_lang_english);
|
SetMenuLanguageItem(menu, IDM_LANGUAGE_ENGLISH, Languages::menu_view_lang_english);
|
||||||
SetMenuLanguageItem(menu, IDM_LANGUAGE_POLISH, Languages::menu_view_lang_polish);
|
SetMenuLanguageItem(menu, IDM_LANGUAGE_POLISH, Languages::menu_view_lang_polish);
|
||||||
|
SetMenuLanguageItem(menu, IDM_LANGUAGE_SPANISH, Languages::menu_view_lang_spanish);
|
||||||
|
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_CLOSE_PROGRAM, Languages::menu_view_close_program);
|
SetMenuLanguageItem(menu, IDM_CLOSE_PROGRAM, Languages::menu_view_close_program);
|
||||||
SetMenuLanguageItem(menu, IDM_EDIT_UNDO, Languages::menu_edit_undo);
|
SetMenuLanguageItem(menu, IDM_EDIT_UNDO, Languages::menu_edit_undo);
|
||||||
SetMenuLanguageItem(menu, IDM_EDIT_PASTE, Languages::menu_edit_paste);
|
SetMenuLanguageItem(menu, IDM_EDIT_PASTE, Languages::menu_edit_paste);
|
||||||
@@ -310,21 +422,23 @@ HMENU menu = GetMenu(hWnd);
|
|||||||
|
|
||||||
void WmInitDialogCalculateMainWindowSize(HWND hTab)
|
void WmInitDialogCalculateMainWindowSize(HWND hTab)
|
||||||
{
|
{
|
||||||
RECT r;
|
RECT r_tab, r_main, r_edit2;
|
||||||
|
|
||||||
GetWindowRect(hTab, &r);
|
GetWindowRect(hTab, &r_tab);
|
||||||
|
|
||||||
int cy_caption = GetSystemMetrics(SM_CYCAPTION);
|
HWND main = GetPrgRes()->GetMainWindow();
|
||||||
|
GetWindowRect(main, &r_main);
|
||||||
|
|
||||||
int cy_add = 2 * GetSystemMetrics(SM_CYDLGFRAME) +
|
HWND output_edit = GetDlgItem(main, IDC_OUTPUT_EDIT);
|
||||||
GetSystemMetrics(SM_CYMENU);
|
GetWindowRect(output_edit, &r_edit2);
|
||||||
|
|
||||||
int cx_add = 2 * GetSystemMetrics(SM_CXDLGFRAME) +
|
int cy_compact = (r_edit2.bottom - r_main.top) + GetSystemMetrics(SM_CYSIZEFRAME);
|
||||||
r.right - r.left;
|
int cy_normal = (r_tab.bottom - r_tab.top) + (r_tab.top - r_main.top) + GetSystemMetrics(SM_CYSIZEFRAME) + 8;
|
||||||
|
int cx = r_tab.right - r_tab.left + 2 * GetSystemMetrics(SM_CXSIZEFRAME);
|
||||||
|
|
||||||
GetPrgRes()->SetYSizeNormal ( 225 + cy_add + cy_caption * 2);
|
GetPrgRes()->SetYSizeNormal ( cy_normal );
|
||||||
GetPrgRes()->SetYSizeCompact( 59 + cy_add + cy_caption );
|
GetPrgRes()->SetYSizeCompact( cy_compact );
|
||||||
GetPrgRes()->SetXSizeMin ( 4 + cx_add );
|
GetPrgRes()->SetXSizeMin ( cx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -347,14 +461,18 @@ DLGTEMPLATE * tab1template = (DLGTEMPLATE*)LockResource(tab1global);
|
|||||||
|
|
||||||
int frame_cx = GetSystemMetrics(SM_CXEDGE);
|
int frame_cx = GetSystemMetrics(SM_CXEDGE);
|
||||||
int frame_cy = GetSystemMetrics(SM_CYEDGE);
|
int frame_cy = GetSystemMetrics(SM_CYEDGE);
|
||||||
int caption_cy = GetSystemMetrics(SM_CYCAPTION)+10; // the caption plus some white space
|
int space = 10; // some more space between the tab items and child tabs
|
||||||
|
|
||||||
|
RECT tab_item_r;
|
||||||
|
TabCtrl_GetItemRect(hTab, 0, &tab_item_r);
|
||||||
|
int tab_item = tab_item_r.bottom;
|
||||||
|
|
||||||
RECT r;
|
RECT r;
|
||||||
GetWindowRect(hTab, &r);
|
GetWindowRect(hTab, &r);
|
||||||
|
|
||||||
SetWindowPos(hDialog, HWND_TOP, frame_cx, frame_cy + caption_cy,
|
SetWindowPos(hDialog, HWND_TOP, frame_cx, frame_cy + tab_item + space,
|
||||||
r.right-r.left- 2*frame_cx,
|
r.right-r.left- 2*frame_cx,
|
||||||
r.bottom-r.top- 2*frame_cy - caption_cy, 0);
|
r.bottom-r.top- 2*frame_cy - tab_item - space, 0);
|
||||||
|
|
||||||
return hDialog;
|
return hDialog;
|
||||||
}
|
}
|
||||||
@@ -383,33 +501,71 @@ TCITEM tab_item;
|
|||||||
// the name of a tab we'll set when we call the 'SetLanguage()' function
|
// the name of a tab we'll set when we call the 'SetLanguage()' function
|
||||||
tab_item.mask = 0;
|
tab_item.mask = 0;
|
||||||
|
|
||||||
tab_standard = 0;
|
int tab_inc = 0;
|
||||||
tab_variables = 1;
|
|
||||||
tab_functions = 2;
|
tab_standard = tab_inc++;
|
||||||
tab_precision = 3;
|
tab_variables = tab_inc++;
|
||||||
tab_display = 4;
|
tab_functions = tab_inc++;
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
tab_precision = tab_inc++;
|
||||||
|
#else
|
||||||
|
tab_precision = -1; // this one will not be used
|
||||||
|
#endif
|
||||||
|
|
||||||
|
tab_display = tab_inc++;
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
tab_convert = tab_inc++;
|
||||||
|
#else
|
||||||
|
tab_convert = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
// this insertion must be in the ascending order
|
// this insertion must be in the ascending order
|
||||||
// (the second parameter of 'TabCtrl_InsertItem')
|
// (the second parameter of 'TabCtrl_InsertItem')
|
||||||
TabCtrl_InsertItem(hTab, tab_standard, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_standard, &tab_item);
|
||||||
TabCtrl_InsertItem(hTab, tab_variables, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_variables, &tab_item);
|
||||||
TabCtrl_InsertItem(hTab, tab_functions, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_functions, &tab_item);
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
TabCtrl_InsertItem(hTab, tab_precision, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_precision, &tab_item);
|
||||||
|
#endif
|
||||||
|
|
||||||
TabCtrl_InsertItem(hTab, tab_display, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_display, &tab_item);
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
TabCtrl_InsertItem(hTab, tab_convert, &tab_item);
|
||||||
|
#endif
|
||||||
|
|
||||||
WmInitDialogCreateTab(hTab, tab_standard, IDD_DIALOG_STANDARD, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_standard, IDD_DIALOG_STANDARD, TabWindowProc);
|
||||||
WmInitDialogCreateTab(hTab, tab_variables, IDD_DIALOG_VARIABLES, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_variables, IDD_DIALOG_VARIABLES, TabWindowProc);
|
||||||
WmInitDialogCreateTab(hTab, tab_functions, IDD_DIALOG_FUNCTIONS, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_functions, IDD_DIALOG_FUNCTIONS, TabWindowProc);
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
WmInitDialogCreateTab(hTab, tab_precision, IDD_DIALOG_PRECISION, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_precision, IDD_DIALOG_PRECISION, TabWindowProc);
|
||||||
|
#endif
|
||||||
|
|
||||||
WmInitDialogCreateTab(hTab, tab_display, IDD_DIALOG_DISPLAY, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_display, IDD_DIALOG_DISPLAY, TabWindowProc);
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
WmInitDialogCreateTab(hTab, tab_convert, IDD_DIALOG_CONVERT, TabWindowProc);
|
||||||
|
#endif
|
||||||
|
|
||||||
SetSizeOfDialogs();
|
SetSizeOfDialogs();
|
||||||
|
|
||||||
SendMessage(GetPrgRes()->GetTabWindow(tab_variables), WM_INIT_TAB_VARIABLES, 0,0);
|
SendMessage(GetPrgRes()->GetTabWindow(tab_variables), WM_INIT_TAB_VARIABLES, 0,0);
|
||||||
SendMessage(GetPrgRes()->GetTabWindow(tab_functions), WM_INIT_TAB_FUNCTIONS, 0,0);
|
SendMessage(GetPrgRes()->GetTabWindow(tab_functions), WM_INIT_TAB_FUNCTIONS, 0,0);
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
SendMessage(GetPrgRes()->GetTabWindow(tab_precision), WM_INIT_TAB_PRECISION, 0,0);
|
SendMessage(GetPrgRes()->GetTabWindow(tab_precision), WM_INIT_TAB_PRECISION, 0,0);
|
||||||
|
#endif
|
||||||
|
|
||||||
SendMessage(GetPrgRes()->GetTabWindow(tab_display), WM_INIT_TAB_DISPLAY, 0,0);
|
SendMessage(GetPrgRes()->GetTabWindow(tab_display), WM_INIT_TAB_DISPLAY, 0,0);
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
SendMessage(GetPrgRes()->GetTabWindow(tab_convert), WM_INIT_TAB_CONVERT, 0,0);
|
||||||
|
#endif
|
||||||
|
|
||||||
TabWindowFunctions::SetLanguage(hTab);
|
TabWindowFunctions::SetLanguage(hTab);
|
||||||
|
|
||||||
TabCtrl_SetCurSel(hTab, tab_standard);
|
TabCtrl_SetCurSel(hTab, tab_standard);
|
||||||
@@ -427,7 +583,7 @@ HWND hTab = GetDlgItem(hWnd,IDC_TAB);
|
|||||||
WmInitDialogCalculateMainWindowSize(hTab);
|
WmInitDialogCalculateMainWindowSize(hTab);
|
||||||
WmInitDialogCreateAndInitTabs(hTab);
|
WmInitDialogCreateAndInitTabs(hTab);
|
||||||
|
|
||||||
HICON program_icon = LoadIcon(GetPrgRes()->GetInstance(),MAKEINTRESOURCE(IDI_ICON1));
|
HICON program_icon = LoadIcon(GetPrgRes()->GetInstance(),MAKEINTRESOURCE(IDI_ICON2));
|
||||||
if( program_icon )
|
if( program_icon )
|
||||||
SendMessage(hWnd,WM_SETICON,ICON_BIG,(LPARAM)program_icon);
|
SendMessage(hWnd,WM_SETICON,ICON_BIG,(LPARAM)program_icon);
|
||||||
|
|
||||||
@@ -484,7 +640,6 @@ MINMAXINFO * lpmmi = (LPMINMAXINFO) lParam;
|
|||||||
if( GetPrgRes()->GetView() == ProgramResources::view_normal )
|
if( GetPrgRes()->GetView() == ProgramResources::view_normal )
|
||||||
{
|
{
|
||||||
lpmmi->ptMinTrackSize.y = GetPrgRes()->GetYSizeNormal();
|
lpmmi->ptMinTrackSize.y = GetPrgRes()->GetYSizeNormal();
|
||||||
//lpmmi->ptMaxTrackSize.y = cy_normalny;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{// kompaktowy
|
{// kompaktowy
|
||||||
@@ -551,31 +706,34 @@ POINT p;
|
|||||||
if( fwSizeType == SIZE_RESTORED )
|
if( fwSizeType == SIZE_RESTORED )
|
||||||
GetPrgRes()->SetMaximized(false);
|
GetPrgRes()->SetMaximized(false);
|
||||||
|
|
||||||
|
// client area
|
||||||
int cx = LOWORD(lParam);
|
int cx = LOWORD(lParam);
|
||||||
int cy = HIWORD(lParam);
|
int cy = HIWORD(lParam);
|
||||||
|
int resize_flags = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||||
|
|
||||||
GetWindowRect(GetDlgItem(hWnd,IDC_INPUT_EDIT),&r);
|
HWND input_edit = GetDlgItem(hWnd, IDC_INPUT_EDIT);
|
||||||
|
GetWindowRect(input_edit, &r);
|
||||||
|
SetWindowPos(input_edit, 0, 0, 0, cx, r.bottom-r.top, resize_flags);
|
||||||
|
|
||||||
|
HWND output_edit = GetDlgItem(hWnd, IDC_OUTPUT_EDIT);
|
||||||
|
GetWindowRect(output_edit, &r);
|
||||||
|
SetWindowPos(output_edit, 0, 0, 0, cx, r.bottom-r.top, resize_flags);
|
||||||
|
|
||||||
|
HWND tab = GetDlgItem(hWnd, IDC_TAB);
|
||||||
|
GetWindowRect(tab, &r);
|
||||||
p.x = r.left;
|
p.x = r.left;
|
||||||
p.y = r.top;
|
p.y = r.top;
|
||||||
ScreenToClient(hWnd,&p);
|
ScreenToClient(hWnd,&p);
|
||||||
MoveWindow(GetDlgItem(hWnd,IDC_INPUT_EDIT),p.x, p.y, cx, r.bottom-r.top, true);
|
SetWindowPos(tab, 0, 0, 0, cx, cy-p.y, resize_flags);
|
||||||
|
|
||||||
GetWindowRect(GetDlgItem(hWnd,IDC_OUTPUT_EDIT),&r);
|
int borderx = GetSystemMetrics(SM_CXDLGFRAME) * 2;
|
||||||
p.x = r.left;
|
int bordery = GetSystemMetrics(SM_CYDLGFRAME) * 2;
|
||||||
p.y = r.top;
|
|
||||||
ScreenToClient(hWnd,&p);
|
|
||||||
MoveWindow(GetDlgItem(hWnd,IDC_OUTPUT_EDIT),p.x, p.y, cx, r.bottom-r.top, true);
|
|
||||||
|
|
||||||
GetWindowRect(GetDlgItem(hWnd,IDC_TAB),&r);
|
TabWindowFunctions::SetSizeOfVariablesList(tab, cx, cy-p.y, borderx, bordery);
|
||||||
p.x = r.left;
|
TabWindowFunctions::SetSizeOfFunctionsList(tab, cx, cy-p.y, borderx, bordery);
|
||||||
p.y = r.top;
|
TabWindowFunctions::SetSizeOfConvertingLists(tab, cx, cy-p.y, borderx, bordery);
|
||||||
ScreenToClient(hWnd,&p);
|
|
||||||
MoveWindow(GetDlgItem(hWnd,IDC_TAB),p.x, p.y, cx, cy-p.y, true);
|
|
||||||
|
|
||||||
TabWindowFunctions::SetSizeOfVariablesList();
|
if( fwSizeType != SIZE_MINIMIZED && GetPrgRes()->GetView() != ProgramResources::view_compact )
|
||||||
TabWindowFunctions::SetSizeOfFunctionsList();
|
|
||||||
|
|
||||||
if( fwSizeType != SIZE_MINIMIZED )
|
|
||||||
{
|
{
|
||||||
GetWindowRect(hWnd,&r);
|
GetWindowRect(hWnd,&r);
|
||||||
GetPrgRes()->SetXSize( r.right - r.left );
|
GetPrgRes()->SetXSize( r.right - r.left );
|
||||||
@@ -604,16 +762,36 @@ void WmInitMenuPopUpView(HMENU menu)
|
|||||||
CheckMenuItem(menu,IDM_NORMAL_VIEW,MF_BYCOMMAND|MF_UNCHECKED);
|
CheckMenuItem(menu,IDM_NORMAL_VIEW,MF_BYCOMMAND|MF_UNCHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( GetPrgRes()->GetLanguages()->GetCurrentLanguage() == Languages::en )
|
|
||||||
{
|
|
||||||
|
// languages
|
||||||
|
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_UNCHECKED);
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_UNCHECKED);
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_SPANISH, MF_BYCOMMAND|MF_UNCHECKED);
|
||||||
|
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);
|
||||||
|
|
||||||
|
Languages::Country lang = GetPrgRes()->GetLanguages()->GetCurrentLanguage();
|
||||||
|
|
||||||
|
if( lang == Languages::en )
|
||||||
CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_CHECKED);
|
CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_CHECKED);
|
||||||
CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_UNCHECKED);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
if( lang == Languages::pl )
|
||||||
CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_CHECKED);
|
CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_CHECKED);
|
||||||
CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_UNCHECKED);
|
else
|
||||||
}
|
if( lang == Languages::sp )
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_SPANISH, MF_BYCOMMAND|MF_CHECKED);
|
||||||
|
else
|
||||||
|
if( lang == Languages::da )
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_DANISH, MF_BYCOMMAND|MF_CHECKED);
|
||||||
|
else
|
||||||
|
if( lang == Languages::chn )
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_CHINESE, MF_BYCOMMAND|MF_CHECKED);
|
||||||
|
else
|
||||||
|
if( lang == Languages::ru )
|
||||||
|
CheckMenuItem(menu, IDM_LANGUAGE_RUSSIAN, MF_BYCOMMAND|MF_CHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -721,19 +899,13 @@ BOOL WmCommand_NewWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
|
||||||
GetPrgRes()->SetXPos( GetPrgRes()->GetXPos()+10 );
|
|
||||||
GetPrgRes()->SetYPos( GetPrgRes()->GetYPos()+10 );
|
|
||||||
GetPrgRes()->SaveToFile();
|
|
||||||
GetPrgRes()->SetXPos( GetPrgRes()->GetXPos()-10 );
|
|
||||||
GetPrgRes()->SetYPos( GetPrgRes()->GetYPos()-10 );
|
|
||||||
|
|
||||||
char * buffer = new char[MAX_PATH+1];
|
char * buffer = new char[MAX_PATH+1];
|
||||||
|
|
||||||
GetModuleFileName(GetPrgRes()->GetInstance(),buffer, MAX_PATH);
|
GetModuleFileName(GetPrgRes()->GetInstance(),buffer, MAX_PATH);
|
||||||
|
|
||||||
memset(&si,0,sizeof(si));
|
memset(&si,0,sizeof(si));
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
CreateProcess(buffer,"",0,0,false,NORMAL_PRIORITY_CLASS,0,0,&si,&pi);
|
CreateProcess(buffer,const_cast<char*>(""),0,0,false,NORMAL_PRIORITY_CLASS,0,0,&si,&pi);
|
||||||
|
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
|
|
||||||
@@ -871,6 +1043,52 @@ return true;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL WmCommand_LanguageSpanish(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::sp);
|
||||||
|
|
||||||
|
SetMenuLanguage(hWnd);
|
||||||
|
SetOutputEditLanguage(hWnd);
|
||||||
|
TabWindowFunctions::SetLanguage( GetDlgItem(hWnd, IDC_TAB) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WmCommand_LanguageDanish(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::da);
|
||||||
|
|
||||||
|
SetMenuLanguage(hWnd);
|
||||||
|
SetOutputEditLanguage(hWnd);
|
||||||
|
TabWindowFunctions::SetLanguage( GetDlgItem(hWnd, IDC_TAB) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WmCommand_LanguageChinese(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::chn);
|
||||||
|
|
||||||
|
SetMenuLanguage(hWnd);
|
||||||
|
SetOutputEditLanguage(hWnd);
|
||||||
|
TabWindowFunctions::SetLanguage( GetDlgItem(hWnd, IDC_TAB) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WmCommand_LanguageRussian(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::ru);
|
||||||
|
|
||||||
|
SetMenuLanguage(hWnd);
|
||||||
|
SetOutputEditLanguage(hWnd);
|
||||||
|
TabWindowFunctions::SetLanguage( GetDlgItem(hWnd, IDC_TAB) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOL WmHelp(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmHelp(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
SHELLEXECUTEINFO exec;
|
SHELLEXECUTEINFO exec;
|
||||||
@@ -904,7 +1122,8 @@ SHELLEXECUTEINFO exec;
|
|||||||
exec.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
|
exec.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
|
||||||
exec.hwnd = 0;
|
exec.hwnd = 0;
|
||||||
exec.lpVerb = "open";
|
exec.lpVerb = "open";
|
||||||
exec.lpFile = "http://sourceforge.net/projects/ttcalc";
|
//exec.lpFile = "http://sourceforge.net/projects/ttcalc";
|
||||||
|
exec.lpFile = "http://ttcalc.sourceforge.net";
|
||||||
exec.lpParameters = 0;
|
exec.lpParameters = 0;
|
||||||
exec.lpDirectory = "";
|
exec.lpDirectory = "";
|
||||||
exec.nShow = SW_SHOWNORMAL;
|
exec.nShow = SW_SHOWNORMAL;
|
||||||
@@ -936,6 +1155,10 @@ void CreateCommandMessagesTable(Messages & cmessages)
|
|||||||
cmessages.Associate(IDCANCEL, WmCommand_IDCANCEL);
|
cmessages.Associate(IDCANCEL, WmCommand_IDCANCEL);
|
||||||
cmessages.Associate(IDM_LANGUAGE_ENGLISH, WmCommand_LanguageEnglish);
|
cmessages.Associate(IDM_LANGUAGE_ENGLISH, WmCommand_LanguageEnglish);
|
||||||
cmessages.Associate(IDM_LANGUAGE_POLISH, WmCommand_LanguagePolish);
|
cmessages.Associate(IDM_LANGUAGE_POLISH, WmCommand_LanguagePolish);
|
||||||
|
cmessages.Associate(IDM_LANGUAGE_SPANISH, WmCommand_LanguageSpanish);
|
||||||
|
cmessages.Associate(IDM_LANGUAGE_DANISH, WmCommand_LanguageDanish);
|
||||||
|
cmessages.Associate(IDM_LANGUAGE_CHINESE, WmCommand_LanguageChinese);
|
||||||
|
cmessages.Associate(IDM_LANGUAGE_RUSSIAN, WmCommand_LanguageRussian);
|
||||||
cmessages.Associate(IDM_HELP_HELP, WmHelp);
|
cmessages.Associate(IDM_HELP_HELP, WmHelp);
|
||||||
cmessages.Associate(IDM_HELP_PROJECT_PAGE, WmProjectPage);
|
cmessages.Associate(IDM_HELP_PROJECT_PAGE, WmProjectPage);
|
||||||
}
|
}
|
||||||
@@ -978,7 +1201,7 @@ void CreateMainMessagesTable(Messages & messages)
|
|||||||
*/
|
*/
|
||||||
void CreateAboutText(char * buffer)
|
void CreateAboutText(char * buffer)
|
||||||
{
|
{
|
||||||
char compiler[30];
|
char compiler[50];
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
||||||
@@ -1032,10 +1255,21 @@ char compiler[30];
|
|||||||
buffer,
|
buffer,
|
||||||
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text),
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text),
|
||||||
TTCALC_MAJOR_VER, TTCALC_MINOR_VER, TTCALC_REVISION_VER,
|
TTCALC_MAJOR_VER, TTCALC_MINOR_VER, TTCALC_REVISION_VER,
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
"",
|
||||||
|
#else
|
||||||
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text_portable_version),
|
||||||
|
#endif
|
||||||
(TTCALC_PRERELEASE_VER!=0)? " (prerelease)" : "",
|
(TTCALC_PRERELEASE_VER!=0)? " (prerelease)" : "",
|
||||||
TTMATH_MAJOR_VER, TTMATH_MINOR_VER, TTMATH_REVISION_VER,
|
TTMATH_MAJOR_VER, TTMATH_MINOR_VER, TTMATH_REVISION_VER,
|
||||||
(TTMATH_PRERELEASE_VER!=0)? " (prerelease)" : "",
|
(TTMATH_PRERELEASE_VER!=0)? " (prerelease)" : "",
|
||||||
compiler);
|
compiler,
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
""
|
||||||
|
#else
|
||||||
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text_exe_packer)
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "compileconfig.h"
|
#include "compileconfig.h"
|
||||||
#include "parsermanager.h"
|
#include "parsermanager.h"
|
||||||
|
#include "tabs.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -47,22 +48,28 @@ ParserManager::ParserManager() : buffer_len(2048)
|
|||||||
base_input = base_output = 10;
|
base_input = base_output = 10;
|
||||||
always_scientific = 0;
|
always_scientific = 0;
|
||||||
when_scientific = 15;
|
when_scientific = 15;
|
||||||
rounding = -2;
|
rounding = -1;
|
||||||
|
remove_zeroes = true;
|
||||||
|
last_variables_id = 0;
|
||||||
|
last_functions_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ParserManager::ParserManager(const ParserManager & p) : buffer_len(p.buffer_len)
|
ParserManager::ParserManager(const ParserManager & p) : buffer_len(p.buffer_len)
|
||||||
{
|
{
|
||||||
buffer = 0;
|
buffer = 0;
|
||||||
base_input = p.base_input;
|
base_input = p.base_input;
|
||||||
base_output = p.base_output;
|
base_output = p.base_output;
|
||||||
always_scientific = p.always_scientific;
|
always_scientific = p.always_scientific;
|
||||||
when_scientific = p.when_scientific;
|
when_scientific = p.when_scientific;
|
||||||
rounding = p.rounding;
|
rounding = p.rounding;
|
||||||
|
remove_zeroes = p.remove_zeroes;
|
||||||
|
last_variables_id = p.last_variables_id;
|
||||||
|
last_functions_id = p.last_functions_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ParserManager & ParserManager::operator=(const ParserManager & p)
|
ParserManager & ParserManager::operator=(const ParserManager &)
|
||||||
{
|
{
|
||||||
buffer = 0;
|
buffer = 0;
|
||||||
|
|
||||||
@@ -86,23 +93,36 @@ ttmath::ErrorCode ParserManager::Parse()
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
switch( precision )
|
switch( precision )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
parser1.SetBase(base_input);
|
parser1.SetBase(base_input);
|
||||||
|
parser1.SetDegRadGrad(angle_deg_rad_grad);
|
||||||
code = parser1.Parse(buffer);
|
code = parser1.Parse(buffer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
parser2.SetBase(base_input);
|
parser2.SetBase(base_input);
|
||||||
|
parser2.SetDegRadGrad(angle_deg_rad_grad);
|
||||||
code = parser2.Parse(buffer);
|
code = parser2.Parse(buffer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
parser3.SetBase(base_input);
|
parser3.SetBase(base_input);
|
||||||
|
parser3.SetDegRadGrad(angle_deg_rad_grad);
|
||||||
code = parser3.Parse(buffer);
|
code = parser3.Parse(buffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
parser1.SetBase(base_input);
|
||||||
|
parser1.SetDegRadGrad(angle_deg_rad_grad);
|
||||||
|
code = parser1.Parse(buffer);
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
@@ -126,19 +146,37 @@ unsigned int i;
|
|||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
variables = *GetPrgRes()->GetVariables();
|
if( GetPrgRes()->GetVariablesId() != last_variables_id )
|
||||||
functions = *GetPrgRes()->GetFunctions();
|
{
|
||||||
|
variables = *GetPrgRes()->GetVariables();
|
||||||
|
last_variables_id = GetPrgRes()->GetVariablesId();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetPrgRes()->GetFunctionsId() != last_functions_id )
|
||||||
|
{
|
||||||
|
functions = *GetPrgRes()->GetFunctions();
|
||||||
|
last_functions_id = GetPrgRes()->GetFunctionsId();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
base_input = GetPrgRes()->GetBaseInput();
|
base_input = GetPrgRes()->GetBaseInput();
|
||||||
base_output = GetPrgRes()->GetBaseOutput();
|
base_output = GetPrgRes()->GetBaseOutput();
|
||||||
|
|
||||||
always_scientific = GetPrgRes()->GetDisplayAlwaysScientific();
|
always_scientific = GetPrgRes()->GetDisplayAlwaysScientific();
|
||||||
when_scientific = GetPrgRes()->GetDisplayWhenScientific();
|
when_scientific = GetPrgRes()->GetDisplayWhenScientific();
|
||||||
rounding = GetPrgRes()->GetDisplayRounding();
|
rounding = GetPrgRes()->GetDisplayRounding();
|
||||||
precision = GetPrgRes()->GetPrecision();
|
precision = GetPrgRes()->GetPrecision();
|
||||||
|
remove_zeroes = GetPrgRes()->GetRemovingZeroes();
|
||||||
|
angle_deg_rad_grad = GetPrgRes()->GetDegRadGrad();
|
||||||
|
country = GetPrgRes()->GetLanguages()->GetCurrentLanguage();
|
||||||
|
|
||||||
country = GetPrgRes()->GetLanguages()->GetCurrentLanguage();
|
conv_type = GetPrgRes()->GetConvert()->GetCurrentType();
|
||||||
|
GetPrgRes()->GetConvert()->GetCurrentUnit(conv_type, conv_input_unit, conv_output_unit);
|
||||||
|
|
||||||
|
if( GetPrgRes()->GetDecimalPoint() == 0 )
|
||||||
|
decimal_point = '.';
|
||||||
|
else
|
||||||
|
decimal_point = ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -151,6 +189,8 @@ void ParserManager::Init()
|
|||||||
parser1.SetVariables( &variables );
|
parser1.SetVariables( &variables );
|
||||||
parser1.SetFunctions( &functions );
|
parser1.SetFunctions( &functions );
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
parser2.SetStopObject( GetPrgRes()->GetThreadController()->GetStopObject() );
|
parser2.SetStopObject( GetPrgRes()->GetThreadController()->GetStopObject() );
|
||||||
parser2.SetVariables( &variables );
|
parser2.SetVariables( &variables );
|
||||||
parser2.SetFunctions( &functions );
|
parser2.SetFunctions( &functions );
|
||||||
@@ -158,13 +198,17 @@ void ParserManager::Init()
|
|||||||
parser3.SetStopObject( GetPrgRes()->GetThreadController()->GetStopObject() );
|
parser3.SetStopObject( GetPrgRes()->GetThreadController()->GetStopObject() );
|
||||||
parser3.SetVariables( &variables );
|
parser3.SetVariables( &variables );
|
||||||
parser3.SetFunctions( &functions );
|
parser3.SetFunctions( &functions );
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ParserManager::PrintResult()
|
int ParserManager::PrintResult()
|
||||||
{
|
{
|
||||||
if( code == ttmath::err_ok )
|
if( code == ttmath::err_ok )
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
switch( precision )
|
switch( precision )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@@ -176,29 +220,69 @@ void ParserManager::PrintResult()
|
|||||||
default:
|
default:
|
||||||
return PrintResult(parser3);
|
return PrintResult(parser3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
return PrintResult(parser1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// we can call GetPrgRes() here because we're reading
|
|
||||||
// static value like GetMainWindow() which are set only once
|
|
||||||
// at the beginning of the program and will never be changed later
|
|
||||||
// by the first thread
|
|
||||||
|
|
||||||
// note that we're using a long form of a method ErrorMessage i.g.
|
return 0;
|
||||||
// ErrorMessage(Country country, ttmath::ErrorCode code)
|
}
|
||||||
// and not ErrorMessage(ttmath::ErrorCode code)
|
|
||||||
// because someone can change the country when we're calling this method
|
|
||||||
// (in the main thread) and the latter function would be using its own
|
void ParserManager::ShowConvertingInfo()
|
||||||
// 'current_country' value which could be inconsistent
|
{
|
||||||
|
HWND conv_tab = GetPrgRes()->GetTabWindow(TabWindowFunctions::tab_convert);
|
||||||
// now, displying an error message is making in the main windows
|
|
||||||
// (after pressing a special key)
|
if( conv_type==0 || conv_input_unit==-1 || conv_output_unit==-1 ||
|
||||||
|
conv_input_unit == conv_output_unit )
|
||||||
/*
|
{
|
||||||
SetDlgItemText(
|
SetDlgItemText(conv_tab, IDC_EDIT_OUTPUT_INFO, "");
|
||||||
GetPrgRes()->GetMainWindow(),
|
return;
|
||||||
IDC_OUTPUT_EDIT,
|
}
|
||||||
GetPrgRes()->GetLanguages()->ErrorMessage(country, code) );
|
|
||||||
*/
|
Convert * pconv = GetPrgRes()->GetConvert();
|
||||||
}
|
|
||||||
|
// the first unit to the second
|
||||||
|
|
||||||
|
ttmath::Big<1,1> result;
|
||||||
|
result.SetOne();
|
||||||
|
std::string buffer1 = "1 ";
|
||||||
|
buffer1 += pconv->GetUnitAbbr(country, conv_input_unit);
|
||||||
|
buffer1 += " = ";
|
||||||
|
|
||||||
|
if( pconv->Conversion(conv_input_unit, conv_output_unit, result) )
|
||||||
|
{
|
||||||
|
SetDlgItemText(conv_tab, IDC_EDIT_OUTPUT_INFO, "overflow" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.ToString(buffer2, 10, false, 3, -1, true);
|
||||||
|
|
||||||
|
buffer1 += buffer2;
|
||||||
|
buffer1 += " ";
|
||||||
|
buffer1 += pconv->GetUnitAbbr(country, conv_output_unit);
|
||||||
|
|
||||||
|
|
||||||
|
// the second unit to the first
|
||||||
|
|
||||||
|
buffer1 += " 1 ";
|
||||||
|
buffer1 += pconv->GetUnitAbbr(country, conv_output_unit);
|
||||||
|
buffer1 += " = ";
|
||||||
|
|
||||||
|
result.SetOne();
|
||||||
|
if( pconv->Conversion(conv_output_unit, conv_input_unit, result) )
|
||||||
|
{
|
||||||
|
SetDlgItemText(conv_tab, IDC_EDIT_OUTPUT_INFO, "overflow" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
result.ToString(buffer2, 10, false, 3, -1, true);
|
||||||
|
|
||||||
|
buffer1 += buffer2;
|
||||||
|
buffer1 += " ";
|
||||||
|
buffer1 += pconv->GetUnitAbbr(country, conv_input_unit);
|
||||||
|
|
||||||
|
SetDlgItemText(conv_tab, IDC_EDIT_OUTPUT_INFO, buffer1.c_str() );
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -44,9 +44,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include <ttmath/ttmathparser.h>
|
|
||||||
#include "programresources.h"
|
#include "programresources.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -100,89 +98,123 @@ public:
|
|||||||
this method prints result
|
this method prints result
|
||||||
(a correct value if was or an error instead)
|
(a correct value if was or an error instead)
|
||||||
*/
|
*/
|
||||||
void PrintResult();
|
int PrintResult();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
this method prints the info about converting (on the converting tab)
|
||||||
|
*/
|
||||||
|
void ShowConvertingInfo();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ttmath::Parser<ttmath::Big<1,3> > parser1;
|
#ifndef TTCALC_PORTABLE
|
||||||
ttmath::Parser<ttmath::Big<2,6> > parser2;
|
|
||||||
ttmath::Parser<ttmath::Big<3,9> > parser3;
|
ttmath::Parser<TTMathBig1> parser1;
|
||||||
|
ttmath::Parser<TTMathBig2> parser2;
|
||||||
|
ttmath::Parser<TTMathBig3> parser3;
|
||||||
|
#else
|
||||||
|
ttmath::Parser<TTMathBig1> parser1;
|
||||||
|
#endif
|
||||||
|
|
||||||
ttmath::Objects variables, functions;
|
ttmath::Objects variables, functions;
|
||||||
|
int last_variables_id;
|
||||||
|
int last_functions_id;
|
||||||
|
|
||||||
const unsigned int buffer_len;
|
const unsigned int buffer_len;
|
||||||
char * buffer;
|
char * buffer;
|
||||||
|
|
||||||
int base_input, base_output;
|
int base_input, base_output;
|
||||||
|
int conv_type, conv_input_unit, conv_output_unit;
|
||||||
|
|
||||||
bool always_scientific;
|
bool always_scientific;
|
||||||
int when_scientific;
|
int when_scientific;
|
||||||
int rounding;
|
int rounding;
|
||||||
|
bool remove_zeroes;
|
||||||
int precision;
|
int precision;
|
||||||
Languages::Country country;
|
Languages::Country country;
|
||||||
ttmath::ErrorCode code;
|
ttmath::ErrorCode code;
|
||||||
|
char decimal_point;
|
||||||
|
int angle_deg_rad_grad;
|
||||||
|
|
||||||
|
/*
|
||||||
|
some buffers which we use in some method in the second thread,
|
||||||
|
it's better to have those buffers outside those methods -
|
||||||
|
if the buffers were in the methods there would be still allocating
|
||||||
|
and deallocating memory
|
||||||
|
*/
|
||||||
|
std::string buffer1, buffer2;
|
||||||
|
|
||||||
|
|
||||||
template<class ValueType>
|
bool CanWeConvert() const
|
||||||
void PrintResult(ttmath::Parser<ValueType> & matparser)
|
{
|
||||||
|
if( conv_type != 0 )
|
||||||
|
if( conv_input_unit!=-1 && conv_output_unit!=-1 &&
|
||||||
|
conv_input_unit!=conv_output_unit )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void AddOutputSuffix(std::string & result)
|
||||||
|
{
|
||||||
|
if( CanWeConvert() )
|
||||||
|
{
|
||||||
|
result += " ";
|
||||||
|
result += GetPrgRes()->GetConvert()->GetUnitAbbr(country, conv_output_unit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 1 if carry
|
||||||
|
template<class ValueType>
|
||||||
|
int PrintResult(ttmath::Parser<ValueType> & matparser)
|
||||||
{
|
{
|
||||||
std::string result, part;
|
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
|
buffer1.erase();
|
||||||
|
buffer2.erase();
|
||||||
|
|
||||||
for(i=0 ; i<matparser.stack.size() ; ++i)
|
for(i=0 ; i<matparser.stack.size() ; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if( matparser.stack[i].value.ToString(part,base_output, always_scientific, when_scientific, rounding) )
|
ValueType result = matparser.stack[i].value;
|
||||||
|
|
||||||
|
if( CanWeConvert() )
|
||||||
{
|
{
|
||||||
// we shouldn't have this error in the new version of ToStrign(...)
|
if( GetPrgRes()->GetConvert()->Conversion(conv_input_unit, conv_output_unit, result) )
|
||||||
// (it could be if were using very big mantissa and exponent
|
{
|
||||||
// in the Big type)
|
code = ttmath::err_overflow;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
if( result.ToString(buffer2,base_output, always_scientific, when_scientific, rounding, remove_zeroes, decimal_point) )
|
||||||
// look at this: part.erase()
|
{
|
||||||
//
|
// we shouldn't have had this error in the new version of ToStrign(...)
|
||||||
// we're using it because it's something wrong on gcc
|
// (where we're using a bigger type for calculating)
|
||||||
// when we're compiling with -O3 optimization flag
|
buffer2 = GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
|
||||||
//
|
|
||||||
// gcc version 3.4.2 (mingw-special) with -O3
|
|
||||||
// program tell us if there was an error here (from ToString())
|
|
||||||
// but in fact it shouldn't have been here
|
|
||||||
// I don't know where is the problem (I think in optimization,
|
|
||||||
// with -O1 and -O2 program works well and visual express works perfectly
|
|
||||||
// as well)
|
|
||||||
|
|
||||||
part.erase();
|
|
||||||
|
|
||||||
// we can omit this part.erase() and use operator+= instead of
|
|
||||||
// operator= below, for example:
|
|
||||||
// part += GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
|
|
||||||
// will be working correctly on gcc with -O3
|
|
||||||
|
|
||||||
// this error doesn't appear always, it can be seen, for example,
|
|
||||||
// if we use Big<1,3> type and we give '2^32' for calculating
|
|
||||||
|
|
||||||
// I didn't check this error on a new version of gcc
|
|
||||||
|
|
||||||
part = GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
part.erase();
|
buffer2 = GetPrgRes()->GetLanguages()->ErrorMessage(country, ttmath::err_internal_error);
|
||||||
part = GetPrgRes()->GetLanguages()->ErrorMessage(country, ttmath::err_internal_error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result += part;
|
buffer1 += buffer2;
|
||||||
|
AddOutputSuffix(buffer1);
|
||||||
|
|
||||||
if( i < matparser.stack.size()-1 )
|
if( i < matparser.stack.size()-1 )
|
||||||
result += " ";
|
buffer1 += " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDlgItemText(GetPrgRes()->GetMainWindow(),IDC_OUTPUT_EDIT,result.c_str());
|
SetDlgItemText(GetPrgRes()->GetMainWindow(),IDC_OUTPUT_EDIT,buffer1.c_str());
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -182,20 +182,51 @@ bool ProgramResources::GetAlwaysOnTop()
|
|||||||
|
|
||||||
void ProgramResources::SetDisplayRounding(int r)
|
void ProgramResources::SetDisplayRounding(int r)
|
||||||
{
|
{
|
||||||
if(r<-2)
|
if( r < -1 )
|
||||||
r = -2;
|
r = -1;
|
||||||
|
|
||||||
if(r>99)
|
if( r > 99 )
|
||||||
r = 99;
|
r = 99;
|
||||||
|
|
||||||
display_rounding = r;
|
display_rounding = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ProgramResources::GetDisplayRounding()
|
int ProgramResources::GetDisplayRounding()
|
||||||
{
|
{
|
||||||
return display_rounding;
|
return display_rounding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ProgramResources::SetRemovingZeroes(bool r)
|
||||||
|
{
|
||||||
|
remove_zeroes = r;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ProgramResources::GetRemovingZeroes()
|
||||||
|
{
|
||||||
|
return remove_zeroes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ProgramResources::SetDegRadGrad(int angle)
|
||||||
|
{
|
||||||
|
if( angle < 0 || angle > 2 )
|
||||||
|
angle = 1;
|
||||||
|
|
||||||
|
angle_deg_rad_grad = angle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int ProgramResources::GetDegRadGrad()
|
||||||
|
{
|
||||||
|
return angle_deg_rad_grad;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ProgramResources::SetDisplayAlwaysScientific(bool a)
|
void ProgramResources::SetDisplayAlwaysScientific(bool a)
|
||||||
{
|
{
|
||||||
display_always_scientific = a;
|
display_always_scientific = a;
|
||||||
@@ -260,6 +291,21 @@ int ProgramResources::GetBaseOutput()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ProgramResources::SetDecimalPoint(int decimal)
|
||||||
|
{
|
||||||
|
decimal_point = decimal;
|
||||||
|
|
||||||
|
if( decimal_point<0 || decimal_point>1 )
|
||||||
|
decimal_point = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ProgramResources::GetDecimalPoint()
|
||||||
|
{
|
||||||
|
return decimal_point;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -273,11 +319,43 @@ ttmath::Objects * ProgramResources::GetFunctions()
|
|||||||
return &functions;
|
return &functions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ProgramResources::VariablesChanged()
|
||||||
|
{
|
||||||
|
++variables_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ProgramResources::FunctionsChanged()
|
||||||
|
{
|
||||||
|
++functions_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ProgramResources::GetVariablesId()
|
||||||
|
{
|
||||||
|
return variables_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ProgramResources::GetFunctionsId()
|
||||||
|
{
|
||||||
|
return functions_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Languages * ProgramResources::GetLanguages()
|
Languages * ProgramResources::GetLanguages()
|
||||||
{
|
{
|
||||||
return &languages;
|
return &languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Convert * ProgramResources::GetConvert()
|
||||||
|
{
|
||||||
|
return &convert;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ProgramResources::SetInstance(HINSTANCE h)
|
void ProgramResources::SetInstance(HINSTANCE h)
|
||||||
{
|
{
|
||||||
hInstance = h;
|
hInstance = h;
|
||||||
@@ -376,8 +454,9 @@ ProgramResources::ProgramResources()
|
|||||||
base_output = 10;
|
base_output = 10;
|
||||||
|
|
||||||
display_always_scientific = false;
|
display_always_scientific = false;
|
||||||
display_when_scientific = 15;
|
display_when_scientific = 8;
|
||||||
display_rounding = -2;
|
display_rounding = -1;
|
||||||
|
remove_zeroes = true;
|
||||||
|
|
||||||
for(int i=HowManyTabWindows()-1 ; i!=-1 ; --i)
|
for(int i=HowManyTabWindows()-1 ; i!=-1 ; --i)
|
||||||
tab_window[i] = 0;
|
tab_window[i] = 0;
|
||||||
@@ -390,6 +469,18 @@ ProgramResources::ProgramResources()
|
|||||||
y_size_normal = 0;
|
y_size_normal = 0;
|
||||||
y_size_compact = 0;
|
y_size_compact = 0;
|
||||||
x_size_min = 0;
|
x_size_min = 0;
|
||||||
|
|
||||||
|
// !!! put into Convert constructor
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
convert.Init();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
decimal_point = 0;
|
||||||
|
angle_deg_rad_grad = 1; // rad is default
|
||||||
|
|
||||||
|
variables_id = 0;
|
||||||
|
functions_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -491,12 +582,17 @@ return status;
|
|||||||
|
|
||||||
void ProgramResources::SetNameOfConfigurationFile()
|
void ProgramResources::SetNameOfConfigurationFile()
|
||||||
{
|
{
|
||||||
static const char simple_file_name[] = "ttcalc.ini";
|
static const char simple_file_name[] = "ttcalc.ini";
|
||||||
|
|
||||||
|
// if there'll be an error we assume that the current directory will be used
|
||||||
|
// (in the portable version the configuration file is in a current directory)
|
||||||
|
configuration_file = std::string(".\\") + simple_file_name;
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
static const char simple_directory_name[] = "TTCalc";
|
static const char simple_directory_name[] = "TTCalc";
|
||||||
std::string application_data;
|
std::string application_data;
|
||||||
|
|
||||||
// if there'll be an error we assume that the current directory will be used
|
|
||||||
configuration_file = std::string(".\\") + simple_file_name;
|
|
||||||
|
|
||||||
// we're trying to read the value "AppData" from registry
|
// we're trying to read the value "AppData" from registry
|
||||||
// which can be, for instance, as:
|
// which can be, for instance, as:
|
||||||
@@ -533,6 +629,8 @@ std::string application_data;
|
|||||||
|
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -567,6 +665,82 @@ void ProgramResources::CheckCoordinates()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ProgramResources::AddVariablesFunctions( IniParser::Section & temp_variables,
|
||||||
|
IniParser::Section & temp_functions,
|
||||||
|
bool if_not_exist)
|
||||||
|
{
|
||||||
|
IniParser::Section::iterator ic;
|
||||||
|
|
||||||
|
// we're adding variables
|
||||||
|
|
||||||
|
if( !if_not_exist )
|
||||||
|
{
|
||||||
|
variables.Clear();
|
||||||
|
VariablesChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
for( ic = temp_variables.begin() ; ic!=temp_variables.end() ; ++ic )
|
||||||
|
if( !if_not_exist || !variables.IsDefined(ic->first) )
|
||||||
|
{
|
||||||
|
variables.Add(ic->first, ic->second);
|
||||||
|
VariablesChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// we're adding functions
|
||||||
|
|
||||||
|
if( !if_not_exist )
|
||||||
|
{
|
||||||
|
functions.Clear();
|
||||||
|
FunctionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
for( ic = temp_functions.begin() ; ic!=temp_functions.end() ; ++ic )
|
||||||
|
{
|
||||||
|
const char * name;
|
||||||
|
int param;
|
||||||
|
|
||||||
|
if( !if_not_exist || !functions.IsDefined(ic->first) )
|
||||||
|
if( SplitFunction(ic->second, &name, ¶m) )
|
||||||
|
{
|
||||||
|
functions.Add(ic->first, name, param);
|
||||||
|
FunctionsChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IniParser::Error ProgramResources::ReadVariablesFunctionsFromFile()
|
||||||
|
{
|
||||||
|
IniParser iparser;
|
||||||
|
IniParser::Section temp_variables, temp_functions;
|
||||||
|
|
||||||
|
iparser.ConvertValueToSmallLetters(false);
|
||||||
|
iparser.SectionCaseSensitive(false);
|
||||||
|
|
||||||
|
// we have variables and functions case-sensitive
|
||||||
|
iparser.PatternCaseSensitive(true);
|
||||||
|
|
||||||
|
iparser.Associate( "variables", &temp_variables );
|
||||||
|
iparser.Associate( "functions", &temp_functions );
|
||||||
|
|
||||||
|
bad_line = -1;
|
||||||
|
IniParser::Error err = iparser.ReadFromFile( configuration_file.c_str() );
|
||||||
|
|
||||||
|
if( err == IniParser::err_cant_open_file )
|
||||||
|
return err;
|
||||||
|
|
||||||
|
AddVariablesFunctions(temp_variables, temp_functions, true);
|
||||||
|
|
||||||
|
if( err != IniParser::err_ok )
|
||||||
|
bad_line = iparser.GetBadLine();
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IniParser::Error ProgramResources::ReadFromFile()
|
IniParser::Error ProgramResources::ReadFromFile()
|
||||||
{
|
{
|
||||||
IniParser iparser;
|
IniParser iparser;
|
||||||
@@ -574,6 +748,11 @@ IniParser::Section temp_variables, temp_functions;
|
|||||||
IniParser::Section::iterator ic;
|
IniParser::Section::iterator ic;
|
||||||
std::string ini_value[20];
|
std::string ini_value[20];
|
||||||
|
|
||||||
|
iparser.ConvertValueToSmallLetters(false);
|
||||||
|
iparser.SectionCaseSensitive(false);
|
||||||
|
|
||||||
|
// we have variables and functions case-sensitive
|
||||||
|
iparser.PatternCaseSensitive(true);
|
||||||
|
|
||||||
iparser.Associate( "global|always.on.top", &ini_value[0] );
|
iparser.Associate( "global|always.on.top", &ini_value[0] );
|
||||||
iparser.Associate( "global|view", &ini_value[1] );
|
iparser.Associate( "global|view", &ini_value[1] );
|
||||||
@@ -589,6 +768,9 @@ std::string ini_value[20];
|
|||||||
iparser.Associate( "global|disp.rounding", &ini_value[11] );
|
iparser.Associate( "global|disp.rounding", &ini_value[11] );
|
||||||
iparser.Associate( "global|size.y", &ini_value[12] );
|
iparser.Associate( "global|size.y", &ini_value[12] );
|
||||||
iparser.Associate( "global|language", &ini_value[13] );
|
iparser.Associate( "global|language", &ini_value[13] );
|
||||||
|
iparser.Associate( "global|disp.dec.point", &ini_value[14] );
|
||||||
|
iparser.Associate( "global|disp.remove.zeroes", &ini_value[15] );
|
||||||
|
iparser.Associate( "global|disp.deg_rad_grad", &ini_value[16] );
|
||||||
|
|
||||||
iparser.Associate( "variables", &temp_variables );
|
iparser.Associate( "variables", &temp_variables );
|
||||||
iparser.Associate( "functions", &temp_functions );
|
iparser.Associate( "functions", &temp_functions );
|
||||||
@@ -599,21 +781,7 @@ std::string ini_value[20];
|
|||||||
if( err == IniParser::err_cant_open_file )
|
if( err == IniParser::err_cant_open_file )
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
// we're adding variables
|
AddVariablesFunctions(temp_variables, temp_functions, false);
|
||||||
variables.Clear();
|
|
||||||
for( ic = temp_variables.begin() ; ic!=temp_variables.end() ; ++ic )
|
|
||||||
variables.Add(ic->first, ic->second);
|
|
||||||
|
|
||||||
// we're adding functions
|
|
||||||
functions.Clear();
|
|
||||||
for( ic = temp_functions.begin() ; ic!=temp_functions.end() ; ++ic )
|
|
||||||
{
|
|
||||||
const char * name;
|
|
||||||
int param;
|
|
||||||
|
|
||||||
if( SplitFunction(ic->second, &name, ¶m) )
|
|
||||||
functions.Add(ic->first, name, param);
|
|
||||||
}
|
|
||||||
|
|
||||||
// we're setting various values
|
// we're setting various values
|
||||||
always_on_top = bool( atoi(ini_value[0].c_str()) );
|
always_on_top = bool( atoi(ini_value[0].c_str()) );
|
||||||
@@ -633,13 +801,27 @@ std::string ini_value[20];
|
|||||||
SetDisplayAlwaysScientific( bool(atoi(ini_value[9].c_str())) );
|
SetDisplayAlwaysScientific( bool(atoi(ini_value[9].c_str())) );
|
||||||
SetDisplayWhenScientific( atoi(ini_value[10].c_str()) );
|
SetDisplayWhenScientific( atoi(ini_value[10].c_str()) );
|
||||||
SetDisplayRounding( atoi(ini_value[11].c_str()) );
|
SetDisplayRounding( atoi(ini_value[11].c_str()) );
|
||||||
|
SetRemovingZeroes( bool(atoi(ini_value[15].c_str())) );
|
||||||
|
|
||||||
|
if( ini_value[13] == "5" )
|
||||||
|
languages.SetCurrentLanguage(Languages::ru);
|
||||||
|
else
|
||||||
|
if( ini_value[13] == "4" )
|
||||||
|
languages.SetCurrentLanguage(Languages::chn);
|
||||||
|
else
|
||||||
|
if( ini_value[13] == "3" )
|
||||||
|
languages.SetCurrentLanguage(Languages::da);
|
||||||
|
else
|
||||||
|
if( ini_value[13] == "2" )
|
||||||
|
languages.SetCurrentLanguage(Languages::sp);
|
||||||
|
else
|
||||||
if( ini_value[13] == "1" )
|
if( ini_value[13] == "1" )
|
||||||
languages.SetCurrentLanguage(Languages::pl);
|
languages.SetCurrentLanguage(Languages::pl);
|
||||||
else
|
else
|
||||||
languages.SetCurrentLanguage(Languages::en);
|
languages.SetCurrentLanguage(Languages::en);
|
||||||
|
|
||||||
|
SetDecimalPoint( atoi(ini_value[14].c_str()) );
|
||||||
|
SetDegRadGrad( atoi(ini_value[16].c_str()) );
|
||||||
|
|
||||||
if( err != IniParser::err_ok )
|
if( err != IniParser::err_ok )
|
||||||
bad_line = iparser.GetBadLine();
|
bad_line = iparser.GetBadLine();
|
||||||
@@ -675,6 +857,10 @@ std::ofstream file( configuration_file.c_str() );
|
|||||||
file << "disp.alw.scientific = " << (int)display_always_scientific << std::endl;
|
file << "disp.alw.scientific = " << (int)display_always_scientific << std::endl;
|
||||||
file << "disp.when.scientific = " << display_when_scientific << std::endl;
|
file << "disp.when.scientific = " << display_when_scientific << std::endl;
|
||||||
file << "disp.rounding = " << display_rounding << std::endl;
|
file << "disp.rounding = " << display_rounding << std::endl;
|
||||||
|
file << "disp.remove.zeroes = " << (int)remove_zeroes << std::endl;
|
||||||
|
file << "disp.dec.point = " << decimal_point << std::endl;
|
||||||
|
file << "disp.deg_rad_grad = " << angle_deg_rad_grad << std::endl;
|
||||||
|
|
||||||
|
|
||||||
file << "\n[variables]\n";
|
file << "\n[variables]\n";
|
||||||
|
|
||||||
@@ -698,5 +884,3 @@ int ProgramResources::GetBadLine()
|
|||||||
return bad_line;
|
return bad_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,8 +47,10 @@
|
|||||||
#include "iniparser.h"
|
#include "iniparser.h"
|
||||||
#include "languages.h"
|
#include "languages.h"
|
||||||
#include "threadcontroller.h"
|
#include "threadcontroller.h"
|
||||||
|
#include "convert.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
@@ -67,10 +69,14 @@
|
|||||||
GetPrgRes()->SetPrecision( new_precision );
|
GetPrgRes()->SetPrecision( new_precision );
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
if you change some variables by using GetVariable() method
|
||||||
|
you should call VariablesChanged() in order to inform the second thread that variables have changed
|
||||||
|
(variables_id will be increment), the same is for functions (FunctionsChanged() method)
|
||||||
|
|
||||||
methods which are used by the second thread:
|
methods which are used by the second thread:
|
||||||
GetBuffer(), GetVariables(), GetFunctions(), GetBaseInput(), GetBaseOutput()
|
GetBuffer(), GetVariables(), GetFunctions(), GetBaseInput(), GetBaseOutput()
|
||||||
GetDisplayAlwaysScientific(), GetDisplayWhenScientific(), GetDisplayRounding()
|
GetDisplayAlwaysScientific(), GetDisplayWhenScientific(), GetDisplayRounding()
|
||||||
GetCurrentLanguage(), GetPrecision()
|
GetCurrentLanguage(), GetPrecision() ...
|
||||||
|
|
||||||
and if you're using methods which begin with Set..... you must call it
|
and if you're using methods which begin with Set..... you must call it
|
||||||
between StopCalculating() and StartCalculating()
|
between StopCalculating() and StartCalculating()
|
||||||
@@ -217,12 +223,43 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
pointers to variables' table, functions' table, the language's object
|
if you change some variables by using GetVariable() method
|
||||||
|
you should call this method in order to inform the second thread that variables have changed
|
||||||
|
(variables_id will be increment)
|
||||||
|
*/
|
||||||
|
void VariablesChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
if you change some functions by using GetFunction() method
|
||||||
|
you should call this method in order to inform the second thread that functions have changed
|
||||||
|
(functions_id will be increment)
|
||||||
|
*/
|
||||||
|
void FunctionsChanged();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
returning the state of variables_id
|
||||||
|
(used by the second thread)
|
||||||
|
*/
|
||||||
|
int GetVariablesId();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
returning the state of functions_id
|
||||||
|
(used by the second thread)
|
||||||
|
*/
|
||||||
|
int GetFunctionsId();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
pointers to variables' table, functions' table, the languages' object, convert object
|
||||||
and to the characters' buffer
|
and to the characters' buffer
|
||||||
*/
|
*/
|
||||||
ttmath::Objects * GetVariables();
|
ttmath::Objects * GetVariables();
|
||||||
ttmath::Objects * GetFunctions();
|
ttmath::Objects * GetFunctions();
|
||||||
Languages * GetLanguages();
|
Languages * GetLanguages();
|
||||||
|
Convert * GetConvert();
|
||||||
char * GetBuffer();
|
char * GetBuffer();
|
||||||
unsigned int GetBufferSize();
|
unsigned int GetBufferSize();
|
||||||
|
|
||||||
@@ -262,17 +299,45 @@ public:
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
reading and writing to a file
|
reading and writing to a file
|
||||||
|
|
||||||
|
ReadVariablesFunctionsFromFile() reads variables/functions only when they are not exist (in this instance of TTCalc)
|
||||||
*/
|
*/
|
||||||
|
IniParser::Error ReadVariablesFunctionsFromFile();
|
||||||
IniParser::Error ReadFromFile();
|
IniParser::Error ReadFromFile();
|
||||||
void SaveToFile();
|
void SaveToFile();
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
it returns a number of line where there was an error
|
it returns a number of a line where there was an error
|
||||||
during last parsing
|
during last parsing
|
||||||
*/
|
*/
|
||||||
int GetBadLine();
|
int GetBadLine();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
setting and returning the decimal point used during printig values
|
||||||
|
0 - '.'
|
||||||
|
1 - ','
|
||||||
|
*/
|
||||||
|
void SetDecimalPoint(int decimal);
|
||||||
|
int GetDecimalPoint();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
setting and returning the state of removing trailing zeroes
|
||||||
|
(used during printing values)
|
||||||
|
*/
|
||||||
|
void SetRemovingZeroes(bool r);
|
||||||
|
bool GetRemovingZeroes();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
setting and returning the unit of angle in which sin/cos/tan/ctg (arc sin...) operate
|
||||||
|
0 - deg
|
||||||
|
1 - red
|
||||||
|
2 - grad
|
||||||
|
*/
|
||||||
|
void SetDegRadGrad(int angle);
|
||||||
|
int GetDegRadGrad();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -281,18 +346,24 @@ private:
|
|||||||
bool IsDecDigit(int c);
|
bool IsDecDigit(int c);
|
||||||
bool SplitFunction(const std::string & input, const char * * name, int * param);
|
bool SplitFunction(const std::string & input, const char * * name, int * param);
|
||||||
void CheckCoordinates();
|
void CheckCoordinates();
|
||||||
|
void AddVariablesFunctions(IniParser::Section & temp_variables, IniParser::Section & temp_functions, bool if_not_exist);
|
||||||
|
|
||||||
|
|
||||||
ttmath::Objects variables;
|
ttmath::Objects variables;
|
||||||
ttmath::Objects functions;
|
ttmath::Objects functions;
|
||||||
Languages languages;
|
Languages languages;
|
||||||
|
Convert convert;
|
||||||
volatile ThreadController thread_controller;
|
volatile ThreadController thread_controller;
|
||||||
|
|
||||||
|
int variables_id;
|
||||||
|
int functions_id;
|
||||||
|
|
||||||
unsigned int buffer_size;
|
unsigned int buffer_size;
|
||||||
char * buffer;
|
char * buffer;
|
||||||
|
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
HWND main_window;
|
HWND main_window;
|
||||||
HWND tab_window[5];
|
HWND tab_window[6];
|
||||||
|
|
||||||
int precision;
|
int precision;
|
||||||
bool always_on_top;
|
bool always_on_top;
|
||||||
@@ -313,11 +384,17 @@ private:
|
|||||||
int base_input;
|
int base_input;
|
||||||
int base_output;
|
int base_output;
|
||||||
|
|
||||||
|
int decimal_point;
|
||||||
|
|
||||||
bool display_always_scientific;
|
bool display_always_scientific;
|
||||||
int display_when_scientific;
|
int display_when_scientific;
|
||||||
int display_rounding;
|
int display_rounding;
|
||||||
|
bool remove_zeroes;
|
||||||
|
int angle_deg_rad_grad;
|
||||||
|
|
||||||
int bad_line;
|
int bad_line;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -58,10 +58,12 @@
|
|||||||
#define IDD_DIALOG_FUNCTIONS 112
|
#define IDD_DIALOG_FUNCTIONS 112
|
||||||
#define IDD_DIALOG_PRECISION 113
|
#define IDD_DIALOG_PRECISION 113
|
||||||
#define IDD_DIALOG_DISPLAY 114
|
#define IDD_DIALOG_DISPLAY 114
|
||||||
|
#define IDD_DIALOG_CONVERT 115
|
||||||
|
|
||||||
#define IDR_MENU 200
|
#define IDR_MENU 200
|
||||||
#define IDC_TAB 1010
|
#define IDC_TAB 1010
|
||||||
#define IDI_ICON1 104
|
#define IDI_ICON2 104
|
||||||
|
#define IDI_ICON1 105
|
||||||
#define IDC_INPUT_EDIT 1000
|
#define IDC_INPUT_EDIT 1000
|
||||||
#define IDC_OUTPUT_EDIT 1001
|
#define IDC_OUTPUT_EDIT 1001
|
||||||
|
|
||||||
@@ -161,6 +163,25 @@
|
|||||||
#define IDC_UPDOWN_DISPLAY_WHEN_SCIENTIFIC 1165
|
#define IDC_UPDOWN_DISPLAY_WHEN_SCIENTIFIC 1165
|
||||||
#define IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC 1166
|
#define IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC 1166
|
||||||
#define IDC_LABEL_GROUP_SCIENTIFIC 1168
|
#define IDC_LABEL_GROUP_SCIENTIFIC 1168
|
||||||
|
#define IDC_LABEL_DECIMAL_POINT 1169
|
||||||
|
#define IDC_COMBO_DECIMAL_POINT 1170
|
||||||
|
#define IDC_CHECK_REMOVE_ZEROES 1171
|
||||||
|
#define IDC_LABEL_DISPLAY_DEG_RAD_GRAD 1172
|
||||||
|
#define IDC_COMBO_DEG_RAD_GRAD 1173
|
||||||
|
|
||||||
|
|
||||||
|
// convert tab
|
||||||
|
#define IDC_LIST_UNIT_TYPE 1200
|
||||||
|
#define IDC_LIST_UNIT_INPUT1 1201
|
||||||
|
#define IDC_LIST_UNIT_INPUT2 1202
|
||||||
|
#define IDC_LIST_UNIT_OUTPUT1 1203
|
||||||
|
#define IDC_LIST_UNIT_OUTPUT2 1204
|
||||||
|
#define IDC_STATIC_UNIT_INPUT 1205
|
||||||
|
#define IDC_STATIC_UNIT_OUTPUT 1206
|
||||||
|
#define IDC_COMBO_DYNAMIC_OUTPUT 1207
|
||||||
|
#define IDC_EDIT_OUTPUT_INFO 1208
|
||||||
|
#define IDC_STATIC_UNIT_CONVERSION 1209
|
||||||
|
|
||||||
|
|
||||||
// menu
|
// menu
|
||||||
#define IDM_VIEW_INDEX 0
|
#define IDM_VIEW_INDEX 0
|
||||||
@@ -173,6 +194,10 @@
|
|||||||
#define IDM_ALWAYS_ON_TOP 40004
|
#define IDM_ALWAYS_ON_TOP 40004
|
||||||
#define IDM_LANGUAGE_ENGLISH 40010
|
#define IDM_LANGUAGE_ENGLISH 40010
|
||||||
#define IDM_LANGUAGE_POLISH 40011
|
#define IDM_LANGUAGE_POLISH 40011
|
||||||
|
#define IDM_LANGUAGE_SPANISH 40012
|
||||||
|
#define IDM_LANGUAGE_DANISH 40013
|
||||||
|
#define IDM_LANGUAGE_CHINESE 40014
|
||||||
|
#define IDM_LANGUAGE_RUSSIAN 40015
|
||||||
#define IDM_CLOSE_PROGRAM 40020
|
#define IDM_CLOSE_PROGRAM 40020
|
||||||
#define IDM_EDIT_UNDO 40030
|
#define IDM_EDIT_UNDO 40030
|
||||||
#define IDM_EDIT_PASTE 40031
|
#define IDM_EDIT_PASTE 40031
|
||||||
|
141
src/resource.rc
141
src/resource.rc
@@ -1,11 +1,16 @@
|
|||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
#include "afxres.h"
|
//#include "afxres.h"
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
#include "windows.h"
|
||||||
|
|
||||||
LANGUAGE LANG_POLISH, 1
|
LANGUAGE LANG_POLISH, 1
|
||||||
104 ICON "..\\res\\icon01.ico"
|
104 ICON "..\\res\\icon02.ico"
|
||||||
|
|
||||||
|
LANGUAGE LANG_POLISH, 2
|
||||||
|
105 ICON "..\\res\\icon01.ico"
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
LANGUAGE LANG_NEUTRAL, 0
|
LANGUAGE LANG_NEUTRAL, 0
|
||||||
200 MENU
|
200 MENU
|
||||||
@@ -23,6 +28,10 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&English", 40010
|
MENUITEM "&English", 40010
|
||||||
MENUITEM "&Polish", 40011
|
MENUITEM "&Polish", 40011
|
||||||
|
MENUITEM "&Spanish", 40012
|
||||||
|
MENUITEM "&Danish", 40013
|
||||||
|
MENUITEM "&Chinese", 40014
|
||||||
|
MENUITEM "&Russian", 40015
|
||||||
END
|
END
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Close", 40020
|
MENUITEM "&Close", 40020
|
||||||
@@ -45,12 +54,16 @@ END
|
|||||||
101 DIALOG 0, 0, 265, 150
|
101 DIALOG 0, 0, 265, 150
|
||||||
STYLE DS_SETFONT |DS_CENTER |WS_POPUP |WS_SYSMENU |WS_THICKFRAME |WS_MAXIMIZEBOX |WS_MINIMIZEBOX |WS_CAPTION
|
STYLE DS_SETFONT |DS_CENTER |WS_POPUP |WS_SYSMENU |WS_THICKFRAME |WS_MAXIMIZEBOX |WS_MINIMIZEBOX |WS_CAPTION
|
||||||
MENU 200
|
MENU 200
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
CAPTION "TTCalc"
|
CAPTION "TTCalc"
|
||||||
|
#else
|
||||||
|
CAPTION "TTCalc portable"
|
||||||
|
#endif
|
||||||
FONT 8, "Ms Shell Dlg"
|
FONT 8, "Ms Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "",1000,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,0,6,260,14
|
CONTROL "",1000,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,0,6,260,14
|
||||||
CONTROL "",1001,"EDIT",ES_READONLY |ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,0,21,260,14
|
CONTROL "",1001,"EDIT",ES_READONLY |ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,0,21,260,14
|
||||||
CONTROL "",1010,"SysTabControl32",WS_CHILD |WS_TABSTOP |WS_GROUP| WS_VISIBLE ,0,39,261,110, WS_EX_CONTROLPARENT
|
CONTROL "",1010,"SysTabControl32",WS_CHILD |WS_TABSTOP |WS_GROUP| WS_VISIBLE ,0,39,261,106, WS_EX_CONTROLPARENT
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
@@ -62,10 +75,10 @@ FONT 8, "Ms Shell Dlg"
|
|||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Ok",1,291,10,50,14,BS_CENTER | BS_VCENTER
|
DEFPUSHBUTTON "Ok",1,291,10,50,14,BS_CENTER | BS_VCENTER
|
||||||
PUSHBUTTON "Cancel",2,291,28,50,14,BS_CENTER | BS_VCENTER
|
PUSHBUTTON "Cancel",2,291,28,50,14,BS_CENTER | BS_VCENTER
|
||||||
EDITTEXT 1134,38,10,67,14,ES_AUTOHSCROLL
|
EDITTEXT 1134,47,10,67,14,ES_AUTOHSCROLL
|
||||||
EDITTEXT 1135,38,28,230,14,ES_AUTOHSCROLL
|
EDITTEXT 1135,47,28,226,14,ES_AUTOHSCROLL
|
||||||
LTEXT "name:",1136,7,12,27,8
|
LTEXT "name:",1136,7,12,38,8
|
||||||
LTEXT "value:",1137,7,30,27,8
|
LTEXT "value:",1137,7,30,38,8
|
||||||
END
|
END
|
||||||
|
|
||||||
103 DIALOG DISCARDABLE 0, 0, 370, 74
|
103 DIALOG DISCARDABLE 0, 0, 370, 74
|
||||||
@@ -73,16 +86,17 @@ STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE |
|
|||||||
WS_CAPTION | WS_SYSMENU
|
WS_CAPTION | WS_SYSMENU
|
||||||
FONT 8, "Ms Shell Dlg"
|
FONT 8, "Ms Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Ok",1,303,10,50,14,BS_CENTER | BS_VCENTER
|
DEFPUSHBUTTON "Ok",1,304,10,50,14,BS_CENTER | BS_VCENTER
|
||||||
PUSHBUTTON "Cancel",2,303,27,50,14,BS_CENTER | BS_VCENTER
|
PUSHBUTTON "Cancel",2,304,27,50,14,BS_CENTER | BS_VCENTER
|
||||||
EDITTEXT 1144,46,10,67,14,ES_AUTOHSCROLL
|
EDITTEXT 1144,55,10,67,14,ES_AUTOHSCROLL
|
||||||
COMBOBOX 1146,46,29,67,130,CBS_DROPDOWNLIST | WS_TABSTOP
|
COMBOBOX 1146,55,29,67,130,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
EDITTEXT 1145,46,47,308,14,ES_AUTOHSCROLL
|
EDITTEXT 1145,55,47,299,14,ES_AUTOHSCROLL
|
||||||
LTEXT "name:",1147,7,12,31,8
|
LTEXT "name:",1147,7,12,46,8
|
||||||
LTEXT "value:",1149,7,49,33,8
|
LTEXT "value:",1149,7,49,46,8
|
||||||
LTEXT "param:",1148,7,30,33,8
|
LTEXT "param:",1148,7,30,46,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
110 DIALOGEX 0, 0, 287, 90
|
110 DIALOGEX 0, 0, 287, 90
|
||||||
STYLE DS_3DLOOK | DS_FIXEDSYS |DS_SETFONT | WS_CHILD| WS_TABSTOP |WS_GROUP
|
STYLE DS_3DLOOK | DS_FIXEDSYS |DS_SETFONT | WS_CHILD| WS_TABSTOP |WS_GROUP
|
||||||
FONT 8, "Ms Shell Dlg"
|
FONT 8, "Ms Shell Dlg"
|
||||||
@@ -151,6 +165,8 @@ BEGIN
|
|||||||
CONTROL "",1143,"SysListView32",LVS_REPORT |LVS_SHOWSELALWAYS |LVS_SORTASCENDING |LVS_ALIGNLEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,57,3,223,85
|
CONTROL "",1143,"SysListView32",LVS_REPORT |LVS_SHOWSELALWAYS |LVS_SORTASCENDING |LVS_ALIGNLEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,57,3,223,85
|
||||||
END
|
END
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
113 DIALOG 0, 0, 287, 90
|
113 DIALOG 0, 0, 287, 90
|
||||||
STYLE DS_3DLOOK |DS_FIXEDSYS |DS_SETFONT |WS_CHILD | WS_TABSTOP |WS_GROUP
|
STYLE DS_3DLOOK |DS_FIXEDSYS |DS_SETFONT |WS_CHILD | WS_TABSTOP |WS_GROUP
|
||||||
CAPTION "tab4"
|
CAPTION "tab4"
|
||||||
@@ -164,24 +180,81 @@ BEGIN
|
|||||||
CONTROL "info 3",1155,"STATIC",SS_LEFT |WS_CHILD |WS_VISIBLE ,28,74,245,8
|
CONTROL "info 3",1155,"STATIC",SS_LEFT |WS_CHILD |WS_VISIBLE ,28,74,245,8
|
||||||
END
|
END
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
114 DIALOG DISCARDABLE 0, 0, 255, 90
|
114 DIALOG DISCARDABLE 0, 0, 255, 90
|
||||||
STYLE DS_3DLOOK | DS_FIXEDSYS |DS_SETFONT |WS_CHILD | WS_TABSTOP |WS_GROUP
|
STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_CAPTION | WS_GROUP |
|
||||||
|
WS_TABSTOP
|
||||||
CAPTION "tab5"
|
CAPTION "tab5"
|
||||||
FONT 8, "Ms Shell Dlg"
|
FONT 8, "Ms Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
COMBOBOX 1156,58,5,63,200,CBS_DROPDOWNLIST | WS_TABSTOP | WS_GROUP
|
COMBOBOX 1156,58,5,58,200,CBS_DROPDOWNLIST | WS_GROUP |
|
||||||
COMBOBOX 1157,58,19,63,200,CBS_DROPDOWNLIST | WS_TABSTOP
|
WS_TABSTOP
|
||||||
LTEXT "Input",1162,11,7,27,8
|
COMBOBOX 1157,58,19,58,200,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
LTEXT "Output",1163,11,22,29,8
|
CONTROL "Input",1162,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,11,7,
|
||||||
LTEXT "Rounding",1164,11,36,43,8
|
43,8
|
||||||
COMBOBOX 1159,58,33,121,200,CBS_DROPDOWNLIST | WS_TABSTOP
|
CONTROL "Output",1163,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,11,
|
||||||
CONTROL "Always",1160,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,19,65,44,10
|
22,43,8
|
||||||
CONTROL "When the exponent is greater than:",1161,"Button", BS_AUTORADIOBUTTON | BS_LEFT ,77,65,130,10
|
COMBOBOX 1159,58,33,58,200,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
EDITTEXT 1166,211,63,29,14,WS_GROUP | WS_TABSTOP | ES_NUMBER
|
CONTROL "Rounding",1164,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,11,
|
||||||
CONTROL "",1165,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS ,213,37,11,14
|
36,43,8
|
||||||
|
COMBOBOX 1173,213,5,38,54,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
|
CONTROL "sin/cos asin/acos",1172,"Static",SS_LEFTNOWORDWRAP |
|
||||||
|
WS_GROUP,137,7,73,8
|
||||||
|
COMBOBOX 1170,213,19,38,62,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
|
CONTROL "Decimal point",1169,"Static",SS_LEFTNOWORDWRAP |
|
||||||
|
WS_GROUP,137,22,73,8
|
||||||
|
CONTROL "remove trailing zeroes",1171,"Button",BS_AUTOCHECKBOX |
|
||||||
|
BS_LEFTTEXT | BS_LEFT | WS_TABSTOP,136,36,115,10
|
||||||
|
CONTROL "Always",1160,"Button",BS_AUTORADIOBUTTON | BS_LEFT |
|
||||||
|
WS_GROUP | WS_TABSTOP,19,65,54,10
|
||||||
|
CONTROL "When the exponent is greater than:",1161,"Button",
|
||||||
|
BS_AUTORADIOBUTTON | BS_LEFT,77,65,138,10
|
||||||
|
EDITTEXT 1166,217,63,29,14,ES_NUMBER | WS_GROUP
|
||||||
|
CONTROL "",1165,"msctls_updown32",UDS_SETBUDDYINT |
|
||||||
|
UDS_ALIGNRIGHT | UDS_ARROWKEYS,201,73,11,14
|
||||||
GROUPBOX "Print scientific value",1168,11,51,240,31
|
GROUPBOX "Print scientific value",1168,11,51,240,31
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
|
||||||
|
115 DIALOG DISCARDABLE 0, 0, 260, 90
|
||||||
|
STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_CAPTION | WS_GROUP |
|
||||||
|
WS_TABSTOP
|
||||||
|
CAPTION "tab6"
|
||||||
|
FONT 8, "Ms Shell Dlg"
|
||||||
|
BEGIN
|
||||||
|
LTEXT "Conversion type",IDC_STATIC_UNIT_CONVERSION,3,2,55,8
|
||||||
|
LTEXT "Input",IDC_STATIC_UNIT_INPUT,60,2,73,8
|
||||||
|
LTEXT "Output",IDC_STATIC_UNIT_OUTPUT,162,2,80,8
|
||||||
|
CONTROL "List1",IDC_LIST_UNIT_TYPE,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER |
|
||||||
|
WS_BORDER | WS_TABSTOP,3,12,50,56
|
||||||
|
CONTROL "List2a",IDC_LIST_UNIT_INPUT1,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER |
|
||||||
|
WS_BORDER | WS_TABSTOP,60,12,26,56
|
||||||
|
CONTROL "List2b",IDC_LIST_UNIT_INPUT2,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER |
|
||||||
|
WS_BORDER | WS_TABSTOP,90,12,65,56
|
||||||
|
CONTROL "List3a",IDC_LIST_UNIT_OUTPUT1,"SysListView32",
|
||||||
|
LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,161,12,26,56
|
||||||
|
CONTROL "List3b",IDC_LIST_UNIT_OUTPUT2,"SysListView32",
|
||||||
|
LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,190,12,65,56
|
||||||
|
EDITTEXT IDC_EDIT_OUTPUT_INFO,3,72,152,14,ES_AUTOHSCROLL |
|
||||||
|
ES_READONLY
|
||||||
|
CONTROL "dynamically output",IDC_COMBO_DYNAMIC_OUTPUT,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,162,74,88,10
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
200 DIALOG DISCARDABLE 0, 0, 349, 202
|
200 DIALOG DISCARDABLE 0, 0, 349, 202
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||||
WS_SYSMENU
|
WS_SYSMENU
|
||||||
@@ -193,6 +266,20 @@ BEGIN
|
|||||||
WS_BORDER | NOT WS_TABSTOP
|
WS_BORDER | NOT WS_TABSTOP
|
||||||
DEFPUSHBUTTON "Close",IDOK,175,172,86,14
|
DEFPUSHBUTTON "Close",IDOK,175,172,86,14
|
||||||
END
|
END
|
||||||
|
#else
|
||||||
|
200 DIALOG DISCARDABLE 0, 0, 268, 239
|
||||||
|
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||||
|
WS_SYSMENU
|
||||||
|
CAPTION "About"
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
EDITTEXT 1200,16,18,234,183,ES_MULTILINE | ES_READONLY | NOT
|
||||||
|
WS_BORDER | NOT WS_TABSTOP
|
||||||
|
DEFPUSHBUTTON "Close",IDOK,90,213,86,14
|
||||||
|
END
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
1201 BITMAP "..\\res\\abacus_01.bmp"
|
1201 BITMAP "..\\res\\abacus_01.bmp"
|
||||||
|
#endif
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
527
src/tabs.cpp
527
src/tabs.cpp
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -45,6 +45,7 @@ int tab_variables;
|
|||||||
int tab_functions;
|
int tab_functions;
|
||||||
int tab_precision;
|
int tab_precision;
|
||||||
int tab_display;
|
int tab_display;
|
||||||
|
int tab_convert;
|
||||||
|
|
||||||
ttmath::ErrorCode last_code = ttmath::err_ok;
|
ttmath::ErrorCode last_code = ttmath::err_ok;
|
||||||
|
|
||||||
@@ -391,6 +392,8 @@ void SetLanguageTabFunctions(HWND hWnd)
|
|||||||
|
|
||||||
void SetLanguageTabPrecision(HWND hWnd)
|
void SetLanguageTabPrecision(HWND hWnd)
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_1, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_1) );
|
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_1, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_1) );
|
||||||
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_2, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_2) );
|
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_2, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_2) );
|
||||||
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_3, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_3) );
|
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_3, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_3) );
|
||||||
@@ -398,6 +401,8 @@ void SetLanguageTabPrecision(HWND hWnd)
|
|||||||
SetDlgItemText(hWnd, IDC_LABEL_PRECISION_1_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_1_info) );
|
SetDlgItemText(hWnd, IDC_LABEL_PRECISION_1_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_1_info) );
|
||||||
SetDlgItemText(hWnd, IDC_LABEL_PRECISION_2_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_2_info) );
|
SetDlgItemText(hWnd, IDC_LABEL_PRECISION_2_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_2_info) );
|
||||||
SetDlgItemText(hWnd, IDC_LABEL_PRECISION_3_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_3_info) );
|
SetDlgItemText(hWnd, IDC_LABEL_PRECISION_3_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_3_info) );
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -408,7 +413,6 @@ int i;
|
|||||||
|
|
||||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_RESETCONTENT, 0, 0);
|
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_RESETCONTENT, 0, 0);
|
||||||
|
|
||||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_ADDSTRING, 0, (LPARAM)GetPrgRes()->GetLanguages()->GuiMessage(Languages::combo_rounding_cut_last_digits) );
|
|
||||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_ADDSTRING, 0, (LPARAM)GetPrgRes()->GetLanguages()->GuiMessage(Languages::combo_rounding_none) );
|
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_ADDSTRING, 0, (LPARAM)GetPrgRes()->GetLanguages()->GuiMessage(Languages::combo_rounding_none) );
|
||||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_ADDSTRING, 0, (LPARAM)GetPrgRes()->GetLanguages()->GuiMessage(Languages::combo_rounding_integer) );
|
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_ADDSTRING, 0, (LPARAM)GetPrgRes()->GetLanguages()->GuiMessage(Languages::combo_rounding_integer) );
|
||||||
|
|
||||||
@@ -427,7 +431,7 @@ int i;
|
|||||||
if( r > max_r )
|
if( r > max_r )
|
||||||
r = max_r;
|
r = max_r;
|
||||||
|
|
||||||
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_SETCURSEL, r+2, 0);
|
SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_SETCURSEL, r+1, 0);
|
||||||
|
|
||||||
|
|
||||||
SetDlgItemText(hWnd, IDC_LABEL_DISPLAY_INPUT, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_input));
|
SetDlgItemText(hWnd, IDC_LABEL_DISPLAY_INPUT, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_input));
|
||||||
@@ -438,9 +442,218 @@ int i;
|
|||||||
SetDlgItemText(hWnd, IDC_RADIO_DISPLAY_NOT_ALWAYS_SCIENTIFIC, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_not_always_scientific));
|
SetDlgItemText(hWnd, IDC_RADIO_DISPLAY_NOT_ALWAYS_SCIENTIFIC, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_not_always_scientific));
|
||||||
|
|
||||||
SetDlgItemText(hWnd, IDC_LABEL_GROUP_SCIENTIFIC, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_group_scientific));
|
SetDlgItemText(hWnd, IDC_LABEL_GROUP_SCIENTIFIC, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_group_scientific));
|
||||||
|
|
||||||
|
SetDlgItemText(hWnd, IDC_LABEL_DECIMAL_POINT, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_decimal_point));
|
||||||
|
|
||||||
|
SetDlgItemText(hWnd, IDC_CHECK_REMOVE_ZEROES, GetPrgRes()->GetLanguages()->GuiMessage(Languages::check_remove_zeroes));
|
||||||
|
|
||||||
|
SetDlgItemText(hWnd, IDC_LABEL_DISPLAY_DEG_RAD_GRAD, GetPrgRes()->GetLanguages()->GuiMessage(Languages::display_deg_rad_grad));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
|
||||||
|
-1 if there's no such item
|
||||||
|
*/
|
||||||
|
int FindItem(HWND list, int i)
|
||||||
|
{
|
||||||
|
LVFINDINFO info;
|
||||||
|
|
||||||
|
info.flags = LVFI_PARAM;
|
||||||
|
info.lParam = i;
|
||||||
|
|
||||||
|
return ListView_FindItem(list, -1, &info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TabConvertFillUpUnitList(HWND list, int conv_type)
|
||||||
|
{
|
||||||
|
Convert * pconv = GetPrgRes()->GetConvert();
|
||||||
|
unsigned int len = pconv->GetUnitSize();
|
||||||
|
unsigned int i, index;
|
||||||
|
|
||||||
|
ListView_DeleteAllItems(list);
|
||||||
|
|
||||||
|
LVITEM item;
|
||||||
|
item.mask = LVIF_PARAM | LVIF_TEXT;
|
||||||
|
item.iSubItem = 0;
|
||||||
|
|
||||||
|
for( i=index=0 ; i<len ; ++i )
|
||||||
|
{
|
||||||
|
if( pconv->GetUnitType(i) == conv_type )
|
||||||
|
{
|
||||||
|
item.lParam = i;
|
||||||
|
item.iItem = index++;
|
||||||
|
int country = static_cast<unsigned int>(GetPrgRes()->GetLanguages()->GetCurrentLanguage());
|
||||||
|
item.pszText = const_cast<char*>(pconv->GetUnitName(country, i));
|
||||||
|
|
||||||
|
ListView_InsertItem(list, &item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TabConvertFillUpUnitLists(HWND hWnd)
|
||||||
|
{
|
||||||
|
HWND list2b = GetDlgItem(hWnd, IDC_LIST_UNIT_INPUT2);
|
||||||
|
HWND list3b = GetDlgItem(hWnd, IDC_LIST_UNIT_OUTPUT2);
|
||||||
|
int input, output;
|
||||||
|
|
||||||
|
int convtype = GetPrgRes()->GetConvert()->GetCurrentType();
|
||||||
|
|
||||||
|
TabConvertFillUpUnitList(list2b, convtype);
|
||||||
|
TabConvertFillUpUnitList(list3b, convtype);
|
||||||
|
GetPrgRes()->GetConvert()->GetCurrentUnit( convtype, input, output);
|
||||||
|
|
||||||
|
if( input >= 0 )
|
||||||
|
{
|
||||||
|
int i = FindItem(list2b, input);
|
||||||
|
|
||||||
|
if( i >= 0 )
|
||||||
|
ListView_SetItemState(list2b, i, LVIS_SELECTED, LVIS_SELECTED); //LVIS_FOCUSED
|
||||||
|
}
|
||||||
|
|
||||||
|
if( output >= 0 )
|
||||||
|
{
|
||||||
|
int i = FindItem(list3b, output);
|
||||||
|
|
||||||
|
if( i>=0 )
|
||||||
|
ListView_SetItemState(list3b, i, LVIS_SELECTED, LVIS_SELECTED); //LVIS_FOCUSED
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
we must check whether the item id is really selected
|
||||||
|
(this method is called from WM_NOTIFY and can be another states on the item)
|
||||||
|
*/
|
||||||
|
void TabConvertTypeChanged(HWND hWnd, int id)
|
||||||
|
{
|
||||||
|
HWND list1 = GetDlgItem(hWnd, IDC_LIST_UNIT_TYPE);
|
||||||
|
|
||||||
|
if( ListView_GetItemState(list1, id, LVIS_SELECTED | LVIS_FOCUSED) != (LVIS_SELECTED | LVIS_FOCUSED) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
// the item is selected now
|
||||||
|
LVITEM item;
|
||||||
|
item.iItem = id;
|
||||||
|
item.iSubItem = 0;
|
||||||
|
item.mask = LVIF_PARAM;
|
||||||
|
if( !ListView_GetItem(list1, &item) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
|
GetPrgRes()->GetConvert()->SetCurrentType( (int)item.lParam );
|
||||||
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
TabConvertFillUpUnitLists(hWnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
we must check whether the item id is really selected
|
||||||
|
(this method is called from WM_NOTIFY and can be another states on the item)
|
||||||
|
*/
|
||||||
|
void TabConvertUnitInputChanged(HWND hWnd, int id)
|
||||||
|
{
|
||||||
|
HWND list2b = GetDlgItem(hWnd, IDC_LIST_UNIT_INPUT2);
|
||||||
|
|
||||||
|
if( ListView_GetItemState(list2b, id, LVIS_SELECTED | LVIS_FOCUSED) != (LVIS_SELECTED | LVIS_FOCUSED) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// the item is selected
|
||||||
|
LVITEM item;
|
||||||
|
item.iItem = id;
|
||||||
|
item.iSubItem = 0;
|
||||||
|
item.mask = LVIF_PARAM;
|
||||||
|
if( !ListView_GetItem(list2b, &item) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
int convtype = GetPrgRes()->GetConvert()->GetCurrentType();
|
||||||
|
int input, output;
|
||||||
|
|
||||||
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
|
GetPrgRes()->GetConvert()->GetCurrentUnit(convtype, input, output);
|
||||||
|
GetPrgRes()->GetConvert()->SetCurrentUnit(convtype, (int)item.lParam, output );
|
||||||
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
we must check whether the item id is really selected
|
||||||
|
(this method is called from WM_NOTIFY and can be another states on the item)
|
||||||
|
*/
|
||||||
|
void TabConvertUnitOutputChanged(HWND hWnd, int id)
|
||||||
|
{
|
||||||
|
HWND list3b = GetDlgItem(hWnd, IDC_LIST_UNIT_OUTPUT2);
|
||||||
|
|
||||||
|
if( ListView_GetItemState(list3b, id, LVIS_SELECTED | LVIS_FOCUSED) != (LVIS_SELECTED | LVIS_FOCUSED) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
// the item is selected
|
||||||
|
LVITEM item;
|
||||||
|
item.iItem = id;
|
||||||
|
item.iSubItem = 0;
|
||||||
|
item.mask = LVIF_PARAM;
|
||||||
|
if( !ListView_GetItem(list3b, &item) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
int convtype = GetPrgRes()->GetConvert()->GetCurrentType();
|
||||||
|
int input, output;
|
||||||
|
|
||||||
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
|
GetPrgRes()->GetConvert()->GetCurrentUnit(convtype, input, output);
|
||||||
|
GetPrgRes()->GetConvert()->SetCurrentUnit(convtype, input, (int)item.lParam );
|
||||||
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SetLanguageTabConvert(HWND hWnd)
|
||||||
|
{
|
||||||
|
Languages * plang = GetPrgRes()->GetLanguages();
|
||||||
|
Convert * pconv = GetPrgRes()->GetConvert();
|
||||||
|
|
||||||
|
SetDlgItemText(hWnd, IDC_STATIC_UNIT_CONVERSION, plang->GuiMessage(Languages::convert_type) );
|
||||||
|
SetDlgItemText(hWnd, IDC_STATIC_UNIT_INPUT, plang->GuiMessage(Languages::convert_input) );
|
||||||
|
SetDlgItemText(hWnd, IDC_STATIC_UNIT_OUTPUT, plang->GuiMessage(Languages::convert_output) );
|
||||||
|
SetDlgItemText(hWnd, IDC_COMBO_DYNAMIC_OUTPUT, plang->GuiMessage(Languages::convert_dynamic_output) );
|
||||||
|
|
||||||
|
HWND list1 = GetDlgItem(hWnd, IDC_LIST_UNIT_TYPE);
|
||||||
|
|
||||||
|
ListView_DeleteAllItems(list1);
|
||||||
|
|
||||||
|
LVITEM item;
|
||||||
|
item.mask = LVIF_PARAM | LVIF_TEXT;
|
||||||
|
item.iSubItem = 0;
|
||||||
|
|
||||||
|
unsigned int conv_type_size = pconv->GetTypeSize();
|
||||||
|
|
||||||
|
for(unsigned int i = 0 ; i<conv_type_size ; ++i)
|
||||||
|
{
|
||||||
|
item.lParam = i;
|
||||||
|
item.iItem = i;
|
||||||
|
int country = static_cast<unsigned int>(plang->GetCurrentLanguage());
|
||||||
|
item.pszText = const_cast<char*>(pconv->GetTypeName(country, i));
|
||||||
|
|
||||||
|
ListView_InsertItem(list1, &item);
|
||||||
|
}
|
||||||
|
|
||||||
|
int type = FindItem(list1, GetPrgRes()->GetConvert()->GetCurrentType() );
|
||||||
|
if( type != -1 )
|
||||||
|
ListView_SetItemState(list1, type, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
|
||||||
|
// there'll be generated wm_notify message and the next lists will be changed then
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SetLanguage(HWND hTab)
|
void SetLanguage(HWND hTab)
|
||||||
{
|
{
|
||||||
TCITEM tab;
|
TCITEM tab;
|
||||||
@@ -456,17 +669,32 @@ TCITEM tab;
|
|||||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_functions) );
|
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_functions) );
|
||||||
TabCtrl_SetItem(hTab,tab_functions, &tab);
|
TabCtrl_SetItem(hTab,tab_functions, &tab);
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_precision) );
|
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_precision) );
|
||||||
TabCtrl_SetItem(hTab,tab_precision, &tab);
|
TabCtrl_SetItem(hTab,tab_precision, &tab);
|
||||||
|
#endif
|
||||||
|
|
||||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_display) );
|
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_display) );
|
||||||
TabCtrl_SetItem(hTab,tab_display, &tab);
|
TabCtrl_SetItem(hTab,tab_display, &tab);
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_convert) );
|
||||||
|
TabCtrl_SetItem(hTab,tab_convert, &tab);
|
||||||
|
#endif
|
||||||
|
|
||||||
SetLanguageTabStandard( GetPrgRes()->GetTabWindow(tab_standard) );
|
SetLanguageTabStandard( GetPrgRes()->GetTabWindow(tab_standard) );
|
||||||
SetLanguageTabVariables( GetPrgRes()->GetTabWindow(tab_variables) );
|
SetLanguageTabVariables( GetPrgRes()->GetTabWindow(tab_variables) );
|
||||||
SetLanguageTabFunctions( GetPrgRes()->GetTabWindow(tab_functions) );
|
SetLanguageTabFunctions( GetPrgRes()->GetTabWindow(tab_functions) );
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
SetLanguageTabPrecision( GetPrgRes()->GetTabWindow(tab_precision) );
|
SetLanguageTabPrecision( GetPrgRes()->GetTabWindow(tab_precision) );
|
||||||
SetLanguageTabDisplay( GetPrgRes()->GetTabWindow(tab_display) );
|
#endif
|
||||||
|
|
||||||
|
SetLanguageTabDisplay( GetPrgRes()->GetTabWindow(tab_display) );
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
SetLanguageTabConvert( GetPrgRes()->GetTabWindow(tab_convert) );
|
||||||
|
#endif
|
||||||
|
|
||||||
InvalidateRect(hTab, 0, false);
|
InvalidateRect(hTab, 0, false);
|
||||||
}
|
}
|
||||||
@@ -474,6 +702,8 @@ TCITEM tab;
|
|||||||
|
|
||||||
BOOL WmTabCommand_SetPrecision1(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmTabCommand_SetPrecision1(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
// there are another messages besides that one
|
// there are another messages besides that one
|
||||||
// which is sent when a user clicks on the radio button
|
// which is sent when a user clicks on the radio button
|
||||||
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_1) != BST_CHECKED )
|
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_1) != BST_CHECKED )
|
||||||
@@ -483,12 +713,16 @@ BOOL WmTabCommand_SetPrecision1(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
GetPrgRes()->SetPrecision(0);
|
GetPrgRes()->SetPrecision(0);
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL WmTabCommand_SetPrecision2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmTabCommand_SetPrecision2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
// there are another messages besides that one
|
// there are another messages besides that one
|
||||||
// which is sent when a user clicks on the radio button
|
// which is sent when a user clicks on the radio button
|
||||||
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_2) != BST_CHECKED )
|
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_2) != BST_CHECKED )
|
||||||
@@ -498,12 +732,16 @@ BOOL WmTabCommand_SetPrecision2(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
GetPrgRes()->SetPrecision(1);
|
GetPrgRes()->SetPrecision(1);
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL WmTabCommand_SetPrecision3(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmTabCommand_SetPrecision3(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
// there are another messages besides that one
|
// there are another messages besides that one
|
||||||
// which is sent when a user clicks on the radio button
|
// which is sent when a user clicks on the radio button
|
||||||
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_3) != BST_CHECKED )
|
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_3) != BST_CHECKED )
|
||||||
@@ -513,6 +751,8 @@ BOOL WmTabCommand_SetPrecision3(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
GetPrgRes()->SetPrecision(2);
|
GetPrgRes()->SetPrecision(2);
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,13 +783,52 @@ return true;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL WmTabCommand_DisplayDecimalPointChanged(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if( HIWORD(wParam) != CBN_SELCHANGE )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
|
GetPrgRes()->SetDecimalPoint( (int)SendDlgItemMessage(hWnd, IDC_COMBO_DECIMAL_POINT, CB_GETCURSEL, 0, 0) );
|
||||||
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL WmTabCommand_DisplayRoundingChanged(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmTabCommand_DisplayRoundingChanged(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
if( HIWORD(wParam) != CBN_SELCHANGE )
|
if( HIWORD(wParam) != CBN_SELCHANGE )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
GetPrgRes()->GetThreadController()->StopCalculating();
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
GetPrgRes()->SetDisplayRounding( (int)SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_GETCURSEL, 0, 0) - 2);
|
GetPrgRes()->SetDisplayRounding( (int)SendDlgItemMessage(hWnd, IDC_COMBO_DISPLAY_ROUNDING, CB_GETCURSEL, 0, 0) - 1);
|
||||||
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WmTabCommand_RemoveZeroesChanged(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
|
|
||||||
|
if( IsDlgButtonChecked(hWnd, IDC_CHECK_REMOVE_ZEROES) == BST_CHECKED )
|
||||||
|
GetPrgRes()->SetRemovingZeroes(true);
|
||||||
|
else
|
||||||
|
GetPrgRes()->SetRemovingZeroes(false);
|
||||||
|
|
||||||
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL WmTabCommand_DisplayDegRadGradChanged(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if( HIWORD(wParam) != CBN_SELCHANGE )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
|
GetPrgRes()->SetDegRadGrad( (int)SendDlgItemMessage(hWnd, IDC_COMBO_DEG_RAD_GRAD, CB_GETCURSEL, 0, 0) );
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -701,16 +980,24 @@ void CreateTabCommandMessagesTable(Messages & cmessages)
|
|||||||
cmessages.Associate(IDC_BUTTON_EDIT_FUNCTION, Functions::WmTabCommand_EditFunction);
|
cmessages.Associate(IDC_BUTTON_EDIT_FUNCTION, Functions::WmTabCommand_EditFunction);
|
||||||
cmessages.Associate(IDC_BUTTON_DELETE_FUNCTION, Functions::WmTabCommand_DeleteFunction);
|
cmessages.Associate(IDC_BUTTON_DELETE_FUNCTION, Functions::WmTabCommand_DeleteFunction);
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
|
|
||||||
cmessages.Associate(IDC_RADIO_PRECISION_1, WmTabCommand_SetPrecision1);
|
cmessages.Associate(IDC_RADIO_PRECISION_1, WmTabCommand_SetPrecision1);
|
||||||
cmessages.Associate(IDC_RADIO_PRECISION_2, WmTabCommand_SetPrecision2);
|
cmessages.Associate(IDC_RADIO_PRECISION_2, WmTabCommand_SetPrecision2);
|
||||||
cmessages.Associate(IDC_RADIO_PRECISION_3, WmTabCommand_SetPrecision3);
|
cmessages.Associate(IDC_RADIO_PRECISION_3, WmTabCommand_SetPrecision3);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
cmessages.Associate(IDC_COMBO_DISPLAY_INPUT, WmTabCommand_DisplayInputChanged);
|
cmessages.Associate(IDC_COMBO_DISPLAY_INPUT, WmTabCommand_DisplayInputChanged);
|
||||||
cmessages.Associate(IDC_COMBO_DISPLAY_OUTPUT, WmTabCommand_DisplayOutputChanged);
|
cmessages.Associate(IDC_COMBO_DISPLAY_OUTPUT, WmTabCommand_DisplayOutputChanged);
|
||||||
cmessages.Associate(IDC_COMBO_DISPLAY_ROUNDING, WmTabCommand_DisplayRoundingChanged);
|
cmessages.Associate(IDC_COMBO_DISPLAY_ROUNDING, WmTabCommand_DisplayRoundingChanged);
|
||||||
|
cmessages.Associate(IDC_CHECK_REMOVE_ZEROES, WmTabCommand_RemoveZeroesChanged);
|
||||||
|
|
||||||
cmessages.Associate(IDC_RADIO_DISPLAY_ALWAYS_SCIENTIFIC, WmTabCommand_SetDisplayAlwaysScientific);
|
cmessages.Associate(IDC_RADIO_DISPLAY_ALWAYS_SCIENTIFIC, WmTabCommand_SetDisplayAlwaysScientific);
|
||||||
cmessages.Associate(IDC_RADIO_DISPLAY_NOT_ALWAYS_SCIENTIFIC, WmTabCommand_SetDisplayNotAlwaysScientific);
|
cmessages.Associate(IDC_RADIO_DISPLAY_NOT_ALWAYS_SCIENTIFIC, WmTabCommand_SetDisplayNotAlwaysScientific);
|
||||||
cmessages.Associate(IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC, WmTabCommand_SetDisplayWhenScientific);
|
cmessages.Associate(IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC, WmTabCommand_SetDisplayWhenScientific);
|
||||||
|
cmessages.Associate(IDC_COMBO_DECIMAL_POINT, WmTabCommand_DisplayDecimalPointChanged);
|
||||||
|
cmessages.Associate(IDC_COMBO_DEG_RAD_GRAD, WmTabCommand_DisplayDegRadGradChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -904,7 +1191,9 @@ return true;
|
|||||||
|
|
||||||
BOOL WmInitTabPrecision(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmInitTabPrecision(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
CheckDlgButton(hWnd, IDC_RADIO_PRECISION_1 + GetPrgRes()->GetPrecision(), BST_CHECKED);
|
CheckDlgButton(hWnd, IDC_RADIO_PRECISION_1 + GetPrgRes()->GetPrecision(), BST_CHECKED);
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -964,16 +1253,61 @@ char buffer[20];
|
|||||||
sprintf(buffer,"%d", GetPrgRes()->GetDisplayWhenScientific());
|
sprintf(buffer,"%d", GetPrgRes()->GetDisplayWhenScientific());
|
||||||
SetDlgItemText(hWnd, IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC, buffer);
|
SetDlgItemText(hWnd, IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC, buffer);
|
||||||
|
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DECIMAL_POINT, CB_ADDSTRING, 0, (LPARAM)" .");
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DECIMAL_POINT, CB_ADDSTRING, 0, (LPARAM)" ,");
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DECIMAL_POINT, CB_SETCURSEL, GetPrgRes()->GetDecimalPoint(), 0);
|
||||||
|
|
||||||
|
if( GetPrgRes()->GetRemovingZeroes() )
|
||||||
|
CheckDlgButton(hWnd, IDC_CHECK_REMOVE_ZEROES, BST_CHECKED);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DEG_RAD_GRAD, CB_ADDSTRING, 0, (LPARAM)"deg");
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DEG_RAD_GRAD, CB_ADDSTRING, 0, (LPARAM)"rad");
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DEG_RAD_GRAD, CB_ADDSTRING, 0, (LPARAM)"grad");
|
||||||
|
|
||||||
|
SendDlgItemMessage(hWnd, IDC_COMBO_DEG_RAD_GRAD, CB_SETCURSEL, GetPrgRes()->GetDegRadGrad(), 0);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BOOL WmInitTabConvert(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
HWND list1 = GetDlgItem(hWnd, IDC_LIST_UNIT_TYPE);
|
||||||
|
HWND list2b = GetDlgItem(hWnd, IDC_LIST_UNIT_INPUT2);
|
||||||
|
HWND list3b = GetDlgItem(hWnd, IDC_LIST_UNIT_OUTPUT2);
|
||||||
|
|
||||||
|
ListView_SetExtendedListViewStyle(list1, LVS_EX_FULLROWSELECT);
|
||||||
|
ListView_SetExtendedListViewStyle(list2b, LVS_EX_FULLROWSELECT);
|
||||||
|
ListView_SetExtendedListViewStyle(list3b, LVS_EX_FULLROWSELECT);
|
||||||
|
|
||||||
|
LVCOLUMN col;
|
||||||
|
|
||||||
|
col.mask = LVCF_FMT | LVCF_WIDTH;
|
||||||
|
col.fmt = LVCFMT_LEFT;
|
||||||
|
|
||||||
|
col.cx = 70;
|
||||||
|
ListView_InsertColumn(list1, 0, &col);
|
||||||
|
|
||||||
|
col.cx = 90;
|
||||||
|
ListView_InsertColumn(list2b, 0, &col);
|
||||||
|
|
||||||
|
col.cx = 90;
|
||||||
|
ListView_InsertColumn(list3b, 0, &col);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL WmNotify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmNotify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
NMHDR * pnmh = (LPNMHDR) lParam;
|
NMHDR * pnmh = (LPNMHDR) lParam;
|
||||||
HWND var_list = GetDlgItem(hWnd,IDC_VARIABLES_LIST);
|
HWND var_list = GetDlgItem(hWnd,IDC_VARIABLES_LIST);
|
||||||
HWND fun_list = GetDlgItem(hWnd,IDC_FUNCTIONS_LIST);
|
HWND fun_list = GetDlgItem(hWnd,IDC_FUNCTIONS_LIST);
|
||||||
|
|
||||||
|
|
||||||
if( pnmh->hwndFrom == var_list )
|
if( pnmh->hwndFrom == var_list )
|
||||||
{
|
{
|
||||||
@@ -1022,6 +1356,32 @@ HWND fun_list = GetDlgItem(hWnd,IDC_FUNCTIONS_LIST);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
HWND conv_list1 = GetDlgItem(hWnd,IDC_LIST_UNIT_TYPE);
|
||||||
|
HWND conv_list2b = GetDlgItem(hWnd,IDC_LIST_UNIT_INPUT2);
|
||||||
|
HWND conv_list3b = GetDlgItem(hWnd,IDC_LIST_UNIT_OUTPUT2);
|
||||||
|
|
||||||
|
if( pnmh->hwndFrom==conv_list1 || pnmh->hwndFrom==conv_list2b || pnmh->hwndFrom==conv_list3b )
|
||||||
|
{
|
||||||
|
if( pnmh->code == LVN_ITEMCHANGED )
|
||||||
|
{
|
||||||
|
NMLISTVIEW * pnmv = (NMLISTVIEW*) lParam;
|
||||||
|
|
||||||
|
if( pnmv->iItem != -1 )
|
||||||
|
{
|
||||||
|
if( pnmh->hwndFrom == conv_list1 )
|
||||||
|
TabConvertTypeChanged(hWnd, pnmv->iItem);
|
||||||
|
if( pnmh->hwndFrom == conv_list2b )
|
||||||
|
TabConvertUnitInputChanged(hWnd, pnmv->iItem);
|
||||||
|
else
|
||||||
|
if( pnmh->hwndFrom == conv_list3b )
|
||||||
|
TabConvertUnitOutputChanged(hWnd, pnmv->iItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1034,8 +1394,17 @@ void CreateTabMessagesTable(Messages & messages)
|
|||||||
messages.Associate(WM_COMMAND, WmTabCommand);
|
messages.Associate(WM_COMMAND, WmTabCommand);
|
||||||
messages.Associate(WM_INIT_TAB_VARIABLES, WmInitTabVariables);
|
messages.Associate(WM_INIT_TAB_VARIABLES, WmInitTabVariables);
|
||||||
messages.Associate(WM_INIT_TAB_FUNCTIONS, WmInitTabFunctions);
|
messages.Associate(WM_INIT_TAB_FUNCTIONS, WmInitTabFunctions);
|
||||||
|
|
||||||
|
#ifndef TTCALC_PORTABLE
|
||||||
messages.Associate(WM_INIT_TAB_PRECISION, WmInitTabPrecision);
|
messages.Associate(WM_INIT_TAB_PRECISION, WmInitTabPrecision);
|
||||||
|
#endif
|
||||||
|
|
||||||
messages.Associate(WM_INIT_TAB_DISPLAY, WmInitTabDisplay);
|
messages.Associate(WM_INIT_TAB_DISPLAY, WmInitTabDisplay);
|
||||||
|
|
||||||
|
#ifdef TTCALC_CONVERT
|
||||||
|
messages.Associate(WM_INIT_TAB_CONVERT, WmInitTabConvert);
|
||||||
|
#endif
|
||||||
|
|
||||||
messages.Associate(WM_NOTIFY, WmNotify);
|
messages.Associate(WM_NOTIFY, WmNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,60 +1422,138 @@ return messages.Call(message, hWnd, message, wParam, lParam);
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
POINT ResizeTabDialog(HWND tab, HWND dialog, int tabx, int taby, int borderx, int bordery)
|
||||||
void SetSizeOfFunctionVariableList(int tab_id, int list_id, int last_column)
|
|
||||||
{
|
{
|
||||||
HWND main = GetPrgRes()->GetMainWindow();
|
RECT r_dialog;
|
||||||
HWND tab = GetDlgItem(main, IDC_TAB);
|
POINT p, new_dialog_size;
|
||||||
|
|
||||||
POINT p,p2;
|
GetWindowRect(dialog, &r_dialog);
|
||||||
RECT r_main, r;
|
p.x = r_dialog.left;
|
||||||
|
p.y = r_dialog.top;
|
||||||
|
ScreenToClient(tab,&p);
|
||||||
|
new_dialog_size.x = tabx-borderx-p.x;
|
||||||
|
new_dialog_size.y = taby-bordery-p.y;
|
||||||
|
int resize_flags = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||||
|
SetWindowPos(dialog, 0, 0, 0, new_dialog_size.x, new_dialog_size.y, resize_flags);
|
||||||
|
|
||||||
|
return new_dialog_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetSizeOfFunctionVariableList(HWND tab, int tabx, int taby, int borderx, int bordery, int tab_id, int list_id, int last_column)
|
||||||
|
{
|
||||||
|
RECT r;
|
||||||
|
POINT p;
|
||||||
|
|
||||||
HWND dialog = GetPrgRes()->GetTabWindow(tab_id);
|
HWND dialog = GetPrgRes()->GetTabWindow(tab_id);
|
||||||
HWND list = GetDlgItem(dialog, list_id);
|
HWND list = GetDlgItem(dialog, list_id);
|
||||||
|
int resize_flags = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||||
|
|
||||||
GetWindowRect(main, &r_main);
|
ResizeTabDialog(tab, dialog, tabx, taby, borderx, bordery);
|
||||||
int cx = r_main.right - r_main.left;
|
|
||||||
int cy = r_main.bottom - r_main.top;
|
|
||||||
int border_x = GetSystemMetrics(SM_CXDLGFRAME)*2;
|
|
||||||
int border_y = GetSystemMetrics(SM_CYDLGFRAME)*2;
|
|
||||||
|
|
||||||
GetWindowRect(dialog, &r);
|
|
||||||
p.x = r.left;
|
|
||||||
p.y = r.top;
|
|
||||||
p2 = p;
|
|
||||||
p2.x -= r_main.left;
|
|
||||||
p2.y -= r_main.top;
|
|
||||||
ScreenToClient(tab, &p);
|
|
||||||
MoveWindow(dialog, p.x, p.y, cx-p2.x-border_x-2, cy-p2.y-border_y-2, true);
|
|
||||||
|
|
||||||
GetWindowRect(list, &r);
|
GetWindowRect(list, &r);
|
||||||
p.x = r.left;
|
p.x = r.left;
|
||||||
p.y = r.top;
|
p.y = r.top;
|
||||||
p2 = p;
|
ScreenToClient(tab,&p);
|
||||||
p2.x -= r_main.left;
|
int newx = tabx - borderx - p.x;
|
||||||
p2.y -= r_main.top;
|
int newy = taby - bordery - p.y;
|
||||||
ScreenToClient(dialog, &p);
|
SetWindowPos(list, 0, 0, 0, newx, newy, resize_flags);
|
||||||
int list_cx = cx-p2.x-border_x-2;
|
|
||||||
MoveWindow(list, p.x, p.y, list_cx, cy-p2.y-border_y-2, true);
|
|
||||||
|
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for(int i=0 ; i<last_column ; ++i)
|
for(int i=0 ; i<last_column ; ++i)
|
||||||
sum += ListView_GetColumnWidth(list, i);
|
sum += ListView_GetColumnWidth(list, i);
|
||||||
|
|
||||||
if( sum < list_cx - 30 )
|
if( sum < newx - 30 )
|
||||||
ListView_SetColumnWidth(list, last_column, list_cx-sum-25);
|
ListView_SetColumnWidth(list, last_column, newx-sum-25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SetSizeOfVariablesList()
|
void SetSizeOfVariablesList(HWND tab, int tabx, int taby, int borderx, int bordery)
|
||||||
{
|
{
|
||||||
SetSizeOfFunctionVariableList(TabWindowFunctions::tab_variables, IDC_VARIABLES_LIST, 1);
|
SetSizeOfFunctionVariableList(tab, tabx, taby, borderx, bordery, TabWindowFunctions::tab_variables, IDC_VARIABLES_LIST, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetSizeOfFunctionsList()
|
void SetSizeOfFunctionsList(HWND tab, int tabx, int taby, int borderx, int bordery)
|
||||||
{
|
{
|
||||||
SetSizeOfFunctionVariableList(TabWindowFunctions::tab_functions, IDC_FUNCTIONS_LIST, 2);
|
SetSizeOfFunctionVariableList(tab, tabx, taby, borderx, bordery, TabWindowFunctions::tab_functions, IDC_FUNCTIONS_LIST, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetSizeOfConvertingLists(HWND tab, int tabx, int taby, int borderx, int bordery)
|
||||||
|
{
|
||||||
|
RECT r_edit, r;
|
||||||
|
POINT p;
|
||||||
|
|
||||||
|
HWND dialog = GetPrgRes()->GetTabWindow(tab_convert);
|
||||||
|
HWND list1 = GetDlgItem(dialog, IDC_LIST_UNIT_TYPE);
|
||||||
|
HWND info_edit = GetDlgItem(dialog, IDC_EDIT_OUTPUT_INFO);
|
||||||
|
HWND check_dynamic_output = GetDlgItem(dialog, IDC_COMBO_DYNAMIC_OUTPUT);
|
||||||
|
int move_flags = SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||||
|
int move_resize_flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||||
|
|
||||||
|
POINT dialog_new_size = ResizeTabDialog(tab, dialog, tabx, taby, borderx, bordery);
|
||||||
|
|
||||||
|
GetWindowRect(info_edit, &r_edit);
|
||||||
|
|
||||||
|
GetWindowRect(list1, &r);
|
||||||
|
p.x = r.left;
|
||||||
|
p.y = r.top;
|
||||||
|
ScreenToClient(dialog,&p);
|
||||||
|
|
||||||
|
GetWindowRect(dialog, &r);
|
||||||
|
int newy = (r.bottom-r.top) - bordery - (r_edit.bottom-r_edit.top) - p.y;
|
||||||
|
int list1_x = p.x;
|
||||||
|
|
||||||
|
int list2a_cx = tabx/7;
|
||||||
|
int list2b_cx = tabx/5;
|
||||||
|
int list3a_cx = tabx/7;
|
||||||
|
int list3b_cx = tabx/5;
|
||||||
|
|
||||||
|
int marginx = 4;
|
||||||
|
int list1_cx = tabx - list2a_cx - list2b_cx - list3a_cx - list3b_cx - marginx*4 - borderx - 8;
|
||||||
|
|
||||||
|
SetWindowPos(list1, 0, list1_x, p.y, list1_cx, newy, move_resize_flags);
|
||||||
|
|
||||||
|
HWND list2a = GetDlgItem(dialog, IDC_LIST_UNIT_INPUT1);
|
||||||
|
HWND list2b = GetDlgItem(dialog, IDC_LIST_UNIT_INPUT2);
|
||||||
|
HWND list3a = GetDlgItem(dialog, IDC_LIST_UNIT_OUTPUT1);
|
||||||
|
HWND list3b = GetDlgItem(dialog, IDC_LIST_UNIT_OUTPUT2);
|
||||||
|
|
||||||
|
int list2a_x = list1_x + list1_cx + marginx;
|
||||||
|
int list2b_x = list2a_x + list2a_cx + marginx;
|
||||||
|
int list3a_x = list2b_x + list2b_cx + marginx;
|
||||||
|
int list3b_x = list3a_x + list3a_cx + marginx;
|
||||||
|
|
||||||
|
SetWindowPos(list2a, 0, list2a_x, p.y, list2a_cx, newy, move_resize_flags);
|
||||||
|
SetWindowPos(list2b, 0, list2b_x, p.y, list2b_cx, newy, move_resize_flags);
|
||||||
|
SetWindowPos(list3a, 0, list3a_x, p.y, list3a_cx, newy, move_resize_flags);
|
||||||
|
SetWindowPos(list3b, 0, list3b_x, p.y, list3b_cx, newy, move_resize_flags);
|
||||||
|
|
||||||
|
newy = dialog_new_size.y -(r_edit.bottom-r_edit.top);
|
||||||
|
int info_edit_cx = list1_cx + list2a_cx + list2b_cx + marginx*2;
|
||||||
|
SetWindowPos(info_edit, 0, list1_x, newy, info_edit_cx, (r_edit.bottom-r_edit.top), move_resize_flags);
|
||||||
|
|
||||||
|
SetWindowPos(check_dynamic_output, 0, list1_x + info_edit_cx + marginx, newy, 0, 0, move_flags);
|
||||||
|
|
||||||
|
HWND static_type = GetDlgItem(dialog, IDC_STATIC_UNIT_CONVERSION);
|
||||||
|
GetWindowRect(static_type, &r);
|
||||||
|
p.x = r.left;
|
||||||
|
p.y = r.top;
|
||||||
|
ScreenToClient(dialog, &p);
|
||||||
|
SetWindowPos(static_type, 0, list1_x, p.y, 0, 0, move_flags);
|
||||||
|
|
||||||
|
HWND static_input = GetDlgItem(dialog, IDC_STATIC_UNIT_INPUT);
|
||||||
|
SetWindowPos(static_input, 0, list2a_x, p.y, 0, 0, move_flags);
|
||||||
|
|
||||||
|
HWND static_output = GetDlgItem(dialog, IDC_STATIC_UNIT_OUTPUT);
|
||||||
|
SetWindowPos(static_output, 0, list3a_x, p.y, 0, 0, move_flags);
|
||||||
|
|
||||||
|
// setting width of colums inside the lists
|
||||||
|
int vscroll_cx = GetSystemMetrics(SM_CXVSCROLL) + borderx;
|
||||||
|
ListView_SetColumnWidth(list1, 0, list1_cx - vscroll_cx);
|
||||||
|
ListView_SetColumnWidth(list2a, 0, list2a_cx - vscroll_cx);
|
||||||
|
ListView_SetColumnWidth(list2b, 0, list2b_cx - vscroll_cx);
|
||||||
|
ListView_SetColumnWidth(list3a, 0, list3a_cx - vscroll_cx);
|
||||||
|
ListView_SetColumnWidth(list3b, 0, list3b_cx - vscroll_cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
15
src/tabs.h
15
src/tabs.h
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -49,15 +49,12 @@
|
|||||||
#include "programresources.h"
|
#include "programresources.h"
|
||||||
|
|
||||||
|
|
||||||
//#define WM_INIT_TAB_VARIABLES WM_USER+2
|
|
||||||
//#define WM_INIT_TAB_FUNCTIONS WM_USER+3
|
|
||||||
//#define WM_INIT_TAB_PRECISION WM_USER+4
|
|
||||||
|
|
||||||
#define WM_INIT_TAB_VARIABLES WM_APP
|
#define WM_INIT_TAB_VARIABLES WM_APP
|
||||||
#define WM_INIT_TAB_FUNCTIONS WM_APP+1
|
#define WM_INIT_TAB_FUNCTIONS WM_APP+1
|
||||||
#define WM_INIT_TAB_PRECISION WM_APP+2
|
#define WM_INIT_TAB_PRECISION WM_APP+2
|
||||||
#define WM_INIT_TAB_DISPLAY WM_APP+3
|
#define WM_INIT_TAB_DISPLAY WM_APP+3
|
||||||
#define WM_SET_LAST_ERROR WM_APP+4
|
#define WM_SET_LAST_ERROR WM_APP+4
|
||||||
|
#define WM_INIT_TAB_CONVERT WM_APP+5
|
||||||
|
|
||||||
namespace TabWindowFunctions
|
namespace TabWindowFunctions
|
||||||
{
|
{
|
||||||
@@ -66,13 +63,15 @@ extern int tab_variables;
|
|||||||
extern int tab_functions;
|
extern int tab_functions;
|
||||||
extern int tab_precision;
|
extern int tab_precision;
|
||||||
extern int tab_display;
|
extern int tab_display;
|
||||||
|
extern int tab_convert;
|
||||||
extern ttmath::ErrorCode last_code;
|
extern ttmath::ErrorCode last_code;
|
||||||
|
|
||||||
void PrintErrorCode();
|
void PrintErrorCode();
|
||||||
BOOL CALLBACK TabWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
BOOL CALLBACK TabWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
void SetLanguage(HWND hTab);
|
void SetLanguage(HWND hTab);
|
||||||
void SetSizeOfVariablesList();
|
void SetSizeOfVariablesList(HWND tab, int tabx, int taby, int borderx, int bordery);
|
||||||
void SetSizeOfFunctionsList();
|
void SetSizeOfFunctionsList(HWND tab, int tabx, int taby, int borderx, int bordery);
|
||||||
|
void SetSizeOfConvertingLists(HWND tab, int tabx, int taby, int borderx, int bordery);
|
||||||
BOOL WmTabCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
BOOL WmTabCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
void SetSizeOfDialogs();
|
void SetSizeOfDialogs();
|
||||||
|
|
||||||
@@ -101,4 +100,6 @@ extern ttmath::ErrorCode last_code;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
using TabWindowFunctions::Variables::GetSelectedItem;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -243,7 +243,7 @@ NewStopCalculating stop_calculating;
|
|||||||
we make the copy-constructor private so that nobody will be able
|
we make the copy-constructor private so that nobody will be able
|
||||||
to make a copy of the one object of this class
|
to make a copy of the one object of this class
|
||||||
*/
|
*/
|
||||||
ThreadController(const ThreadController & c)
|
ThreadController(const ThreadController &)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -109,10 +109,10 @@ char * pchar;
|
|||||||
pchar = new char[temporary_buffer_size];
|
pchar = new char[temporary_buffer_size];
|
||||||
|
|
||||||
GetDlgItemText(hWnd, IDC_EDIT_VARIABLE_NAME, pchar, temporary_buffer_size);
|
GetDlgItemText(hWnd, IDC_EDIT_VARIABLE_NAME, pchar, temporary_buffer_size);
|
||||||
name = ChangeToSmallLetters( StripWhiteCharacters(pchar) );
|
name = StripWhiteCharacters(pchar);
|
||||||
|
|
||||||
GetDlgItemText(hWnd, IDC_EDIT_VARIABLE_VALUE, pchar, temporary_buffer_size);
|
GetDlgItemText(hWnd, IDC_EDIT_VARIABLE_VALUE, pchar, temporary_buffer_size);
|
||||||
value = ChangeToSmallLetters( StripWhiteCharacters(pchar) );
|
value = StripWhiteCharacters(pchar);
|
||||||
|
|
||||||
delete [] pchar;
|
delete [] pchar;
|
||||||
|
|
||||||
@@ -254,6 +254,7 @@ BOOL WmTabCommand_AddVariable(HWND, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
GetPrgRes()->GetThreadController()->StopCalculating();
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
||||||
code = GetPrgRes()->GetVariables()->Add(name, value);
|
code = GetPrgRes()->GetVariables()->Add(name, value);
|
||||||
|
GetPrgRes()->VariablesChanged();
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
if( code != ttmath::err_ok )
|
if( code != ttmath::err_ok )
|
||||||
@@ -317,6 +318,7 @@ adding = false;
|
|||||||
code = GetPrgRes()->GetVariables()->EditValue(name, value);
|
code = GetPrgRes()->GetVariables()->EditValue(name, value);
|
||||||
// the code should be err_ok here
|
// the code should be err_ok here
|
||||||
|
|
||||||
|
GetPrgRes()->VariablesChanged();
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
if( code != ttmath::err_ok )
|
if( code != ttmath::err_ok )
|
||||||
@@ -366,9 +368,12 @@ int items = ListView_GetSelectedCount(list);
|
|||||||
all_deleted = false;
|
all_deleted = false;
|
||||||
else
|
else
|
||||||
ListView_DeleteItem(list, id);
|
ListView_DeleteItem(list, id);
|
||||||
|
|
||||||
|
GetPrgRes()->VariablesChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||||
|
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -40,19 +40,24 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file mainwin.cpp
|
\file mainwin.cpp
|
||||||
\brief There's defined the entry point to the application
|
\brief There's defined the entry point to the application in this file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
here our application starts
|
the application starts here
|
||||||
*/
|
*/
|
||||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
||||||
{
|
{
|
||||||
GetPrgRes()->SetInstance(hInstance);
|
GetPrgRes()->SetInstance(hInstance);
|
||||||
|
|
||||||
|
// we're using GetLanguages() simultaneously in two threads, this is to be sure
|
||||||
|
// that everything is initialized before the second thread is started
|
||||||
|
GetPrgRes()->GetLanguages()->InitAll();
|
||||||
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::en);
|
GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::en);
|
||||||
|
//GetPrgRes()->GetConvert()->Init();
|
||||||
GetPrgRes()->SetNameOfConfigurationFile();
|
GetPrgRes()->SetNameOfConfigurationFile();
|
||||||
GetPrgRes()->ReadFromFile();
|
GetPrgRes()->ReadFromFile();
|
||||||
|
|
||||||
@@ -66,7 +71,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
|||||||
if( !GetPrgRes()->GetThreadController()->Init() )
|
if( !GetPrgRes()->GetThreadController()->Init() )
|
||||||
return ShowError( Languages::cant_init_calculations );
|
return ShowError( Languages::cant_init_calculations );
|
||||||
|
|
||||||
unsigned int thread_id;
|
unsigned int thread_id;
|
||||||
uintptr_t thread_handle;
|
uintptr_t thread_handle;
|
||||||
if( (thread_handle = _beginthreadex(0,0,CalculationsProcedure, 0, 0, &thread_id)) == 0 )
|
if( (thread_handle = _beginthreadex(0,0,CalculationsProcedure, 0, 0, &thread_id)) == 0 )
|
||||||
return ShowError( Languages::cant_create_thread );
|
return ShowError( Languages::cant_create_thread );
|
||||||
@@ -76,10 +81,13 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
|||||||
if( !GetPrgRes()->GetMainWindow() )
|
if( !GetPrgRes()->GetMainWindow() )
|
||||||
return ShowError( Languages::cant_create_main_window );
|
return ShowError( Languages::cant_create_main_window );
|
||||||
|
|
||||||
|
|
||||||
// there's the main loop of messages here
|
// there's the main loop of messages here
|
||||||
MainMessagesLoop();
|
MainMessagesLoop();
|
||||||
|
|
||||||
|
// there can be another variables/functions saved by other instantion of TTCalc
|
||||||
|
// we're reading them now
|
||||||
|
GetPrgRes()->ReadVariablesFunctionsFromFile();
|
||||||
|
|
||||||
GetPrgRes()->SaveToFile();
|
GetPrgRes()->SaveToFile();
|
||||||
CloseHandle( (HANDLE)thread_handle );
|
CloseHandle( (HANDLE)thread_handle );
|
||||||
|
|
||||||
@@ -102,6 +110,7 @@ return static_cast<int>( error_code );
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
the main loop of messages
|
the main loop of messages
|
||||||
*/
|
*/
|
||||||
@@ -111,36 +120,54 @@ MSG msg;
|
|||||||
|
|
||||||
while( GetMessage(&msg,0,0,0) )
|
while( GetMessage(&msg,0,0,0) )
|
||||||
{
|
{
|
||||||
bool sended = false;
|
bool sent = false;
|
||||||
|
|
||||||
|
// if there's CTRL+C or CTRL+V pressed we're trying to copy
|
||||||
|
// a result from the output edit or trying to paste something from the clipboard
|
||||||
|
if( msg.message==WM_KEYDOWN && (GetKeyState(VK_CONTROL) & 0xff00)!=0 )
|
||||||
|
{
|
||||||
|
if( msg.wParam == 'C' )
|
||||||
|
{
|
||||||
|
if( MainWindowFunctions::CopyResult() )
|
||||||
|
sent = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( msg.wParam == 'V' )
|
||||||
|
{
|
||||||
|
if( MainWindowFunctions::Paste() )
|
||||||
|
sent = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// we give our own special function for navigating from the keyboard
|
// we give our own special function for navigating from the keyboard
|
||||||
// if our function returns false then we use a standard navigation
|
// if our function returns false then we use a standard navigation
|
||||||
// from the system
|
// from the system
|
||||||
if( msg.message == WM_KEYDOWN &&
|
if( !sent && msg.message == WM_KEYDOWN &&
|
||||||
( msg.wParam == VK_TAB ||
|
( msg.wParam == VK_TAB ||
|
||||||
msg.wParam == VK_DOWN || msg.wParam == VK_UP ||
|
msg.wParam == VK_DOWN || msg.wParam == VK_UP ||
|
||||||
msg.wParam == VK_LEFT || msg.wParam == VK_DOWN ) )
|
msg.wParam == VK_LEFT || msg.wParam == VK_DOWN ) )
|
||||||
|
|
||||||
{
|
{
|
||||||
if( MainWindowFunctions::SetNextFocus(msg.wParam) )
|
if( MainWindowFunctions::SetNextFocus(msg.wParam) )
|
||||||
sended = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// firt we try to send our message to dialogs
|
// firt we try to send our message to dialogs
|
||||||
// (the dialogs on the tab control)
|
// (the dialogs on the tab control)
|
||||||
if( !sended )
|
if( !sent )
|
||||||
{
|
{
|
||||||
for(unsigned int i=0 ; i<GetPrgRes()->HowManyTabWindows() && !sended ; ++i)
|
for(unsigned int i=0 ; i<GetPrgRes()->HowManyTabWindows() && !sent ; ++i)
|
||||||
{
|
{
|
||||||
if( IsDialogMessage(GetPrgRes()->GetTabWindow(i), &msg) )
|
if( IsDialogMessage(GetPrgRes()->GetTabWindow(i), &msg) )
|
||||||
sended = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's not a message to any of our dialogs we send it
|
// if it's not a message to any of our dialogs we send it
|
||||||
// to the main window (it's a dialog as well)
|
// to the main window (it's a dialog as well)
|
||||||
if( !sended )
|
if( !sent )
|
||||||
{
|
{
|
||||||
if( !IsDialogMessage(GetPrgRes()->GetMainWindow(), &msg) )
|
if( !IsDialogMessage(GetPrgRes()->GetMainWindow(), &msg) )
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2007, Tomasz Sowa
|
* Copyright (c) 2006-2008, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -64,6 +64,8 @@ void MainMessagesLoop();
|
|||||||
namespace MainWindowFunctions
|
namespace MainWindowFunctions
|
||||||
{
|
{
|
||||||
bool SetNextFocus(WPARAM wParam);
|
bool SetNextFocus(WPARAM wParam);
|
||||||
|
bool CopyResult();
|
||||||
|
bool Paste();
|
||||||
void CreateMainMessagesTable(Messages & messages);
|
void CreateMainMessagesTable(Messages & messages);
|
||||||
BOOL CALLBACK AboutProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
BOOL CALLBACK AboutProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user