2007-02-08 18:54:37 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of TTCalc - a mathematical calculator
|
|
|
|
* and is distributed under the (new) BSD licence.
|
|
|
|
* Author: Tomasz Sowa <t.sowa@slimaczek.pl>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2009-04-02 07:13:27 +02:00
|
|
|
* Copyright (c) 2006-2009, Tomasz Sowa
|
2007-02-08 18:54:37 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* * Neither the name Tomasz Sowa nor the names of contributors to this
|
|
|
|
* project may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
|
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
#include "compileconfig.h"
|
|
|
|
#include "tabs.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace TabWindowFunctions
|
|
|
|
{
|
|
|
|
namespace Functions
|
|
|
|
{
|
|
|
|
std::string caption,name,value;
|
|
|
|
int parameters;
|
|
|
|
bool adding;
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CALLBACK DialogProcFunction(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
static const int temporary_buffer_size = 200;
|
|
|
|
char * pchar;
|
|
|
|
char short_buffer[20];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
switch(message)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
SetWindowText(hWnd, caption.c_str());
|
|
|
|
|
|
|
|
SetDlgItemText(hWnd, IDC_STATIC_FUNCTION_NAME, GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_1));
|
|
|
|
SetDlgItemText(hWnd, IDC_STATIC_FUNCTION_PARAM, GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_2));
|
|
|
|
SetDlgItemText(hWnd, IDC_STATIC_FUNCTION_VALUE, GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_3));
|
|
|
|
|
|
|
|
SetDlgItemText(hWnd, IDOK, GetPrgRes()->GetLanguages()->GuiMessage(Languages::button_ok));
|
|
|
|
SetDlgItemText(hWnd, IDCANCEL,GetPrgRes()->GetLanguages()->GuiMessage(Languages::button_cancel));
|
|
|
|
|
|
|
|
SetDlgItemText(hWnd,IDC_EDIT_FUNCTION_NAME, name.c_str());
|
|
|
|
SetDlgItemText(hWnd,IDC_EDIT_FUNCTION_VALUE, value.c_str());
|
|
|
|
|
|
|
|
for(i=0 ; i<10 ; ++i)
|
|
|
|
{
|
|
|
|
sprintf(short_buffer,"%u", i);
|
|
|
|
SendDlgItemMessage(hWnd,IDC_COMBO_FUNCTION_PARAM,CB_ADDSTRING,0,(LPARAM)short_buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
if( parameters < 0 )
|
|
|
|
parameters = 0;
|
|
|
|
else
|
|
|
|
if( parameters > 9 )
|
|
|
|
parameters = 9;
|
|
|
|
|
|
|
|
SendDlgItemMessage(hWnd,IDC_COMBO_FUNCTION_PARAM,CB_SETCURSEL,parameters,0);
|
|
|
|
|
|
|
|
if( adding )
|
|
|
|
SetFocus(GetDlgItem(hWnd,IDC_EDIT_FUNCTION_NAME));
|
|
|
|
else
|
|
|
|
SetFocus(GetDlgItem(hWnd,IDC_EDIT_FUNCTION_VALUE));
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
if( LOWORD(wParam) == IDOK )
|
|
|
|
{
|
|
|
|
pchar = new char[temporary_buffer_size];
|
|
|
|
|
|
|
|
GetDlgItemText(hWnd, IDC_EDIT_FUNCTION_NAME, pchar, temporary_buffer_size);
|
2008-01-24 00:51:53 +01:00
|
|
|
name = Variables::StripWhiteCharacters(pchar);
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
GetDlgItemText(hWnd, IDC_EDIT_FUNCTION_VALUE, pchar, temporary_buffer_size);
|
2008-01-24 00:51:53 +01:00
|
|
|
value = Variables::StripWhiteCharacters(pchar);
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
parameters = (int)SendDlgItemMessage(hWnd,IDC_COMBO_FUNCTION_PARAM,CB_GETCURSEL,0,0);
|
|
|
|
|
|
|
|
delete [] pchar;
|
|
|
|
|
|
|
|
EndDialog(hWnd,1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if( LOWORD(wParam) == IDCANCEL )
|
|
|
|
{
|
|
|
|
EndDialog(hWnd,0);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
void ShowError(HWND hWnd, ttmath::ErrorCode error)
|
|
|
|
{
|
|
|
|
const char * message;
|
|
|
|
|
|
|
|
switch( error )
|
|
|
|
{
|
|
|
|
case ttmath::err_object_exists:
|
|
|
|
message = GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_add_function_function_exists);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ttmath::err_incorrect_name:
|
|
|
|
message = GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_add_function_incorrect_name);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ttmath::err_unknown_object:
|
|
|
|
message = GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_edit_function_unknown_function);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
message = GetPrgRes()->GetLanguages()->GuiMessage(Languages::unknown_error);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MessageBox( hWnd, message,
|
|
|
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::message_box_caption),
|
|
|
|
MB_ICONERROR);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int AddNewItemToFunctionList(HWND list, const std::string & name,
|
|
|
|
const std::string & value, int parameters)
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
|
|
|
LVITEM item;
|
|
|
|
char buffer[20];
|
|
|
|
|
|
|
|
item.mask = LVIF_TEXT;
|
|
|
|
item.pszText = const_cast<char*>( name.c_str() );
|
|
|
|
item.iSubItem = 0;
|
|
|
|
|
|
|
|
int id = ListView_InsertItem(list, &item);
|
|
|
|
|
|
|
|
sprintf(buffer,"%u", parameters);
|
|
|
|
ListView_SetItemText(list,id,1, buffer);
|
|
|
|
|
|
|
|
ListView_SetItemText(list,id,2,const_cast<char*>( value.c_str() ));
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
|
|
|
|
return id;
|
2007-01-22 12:12:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
void ChangeItemInFunctionList( HWND list, int id, const std::string & old_name,
|
|
|
|
const std::string & new_name, const std::string & value,
|
|
|
|
int parameters)
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
if( old_name != new_name )
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
ListView_DeleteItem(list, id);
|
|
|
|
// as we're using ListView_DeleteItem here the WM_NOTIFY is generated
|
|
|
|
// and system will call SetDisablingEditDeleteFunctionButtons
|
|
|
|
// and eventually the focus will be changed into the 'add' button
|
|
|
|
// (it's a small inconvenience)
|
|
|
|
|
|
|
|
int new_id = AddNewItemToFunctionList(list, new_name, value, parameters);
|
|
|
|
ListView_SetItemState(list,new_id, LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
|
2007-01-22 12:12:01 +01:00
|
|
|
}
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
else
|
2007-03-02 21:29:27 +01:00
|
|
|
{
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
char buffer[20];
|
|
|
|
sprintf(buffer,"%u", parameters);
|
|
|
|
ListView_SetItemText(list,id,1, buffer);
|
|
|
|
ListView_SetItemText(list,id,2,const_cast<char*>( value.c_str() ));
|
2007-03-02 21:29:27 +01:00
|
|
|
}
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
}
|
2007-03-02 21:29:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-08 20:15:55 +01:00
|
|
|
BOOL WmTabCommand_AddFunction(HWND, UINT message, WPARAM wParam, LPARAM lParam)
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
2007-03-08 20:15:55 +01:00
|
|
|
HWND hWnd = GetPrgRes()->GetTabWindow(TabWindowFunctions::tab_functions);
|
|
|
|
caption = GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_add_function_caption);
|
|
|
|
name = "";
|
|
|
|
value = "";
|
2007-01-22 12:12:01 +01:00
|
|
|
parameters = 1;
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
ttmath::ErrorCode code;
|
|
|
|
adding = true;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
do
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
if( !DialogBox(GetPrgRes()->GetInstance(), MAKEINTRESOURCE(IDD_DIALOG_ADD_FUNCTION), hWnd, DialogProcFunction) )
|
|
|
|
break;
|
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
HWND list = GetDlgItem(hWnd, IDC_FUNCTIONS_LIST);
|
|
|
|
|
|
|
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
|
|
|
code = GetPrgRes()->GetFunctions()->Add(name, value, parameters);
|
2009-04-02 07:13:27 +02:00
|
|
|
GetPrgRes()->FunctionsChanged();
|
2007-01-22 12:12:01 +01:00
|
|
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
|
|
|
|
2007-03-02 21:29:27 +01:00
|
|
|
if( code != ttmath::err_ok )
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
ShowError(hWnd, code);
|
2007-03-02 21:29:27 +01:00
|
|
|
else
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
{
|
|
|
|
int id = AddNewItemToFunctionList(list, name, value, parameters);
|
|
|
|
Variables::SelectOnlyOneItem(list,id);
|
|
|
|
}
|
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
}
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
while( code != ttmath::err_ok );
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
(we're also using this method directly without using the main loop of messages)
|
|
|
|
(we don't define the 'lParam' parameter there)
|
|
|
|
*/
|
2007-03-08 20:15:55 +01:00
|
|
|
BOOL WmTabCommand_EditFunction(HWND, UINT message, WPARAM wParam, LPARAM)
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
2007-03-08 20:15:55 +01:00
|
|
|
HWND hWnd = GetPrgRes()->GetTabWindow(TabWindowFunctions::tab_functions);
|
2007-01-22 12:12:01 +01:00
|
|
|
HWND list = GetDlgItem(hWnd, IDC_FUNCTIONS_LIST);
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
adding = false;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
if( ListView_GetSelectedCount(list) != 1 )
|
|
|
|
// there must be only one item selected
|
|
|
|
return true;
|
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
int id = Variables::GetSelectedItem(list);
|
|
|
|
if( id == -1 )
|
|
|
|
return true;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
const int buffer_size = 300;
|
|
|
|
char * buffer = new char[buffer_size];
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
std::string old_name;
|
|
|
|
ttmath::ErrorCode code;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
caption = GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_edit_function_caption);
|
|
|
|
|
|
|
|
ListView_GetItemText(list,id,0,buffer, buffer_size);
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
old_name = name = buffer;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
ListView_GetItemText(list,id,1,buffer, buffer_size);
|
|
|
|
parameters = atoi(buffer);
|
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
ListView_GetItemText(list,id,2,buffer, buffer_size);
|
|
|
|
value = buffer;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
delete [] buffer;
|
2007-01-22 12:12:01 +01:00
|
|
|
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
do
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
if( !DialogBox(GetPrgRes()->GetInstance(), MAKEINTRESOURCE(IDD_DIALOG_ADD_FUNCTION), hWnd, DialogProcFunction) )
|
|
|
|
break;
|
|
|
|
|
|
|
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
|
|
|
|
|
|
|
// firstly we're trying to change the name
|
|
|
|
code = GetPrgRes()->GetFunctions()->EditName(old_name, name);
|
|
|
|
if( code == ttmath::err_ok )
|
|
|
|
// if we've changed the name then we're changing the value and parameters
|
|
|
|
code = GetPrgRes()->GetFunctions()->EditValue(name, value, parameters);
|
|
|
|
|
2009-04-02 07:13:27 +02:00
|
|
|
GetPrgRes()->FunctionsChanged();
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
|
|
|
|
|
|
|
if( code != ttmath::err_ok )
|
|
|
|
ShowError(list, code);
|
|
|
|
else
|
|
|
|
ChangeItemInFunctionList(list, id, old_name, name, value, parameters);
|
2007-01-22 12:12:01 +01:00
|
|
|
}
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
while( code != ttmath::err_ok );
|
2007-01-22 12:12:01 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-09 20:04:14 +01:00
|
|
|
BOOL WmTabCommand_DeleteFunction(HWND, UINT, WPARAM, LPARAM)
|
2007-01-22 12:12:01 +01:00
|
|
|
{
|
2007-03-08 20:15:55 +01:00
|
|
|
HWND hWnd = GetPrgRes()->GetTabWindow(TabWindowFunctions::tab_functions);
|
2007-01-22 12:12:01 +01:00
|
|
|
HWND list = GetDlgItem(hWnd, IDC_FUNCTIONS_LIST);
|
|
|
|
int items = ListView_GetSelectedCount(list);
|
|
|
|
|
|
|
|
if( items == 0 )
|
|
|
|
// there must be at least one item selected
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if( items > 1 )
|
|
|
|
{
|
|
|
|
// we're showing a message to confirm deleting
|
|
|
|
if( MessageBox( hWnd,
|
|
|
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_delete_function_confirm),
|
|
|
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::message_box_caption),
|
|
|
|
MB_ICONWARNING | MB_YESNO) == IDNO )
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
int id;
|
|
|
|
const int buffer_size = 300;
|
|
|
|
char * buffer = new char[buffer_size];
|
|
|
|
bool all_deleted = true;
|
|
|
|
|
|
|
|
GetPrgRes()->GetThreadController()->StopCalculating();
|
|
|
|
|
|
|
|
for( id = ListView_GetItemCount(list)-1 ; id!=-1 ; --id )
|
|
|
|
{
|
|
|
|
if( ListView_GetItemState(list, id, LVIS_SELECTED) == LVIS_SELECTED )
|
|
|
|
{
|
|
|
|
ListView_GetItemText(list,id,0,buffer,buffer_size);
|
added: a user can change the names of variables or functions now
changed: the program uses TTMath 0.8.0 now
added: functions: from TTMath 0.8.0:
DegToDeg(deg, min, sec), DegToRad(deg), DegToRad(deg, min, sec),
RadToDeg(rad), Ceil(x), Floor(x), Sqrt(x), Sinh(x), Cosh(x),
Tanh(x) /Tgh(x)/, Coth(x) /Ctgh(x)/
added: a help
changed: from TTMath 0.8.0:
renamed: CTan() into Cot() or Ctg()
renamed: ACTan() into ACot() or ACtg()
Factorial() has a history log now (it can remember last
10 calculated values)
added: a directory 'help' with files of the help
added: a directory 'setup' with files needed to make an installer
(we're using InnoSetup Compiler to make it)
fixed: the vertical size of the main window when a user uses a different size
of the window caption (especially under the Windows XP Luna)
fixed: on Windows 9x: the program hung when a user clicks on a control
on the first tab (the procedure SetNextFocus(...) has been completely
rewritten and the flag WS_EX_CONTROLPARENT on the tab dialogs has
gone away)
fixed: when started navigating from the keyboard the program showed a wrong
variable or a funtion in the edit dialog
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@28 e52654a7-88a9-db11-a3e9-0013d4bc506e
2007-04-02 02:17:26 +02:00
|
|
|
if( GetPrgRes()->GetFunctions()->Delete(buffer) != ttmath::err_ok )
|
2007-01-22 12:12:01 +01:00
|
|
|
all_deleted = false;
|
|
|
|
else
|
|
|
|
ListView_DeleteItem(list, id);
|
2009-04-02 07:13:27 +02:00
|
|
|
|
|
|
|
GetPrgRes()->FunctionsChanged();
|
2007-01-22 12:12:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-02 07:13:27 +02:00
|
|
|
|
2007-01-22 12:12:01 +01:00
|
|
|
GetPrgRes()->GetThreadController()->StartCalculating();
|
|
|
|
|
|
|
|
delete [] buffer;
|
|
|
|
|
|
|
|
if( !all_deleted )
|
|
|
|
// there are some items which we've not deleted
|
|
|
|
// probably an internal error
|
|
|
|
MessageBox( hWnd,
|
|
|
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::dialog_box_function_not_all_deleted),
|
|
|
|
GetPrgRes()->GetLanguages()->GuiMessage(Languages::message_box_caption),
|
|
|
|
MB_ICONERROR);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
} // namespace
|