Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
af284466d6 | |||
97ec3123d9 | |||
aa10a71d13 | |||
8aae2470c5 |
21
CHANGELOG
21
CHANGELOG
@@ -1,3 +1,24 @@
|
||||
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):
|
||||
* changed: on win9x the configuration file is in a folder like:
|
||||
"c:\windows\data application\ttcalc\" now
|
||||
* changed: the program uses the TTMath 0.8.1 now
|
||||
* added: from TTMath 0.8.1:
|
||||
root(x, index), bitand(x,y), bitor(x,y), bitxor(x,y)
|
||||
/band(x,y), bor(x,y), bxor(x,y)/
|
||||
asinh(x), acosh(x), atanh(x), acoth(x) /atgh(x), actgh(x)/
|
||||
* changed: from TTMath 0.8.1: calculations are much faster now
|
||||
especially the factorial() function
|
||||
* changed: from TTMath 0.8.1: the way of parsing operators
|
||||
|
||||
Version 0.8.0 (2007.04.02):
|
||||
* added: the del key deletes a variable or a function now
|
||||
(if the focus is on the list)
|
||||
|
@@ -27,10 +27,17 @@
|
||||
<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">
|
||||
@@ -56,89 +63,106 @@
|
||||
<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>e.g. log(123; 4)=3.471...</dd>
|
||||
<dd>This function calculates the logarithm of x with a base equal 'base'<br>log(123; 4)=3.471...</dd>
|
||||
|
||||
<dt>exp(x)</dt>
|
||||
<dd>This function calculates the exponent of x<br>e.g. exp(20)=e^20=485165195.409...</dd>
|
||||
<dd>This function calculates the exponent of x<br>exp(20)=e^20=485165195.409...</dd>
|
||||
|
||||
<dt>sin(x)</dt>
|
||||
<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>
|
||||
<dd>Cosine of x<br>e.g. cos(1.3)=0.267...<br>The argument x is in radians.</dd>
|
||||
<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>
|
||||
<dd>Tangent of x<br>e.g. tan(3.6)=0.493...<br>The argument x is in radians.</dd>
|
||||
<dd>Tangent of x<br>tan(3.6)=0.493...<br>The argument x is in radians.</dd>
|
||||
|
||||
<dt>cot(x) or ctg(x)</dt>
|
||||
<dd>Cotangent of x<br>e.g. cot(2.3)=-0.893...<br>The argument x is in radians.</dd>
|
||||
<dd>Cotangent of x<br>cot(2.3)=-0.893...<br>The argument x is in radians.</dd>
|
||||
|
||||
<dt>asin(x)</dt>
|
||||
<dd>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
|
||||
<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>
|
||||
<dd>Arc cosine of x<br>e.g. acos(0.9)=0.451...<br>The result is in radians.</dd>
|
||||
<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>
|
||||
<dd>Arc tangent of x<br>e.g. atan(3.3)=1.276...<br>The result is in radians.</dd>
|
||||
<dd>Inverse tangent (arc tangent) of x<br>atan(3.3)=1.276...<br>The result is in radians.</dd>
|
||||
|
||||
<dt>acot(x) or actg(x)</dt>
|
||||
<dd>Arc cotangent of x<br>e.g. acot(10)=0.099...<br>The result is in radians.</dd>
|
||||
<dd>Inverse cotangent (arc cotangent) of x<br>acot(10)=0.099...<br>The result is in radians.</dd>
|
||||
|
||||
<dt>sinh(x)</dt>
|
||||
<dd>This function returns hyperbolic sine of x<br>e.g.sinh(12)=81377.395...</dd>
|
||||
<dd>This function returns hyperbolic sine of x<br>sinh(12)=81377.395...</dd>
|
||||
|
||||
<dt>cosh(x)</dt>
|
||||
<dd>Hyperbolic cosine of x<br>e.g. cosh(8.5)=2457.384...</dd>
|
||||
<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>e.g. tanh(0.67)=0.584...</dd>
|
||||
<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>e.g. coth(1.67)=1.073...</dd>
|
||||
<dd>Hyperbolic cotangent of x<br>coth(1.67)=1.073...</dd>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<dd>This function converts degrees into radians<br>e.g. degtorad(12.5)=0.218166...</dd>
|
||||
<dd>This function converts degrees into radians<br>degtorad(12.5)=0.218166...</dd>
|
||||
|
||||
<dt>DegToRad(deg; min; sec)</dt>
|
||||
<dd>This function converts degrees in the long format (degrees, minutes, seconds) to radians.<br>For example
|
||||
degtorad(12; 30; 0)=0.218166...</dd>
|
||||
|
||||
<dt>RadToDeg(rad)</dt>
|
||||
<dd>This function converts radians into degrees<br>e.g. radtodeg(pi)=180</dd>
|
||||
<dd>This function converts radians into degrees<br>radtodeg(pi)=180</dd>
|
||||
|
||||
<dt>sqrt(x)</dt>
|
||||
<dd>Sqrt returns the square root of x<br>e.g. sqrt(9)=3<br>
|
||||
If you want to calculate another kind of roots for example the cube root use the powering instead e.g.
|
||||
the cube root of 8 is 8^(1/3)=2</dd>
|
||||
<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>e.g. factorial(6)=1*2*3*4*5*6=720</dd>
|
||||
<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>e.g. abs(-10)=10</dd>
|
||||
<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, e.g.<br>
|
||||
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>e.g. mod(10; 2.2)=1.2 because 10=2.2*4 + 1.2</dd>
|
||||
<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>e.g. int(2.7)=2</dd>
|
||||
<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 e.g.<br>
|
||||
<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>
|
||||
@@ -146,7 +170,7 @@ 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, e.g.<br>
|
||||
<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>
|
||||
@@ -154,7 +178,7 @@ 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, e.g.<br>
|
||||
<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>
|
||||
|
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>
|
@@ -18,6 +18,7 @@ operators_priority.html
|
||||
userfunctions.html
|
||||
index.html
|
||||
tips.html
|
||||
bitwise_functions.html
|
||||
|
||||
[INFOTYPES]
|
||||
|
||||
|
@@ -25,6 +25,10 @@
|
||||
<param name="Name" value="Logical operators and functions">
|
||||
<param name="Local" value="logical_functions.html">
|
||||
</OBJECT>
|
||||
<LI> <OBJECT type="text/sitemap">
|
||||
<param name="Name" value="Bitwise functions">
|
||||
<param name="Local" value="bitwise_functions.html">
|
||||
</OBJECT>
|
||||
<LI> <OBJECT type="text/sitemap">
|
||||
<param name="Name" value="User defined variables and functions">
|
||||
<param name="Local" value="userfunctions.html">
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
[Setup]
|
||||
AppName=TTCalc
|
||||
AppVerName=TTCalc 0.8.0
|
||||
AppVerName=TTCalc 0.8.1
|
||||
AppPublisher=Tomasz Sowa
|
||||
AppPublisherURL=http://sourceforge.net/projects/ttcalc
|
||||
AppSupportURL=http://sourceforge.net/projects/ttcalc
|
||||
@@ -24,7 +24,6 @@ Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
Source: "..\..\output\ttcalc.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
|
23
src/Makefile
23
src/Makefile
@@ -1,39 +1,18 @@
|
||||
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 -mthreads -I../../../ttmath
|
||||
name = ttcalc.exe
|
||||
dir_output = ../../output
|
||||
|
||||
|
||||
|
||||
.SUFFIXES: .cpp .o
|
||||
|
||||
.cpp.o:
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
|
||||
all: ttcalc
|
||||
|
||||
include Makefile.dep
|
||||
|
||||
ttcalc: $(o)
|
||||
$(CC) -o $(dir_output)/$(name) $(CFLAGS) $(o) -lcomctl32
|
||||
|
||||
|
||||
resource.o: resource.rc
|
||||
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
|
||||
iniparser.o: iniparser.cpp compileconfig.h iniparser.h
|
||||
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
|
||||
tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
||||
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:
|
||||
rm -f *.o
|
||||
rm -f *.s
|
||||
|
17
src/Makefile.dep
Normal file
17
src/Makefile.dep
Normal file
@@ -0,0 +1,17 @@
|
||||
o = resource.o calculation.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 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
|
||||
iniparser.o: iniparser.cpp compileconfig.h iniparser.h
|
||||
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
|
||||
tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h threadcontroller.h stopcalculating.h
|
||||
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
|
||||
|
||||
.SUFFIXES: .cpp .o
|
||||
|
||||
.cpp.o:
|
||||
$(CC) -c $(CFLAGS) $<
|
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 -mthreads -I../../../ttmath -DTTCALC_PORTABLE
|
||||
name = ttcalcp.exe
|
||||
dir_output = ../../output
|
||||
compressor = upx
|
||||
|
||||
all: ttcalc
|
||||
|
||||
include Makefile.dep
|
||||
|
||||
ttcalc: $(o)
|
||||
$(CC) -o $(dir_output)/$(name) $(CFLAGS) $(o) -lcomctl32
|
||||
$(compressor) -7 $(dir_output)/$(name)
|
||||
|
||||
resource.o: resource.rc
|
||||
windres -DTTCALC_PORTABLE resource.rc resource.o
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f *.s
|
||||
rm -f $(dir_output)/$(name)
|
@@ -49,10 +49,14 @@
|
||||
|
||||
/*!
|
||||
the version of the application
|
||||
|
||||
TTCALC_PRERELEASE_VER is either zero or one
|
||||
if zero that means this is the release version of the program
|
||||
*/
|
||||
#define TTCALC_MAJOR_VER 0
|
||||
#define TTCALC_MINOR_VER 8
|
||||
#define TTCALC_REVISION_VER 0
|
||||
#define TTCALC_REVISION_VER 2
|
||||
#define TTCALC_PRERELEASE_VER 0
|
||||
|
||||
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
/*!
|
||||
\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>
|
||||
|
@@ -228,9 +228,9 @@ void Languages::InitGuiMessagesTab()
|
||||
InsertGuiPair(tab_precision,"Precision");
|
||||
InsertGuiPair(tab_display,"Display");
|
||||
|
||||
InsertGuiPair(radio_precision_1,"Small - 96 bits for mantissa, 32 bits for exponent");
|
||||
InsertGuiPair(radio_precision_2,"Medium - 192 bits for mantissa, 64 bits for exponent");
|
||||
InsertGuiPair(radio_precision_3,"Big - 288 bits for mantissa, 96 bits for 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_3,"Big - 288 bits for the mantissa, 96 bits for the exponent");
|
||||
|
||||
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 valid digits (decimal)");
|
||||
InsertGuiPair(precision_2_info,"(+/-)4.3 e+2776511644261678623, 56 valid digits");
|
||||
@@ -267,28 +267,37 @@ void Languages::InitGuiMessagesTab()
|
||||
InsertGuiPair(menu_help_help, "&Help");
|
||||
InsertGuiPair(menu_help_project_page, "&Project page");
|
||||
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(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_init_common_controls,"I could not initialize the common controls (InitCommonControlsEx)");
|
||||
InsertGuiPair(about_text,
|
||||
"Mathematical calculator TTCalc %d.%d.%d\r\n"
|
||||
"Mathematical calculator TTCalc %d.%d.%d%s%s\r\n"
|
||||
"Author: Tomasz Sowa\r\n"
|
||||
"Contact: t.sowa@slimaczek.pl\r\n"
|
||||
"Licence: (New) BSD licence\r\n"
|
||||
"Project page: http://sourceforge.net/projects/ttcalc\r\n"
|
||||
"Bignum library: TTMath %d.%d.%d\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"
|
||||
"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"
|
||||
"\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"
|
||||
" 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.00\r\n");
|
||||
InsertGuiPair(about_box_title, "About");
|
||||
InsertGuiPair(about_box_button_close, "Close");
|
||||
InsertGuiPair(unknown_error, "An unknown error has occurred");
|
||||
@@ -381,22 +390,31 @@ void Languages::InitGuiMessagesTab()
|
||||
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(about_text,
|
||||
"Kalkulator matematyczny TTCalc %d.%d.%d\r\n"
|
||||
"Kalkulator matematyczny TTCalc %d.%d.%d%s%s\r\n"
|
||||
"Autor: Tomasz Sowa\r\n"
|
||||
"Kontakt: t.sowa@slimaczek.pl\r\n"
|
||||
"Licencja: (New) BSD\r\n"
|
||||
"Strona projektu: http://sourceforge.net/projects/ttcalc\r\n"
|
||||
"Biblioteka du<64>ych liczb: TTMath %d.%d.%d\r\n"
|
||||
"Biblioteka du<64>ych liczb: TTMath %d.%d.%d%s\r\n"
|
||||
"J<EFBFBD>zyk programowania: C++\r\n"
|
||||
"Kompilator: %s\r\n"
|
||||
"%s" // for upx
|
||||
"\r\n"
|
||||
"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"
|
||||
"\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"
|
||||
" tego programu lub chcia<69>by<62> do<64><6F>czy<7A> jako projektant/programista"
|
||||
" poprostu skontaktuj si<73> z autorem."
|
||||
);
|
||||
InsertGuiPair(about_text_portable_version, " wersja portable");
|
||||
InsertGuiPair(about_text_exe_packer, "Paker exe: UPX 3.00\r\n");
|
||||
InsertGuiPair(about_box_title, "O programie");
|
||||
InsertGuiPair(about_box_button_close, "Zamknij");
|
||||
InsertGuiPair(unknown_error, "Nieznany kod b<><62>du");
|
||||
|
@@ -125,6 +125,8 @@ public:
|
||||
cant_find_help,
|
||||
cant_open_project_page,
|
||||
about_text,
|
||||
about_text_portable_version,
|
||||
about_text_exe_packer,
|
||||
about_box_title,
|
||||
about_box_button_close,
|
||||
display_group_scientific,
|
||||
|
@@ -386,28 +386,47 @@ TCITEM tab_item;
|
||||
tab_standard = 0;
|
||||
tab_variables = 1;
|
||||
tab_functions = 2;
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
tab_precision = 3;
|
||||
tab_display = 4;
|
||||
#else
|
||||
tab_precision = -1; // this one will not be used
|
||||
tab_display = 3;
|
||||
#endif
|
||||
|
||||
|
||||
// this insertion must be in the ascending order
|
||||
// (the second parameter of 'TabCtrl_InsertItem')
|
||||
TabCtrl_InsertItem(hTab, tab_standard, &tab_item);
|
||||
TabCtrl_InsertItem(hTab, tab_variables, &tab_item);
|
||||
TabCtrl_InsertItem(hTab, tab_functions, &tab_item);
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
TabCtrl_InsertItem(hTab, tab_precision, &tab_item);
|
||||
#endif
|
||||
|
||||
TabCtrl_InsertItem(hTab, tab_display, &tab_item);
|
||||
|
||||
WmInitDialogCreateTab(hTab, tab_standard, IDD_DIALOG_STANDARD, TabWindowProc);
|
||||
WmInitDialogCreateTab(hTab, tab_variables, IDD_DIALOG_VARIABLES, TabWindowProc);
|
||||
WmInitDialogCreateTab(hTab, tab_functions, IDD_DIALOG_FUNCTIONS, TabWindowProc);
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
WmInitDialogCreateTab(hTab, tab_precision, IDD_DIALOG_PRECISION, TabWindowProc);
|
||||
#endif
|
||||
|
||||
WmInitDialogCreateTab(hTab, tab_display, IDD_DIALOG_DISPLAY, TabWindowProc);
|
||||
|
||||
SetSizeOfDialogs();
|
||||
|
||||
SendMessage(GetPrgRes()->GetTabWindow(tab_variables), WM_INIT_TAB_VARIABLES, 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);
|
||||
#endif
|
||||
|
||||
SendMessage(GetPrgRes()->GetTabWindow(tab_display), WM_INIT_TAB_DISPLAY, 0,0);
|
||||
|
||||
TabWindowFunctions::SetLanguage(hTab);
|
||||
@@ -733,7 +752,7 @@ PROCESS_INFORMATION pi;
|
||||
|
||||
memset(&si,0,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;
|
||||
|
||||
@@ -978,7 +997,7 @@ void CreateMainMessagesTable(Messages & messages)
|
||||
*/
|
||||
void CreateAboutText(char * buffer)
|
||||
{
|
||||
char compiler[30];
|
||||
char compiler[50];
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
@@ -1032,8 +1051,21 @@ char compiler[30];
|
||||
buffer,
|
||||
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text),
|
||||
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)" : "",
|
||||
TTMATH_MAJOR_VER, TTMATH_MINOR_VER, TTMATH_REVISION_VER,
|
||||
compiler);
|
||||
(TTMATH_PRERELEASE_VER!=0)? " (prerelease)" : "",
|
||||
compiler,
|
||||
#ifndef TTCALC_PORTABLE
|
||||
""
|
||||
#else
|
||||
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text_exe_packer)
|
||||
#endif
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -86,6 +86,8 @@ ttmath::ErrorCode ParserManager::Parse()
|
||||
{
|
||||
try
|
||||
{
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
switch( precision )
|
||||
{
|
||||
case 0:
|
||||
@@ -103,6 +105,13 @@ ttmath::ErrorCode ParserManager::Parse()
|
||||
code = parser3.Parse(buffer);
|
||||
break;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
parser1.SetBase(base_input);
|
||||
code = parser1.Parse(buffer);
|
||||
|
||||
#endif
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@@ -151,6 +160,8 @@ void ParserManager::Init()
|
||||
parser1.SetVariables( &variables );
|
||||
parser1.SetFunctions( &functions );
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
parser2.SetStopObject( GetPrgRes()->GetThreadController()->GetStopObject() );
|
||||
parser2.SetVariables( &variables );
|
||||
parser2.SetFunctions( &functions );
|
||||
@@ -158,6 +169,8 @@ void ParserManager::Init()
|
||||
parser3.SetStopObject( GetPrgRes()->GetThreadController()->GetStopObject() );
|
||||
parser3.SetVariables( &variables );
|
||||
parser3.SetFunctions( &functions );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +178,8 @@ void ParserManager::PrintResult()
|
||||
{
|
||||
if( code == ttmath::err_ok )
|
||||
{
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
switch( precision )
|
||||
{
|
||||
case 0:
|
||||
@@ -176,6 +191,12 @@ void ParserManager::PrintResult()
|
||||
default:
|
||||
return PrintResult(parser3);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
return PrintResult(parser1);
|
||||
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -105,9 +105,13 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
ttmath::Parser<ttmath::Big<1,3> > parser1;
|
||||
ttmath::Parser<ttmath::Big<2,6> > parser2;
|
||||
ttmath::Parser<ttmath::Big<3,9> > parser3;
|
||||
#else
|
||||
ttmath::Parser<ttmath::Big<1,3> > parser1;
|
||||
#endif
|
||||
|
||||
ttmath::Objects variables, functions;
|
||||
|
||||
@@ -133,40 +137,19 @@ private:
|
||||
|
||||
for(i=0 ; i<matparser.stack.size() ; ++i)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
if( matparser.stack[i].value.ToString(part,base_output, always_scientific, when_scientific, rounding) )
|
||||
{
|
||||
// we shouldn't have this error in the new version of ToStrign(...)
|
||||
// (it could be if were using very big mantissa and exponent
|
||||
// in the Big type)
|
||||
|
||||
//
|
||||
// look at this: part.erase()
|
||||
//
|
||||
// we're using it because it's something wrong on gcc
|
||||
// when we're compiling with -O3 optimization flag
|
||||
//
|
||||
// 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
|
||||
|
||||
// we shouldn't have had this error in the new version of ToStrign(...)
|
||||
// (where we're using a bigger type for calculating)
|
||||
part = GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
part = GetPrgRes()->GetLanguages()->ErrorMessage(country, ttmath::err_internal_error);
|
||||
}
|
||||
|
||||
result += part;
|
||||
|
||||
|
@@ -461,23 +461,6 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
bool ProgramResources::IsWindowsNt()
|
||||
{
|
||||
OSVERSIONINFO os_info;
|
||||
|
||||
os_info.dwOSVersionInfoSize = sizeof( os_info );
|
||||
|
||||
if( !GetVersionEx( &os_info ) )
|
||||
return false;
|
||||
|
||||
if( os_info.dwPlatformId != VER_PLATFORM_WIN32_NT )
|
||||
// we've got Windows 3.1, Windows 95 or Windows 98
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ProgramResources::ReadTextValueFromRegistry(HKEY main_key, const char * sub_key, const char * value, std::string & result)
|
||||
{
|
||||
HKEY reg_key;
|
||||
@@ -509,19 +492,21 @@ return status;
|
||||
void ProgramResources::SetNameOfConfigurationFile()
|
||||
{
|
||||
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";
|
||||
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;
|
||||
|
||||
// for the first we must check which operating system we're using
|
||||
if( !IsWindowsNt() )
|
||||
return;
|
||||
|
||||
// we're trying to read the value "AppData" from registry
|
||||
// which can be, for instance, as:
|
||||
// "C:\Documents and Settings\user\data application"
|
||||
// "C:\Documents and Settings\user\data application" on WinNT
|
||||
// or "C:\Windows\Data Application\" on Win9x
|
||||
if( ReadTextValueFromRegistry(
|
||||
HKEY_CURRENT_USER,
|
||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
|
||||
@@ -554,7 +539,7 @@ std::string application_data;
|
||||
delete [] buffer;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -45,7 +45,11 @@ END
|
||||
101 DIALOG 0, 0, 265, 150
|
||||
STYLE DS_SETFONT |DS_CENTER |WS_POPUP |WS_SYSMENU |WS_THICKFRAME |WS_MAXIMIZEBOX |WS_MINIMIZEBOX |WS_CAPTION
|
||||
MENU 200
|
||||
#ifndef TTCALC_PORTABLE
|
||||
CAPTION "TTCalc"
|
||||
#else
|
||||
CAPTION "TTCalc portable"
|
||||
#endif
|
||||
FONT 8, "Ms Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "",1000,"EDIT",ES_AUTOHSCROLL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,0,6,260,14
|
||||
@@ -151,6 +155,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
|
||||
END
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
113 DIALOG 0, 0, 287, 90
|
||||
STYLE DS_3DLOOK |DS_FIXEDSYS |DS_SETFONT |WS_CHILD | WS_TABSTOP |WS_GROUP
|
||||
CAPTION "tab4"
|
||||
@@ -164,6 +170,8 @@ BEGIN
|
||||
CONTROL "info 3",1155,"STATIC",SS_LEFT |WS_CHILD |WS_VISIBLE ,28,74,245,8
|
||||
END
|
||||
|
||||
#endif
|
||||
|
||||
114 DIALOG DISCARDABLE 0, 0, 255, 90
|
||||
STYLE DS_3DLOOK | DS_FIXEDSYS |DS_SETFONT |WS_CHILD | WS_TABSTOP |WS_GROUP
|
||||
CAPTION "tab5"
|
||||
@@ -182,6 +190,7 @@ BEGIN
|
||||
GROUPBOX "Print scientific value",1168,11,51,240,31
|
||||
END
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
200 DIALOG DISCARDABLE 0, 0, 349, 202
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
@@ -193,6 +202,20 @@ BEGIN
|
||||
WS_BORDER | NOT WS_TABSTOP
|
||||
DEFPUSHBUTTON "Close",IDOK,175,172,86,14
|
||||
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"
|
||||
|
||||
#endif
|
||||
|
43
src/tabs.cpp
43
src/tabs.cpp
@@ -391,6 +391,8 @@ void SetLanguageTabFunctions(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_2, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_2) );
|
||||
SetDlgItemText(hWnd, IDC_RADIO_PRECISION_3, GetPrgRes()->GetLanguages()->GuiMessage(Languages::radio_precision_3) );
|
||||
@@ -398,6 +400,8 @@ void SetLanguageTabPrecision(HWND hWnd)
|
||||
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_3_INFO, GetPrgRes()->GetLanguages()->GuiMessage(Languages::precision_3_info) );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -456,16 +460,24 @@ TCITEM tab;
|
||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_functions) );
|
||||
TabCtrl_SetItem(hTab,tab_functions, &tab);
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_precision) );
|
||||
TabCtrl_SetItem(hTab,tab_precision, &tab);
|
||||
|
||||
#endif
|
||||
|
||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_display) );
|
||||
TabCtrl_SetItem(hTab,tab_display, &tab);
|
||||
|
||||
SetLanguageTabStandard( GetPrgRes()->GetTabWindow(tab_standard) );
|
||||
SetLanguageTabVariables( GetPrgRes()->GetTabWindow(tab_variables) );
|
||||
SetLanguageTabFunctions( GetPrgRes()->GetTabWindow(tab_functions) );
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
SetLanguageTabPrecision( GetPrgRes()->GetTabWindow(tab_precision) );
|
||||
#endif
|
||||
|
||||
SetLanguageTabDisplay( GetPrgRes()->GetTabWindow(tab_display) );
|
||||
|
||||
InvalidateRect(hTab, 0, false);
|
||||
@@ -474,6 +486,8 @@ TCITEM tab;
|
||||
|
||||
BOOL WmTabCommand_SetPrecision1(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
// there are another messages besides that one
|
||||
// which is sent when a user clicks on the radio button
|
||||
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_1) != BST_CHECKED )
|
||||
@@ -483,12 +497,16 @@ BOOL WmTabCommand_SetPrecision1(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||
GetPrgRes()->SetPrecision(0);
|
||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
BOOL WmTabCommand_SetPrecision2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
// there are another messages besides that one
|
||||
// which is sent when a user clicks on the radio button
|
||||
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_2) != BST_CHECKED )
|
||||
@@ -498,12 +516,16 @@ BOOL WmTabCommand_SetPrecision2(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||
GetPrgRes()->SetPrecision(1);
|
||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
BOOL WmTabCommand_SetPrecision3(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
#ifndef TTCALC_PORTABLE
|
||||
|
||||
// there are another messages besides that one
|
||||
// which is sent when a user clicks on the radio button
|
||||
if( IsDlgButtonChecked(hWnd, IDC_RADIO_PRECISION_3) != BST_CHECKED )
|
||||
@@ -513,6 +535,8 @@ BOOL WmTabCommand_SetPrecision3(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||
GetPrgRes()->SetPrecision(2);
|
||||
GetPrgRes()->GetThreadController()->StartCalculating();
|
||||
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -701,10 +725,14 @@ void CreateTabCommandMessagesTable(Messages & cmessages)
|
||||
cmessages.Associate(IDC_BUTTON_EDIT_FUNCTION, Functions::WmTabCommand_EditFunction);
|
||||
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_2, WmTabCommand_SetPrecision2);
|
||||
cmessages.Associate(IDC_RADIO_PRECISION_3, WmTabCommand_SetPrecision3);
|
||||
|
||||
#endif
|
||||
|
||||
cmessages.Associate(IDC_COMBO_DISPLAY_INPUT, WmTabCommand_DisplayInputChanged);
|
||||
cmessages.Associate(IDC_COMBO_DISPLAY_OUTPUT, WmTabCommand_DisplayOutputChanged);
|
||||
cmessages.Associate(IDC_COMBO_DISPLAY_ROUNDING, WmTabCommand_DisplayRoundingChanged);
|
||||
@@ -904,7 +932,9 @@ return true;
|
||||
|
||||
BOOL WmInitTabPrecision(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
#ifndef TTCALC_PORTABLE
|
||||
CheckDlgButton(hWnd, IDC_RADIO_PRECISION_1 + GetPrgRes()->GetPrecision(), BST_CHECKED);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1026,14 +1056,6 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
BOOL WmTabKeyDown(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
MessageBox(hWnd, "trol", "", 0);
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CreateTabMessagesTable(Messages & messages)
|
||||
@@ -1042,10 +1064,13 @@ void CreateTabMessagesTable(Messages & messages)
|
||||
messages.Associate(WM_COMMAND, WmTabCommand);
|
||||
messages.Associate(WM_INIT_TAB_VARIABLES, WmInitTabVariables);
|
||||
messages.Associate(WM_INIT_TAB_FUNCTIONS, WmInitTabFunctions);
|
||||
|
||||
#ifndef TTCALC_PORTABLE
|
||||
messages.Associate(WM_INIT_TAB_PRECISION, WmInitTabPrecision);
|
||||
#endif
|
||||
|
||||
messages.Associate(WM_INIT_TAB_DISPLAY, WmInitTabDisplay);
|
||||
messages.Associate(WM_NOTIFY, WmNotify);
|
||||
messages.Associate(WM_KEYDOWN, WmTabKeyDown);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -49,10 +49,6 @@
|
||||
#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_FUNCTIONS WM_APP+1
|
||||
#define WM_INIT_TAB_PRECISION WM_APP+2
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
/*!
|
||||
\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>
|
||||
|
Reference in New Issue
Block a user