added: ttcalc can be start with option: createconfig, e.g.

./ttcalc createconfig
       it creates a config file in the current directory and exists
added: on variables and functions tab the carret is set at the end
       of a variable/function value (when edit)
changed: column 'parameters' on functions tab has been enlarged
changed: locales: "param." to "parameters" (english and german)



git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@341 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-02-08 16:15:35 +00:00
parent 8e9a459c9c
commit 6c0a4b110e
10 changed files with 69 additions and 21 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2006-2009, Tomasz Sowa
* Copyright (c) 2006-2011, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,9 +85,14 @@ int i;
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));
SendDlgItemMessage(hWnd, IDC_EDIT_FUNCTION_VALUE, EM_SETSEL, value.size(), value.size());
}
return false;

View File

@@ -459,7 +459,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(list_variables_header_1,"Name");
InsertGuiPair(list_variables_header_2,"Value");
InsertGuiPair(list_functions_header_1,"Name");
InsertGuiPair(list_functions_header_2,"Param.");
InsertGuiPair(list_functions_header_2,"Parameters");
InsertGuiPair(list_functions_header_3,"Value");
InsertGuiPair(button_add,"Add");
@@ -2143,7 +2143,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(list_variables_header_1,"Name");
InsertGuiPair(list_variables_header_2,"Wert");
InsertGuiPair(list_functions_header_1,"Name");
InsertGuiPair(list_functions_header_2,"Param.");
InsertGuiPair(list_functions_header_2,"Parameter");
InsertGuiPair(list_functions_header_3,"Wert");
InsertGuiPair(button_add,"Hinzuf<EFBFBD>gen");
@@ -2236,7 +2236,7 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(cant_init_calculations, "Konnte Modul f<>r die Berechnungen nicht initialisieren");
InsertGuiPair(message_box_error_caption,"TTCalc");
InsertGuiPair(cant_create_thread, "Konnte zweiten Thread f<>r die Berechung nicht erzeugen");
InsertGuiPair(cant_create_pad, "Konnte Fenster f<>r Notizblock nicht erzeugen");
InsertGuiPair(cant_create_pad, "Konnte Fenster f<>r Rechenblock nicht erzeugen");
InsertGuiPair(cant_create_main_window, "Konnte das Hauptfenster nicht erzeugen");
InsertGuiPair(cant_init_common_controls,"Konnte die \"common controls\" nicht initialisieren (InitCommonControlsEx)");
InsertGuiPair(about_text,

View File

@@ -933,6 +933,17 @@ static const char help_name[] = "ttcalc.chm";
/*
it is used when 'createconfig' parameter has been passed to the ttcalc program
*/
void ProgramResources::SetConfigName()
{
configuration_file = "ttcalc.ini";
}
bool ProgramResources::CreateDirIfNotExists(const std::string & app_dir)
{
bool success = false;

View File

@@ -336,6 +336,12 @@ public:
*/
void SetNameOfFiles();
/*!
it is used when 'createconfig' parameter has been passed to the ttcalc program
*/
void SetConfigName();
/*!
returning the name of the help file

View File

@@ -1533,16 +1533,19 @@ BOOL WmInitTabVariables(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND list = GetDlgItem(hWnd, IDC_VARIABLES_LIST);
LVCOLUMN column;
RECT r;
//int list_cx = SetSizeOfList(list);
int list_cx = 280;
GetWindowRect(list, &r);
int list_cx = r.right - r.left;
int header1_cx = 70;
column.mask = LVCF_TEXT | LVCF_WIDTH;
column.cx = 60;
column.cx = header1_cx;
column.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_variables_header_1) );
ListView_InsertColumn(list, 0, &column);
column.cx = list_cx - 60 - 10;
column.cx = list_cx - header1_cx;
column.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_variables_header_2) );
ListView_InsertColumn(list, 1, &column);
@@ -1559,20 +1562,24 @@ BOOL WmInitTabFunctions(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND list = GetDlgItem(hWnd, IDC_FUNCTIONS_LIST);
LVCOLUMN column;
RECT r;
//int list_cx = SetSizeOfList(list);
int list_cx = 280;
GetWindowRect(list, &r);
int list_cx = r.right - r.left;
int header1_cx = 70;
int header2_cx = 70;
column.mask = LVCF_TEXT | LVCF_WIDTH;
column.cx = 60;
column.cx = header1_cx;
column.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_1) );
ListView_InsertColumn(list, 0, &column);
column.cx = 40;
column.cx = header2_cx;
column.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_2) );
ListView_InsertColumn(list, 1, &column);
column.cx = list_cx - 60 - 40 - 10;
column.cx = list_cx - header1_cx - header2_cx;
column.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_3) );
ListView_InsertColumn(list, 2, &column);

View File

@@ -1,19 +0,0 @@
# this file is downloaded from a webserver during checking for an update
[normal]
url = http://downloads.sourceforge.net/project/ttcalc/ttcalc/ttcalc-0.9.2/ttcalc-0.9.2-setup.exe
filename = ttcalc-0.9.2-setup.exe
version.major = 0
version.minor = 9
version.revision = 2
version.prerelease = 0
[portable]
url = http://downloads.sourceforge.net/project/ttcalc/ttcalc/ttcalc-0.9.2/ttcalc-portable-0.9.2-bin.tar.gz
filename = ttcalc-portable-0.9.2-bin.tar.gz
version.major = 0
version.minor = 9
version.revision = 2
version.prerelease = 0

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2006-2009, Tomasz Sowa
* Copyright (c) 2006-2011, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -97,9 +97,14 @@ char * pchar;
SetDlgItemText(hWnd,IDC_EDIT_VARIABLE_VALUE, value.c_str());
if( adding)
{
SetFocus(GetDlgItem(hWnd,IDC_EDIT_VARIABLE_NAME));
}
else
{
SetFocus(GetDlgItem(hWnd,IDC_EDIT_VARIABLE_VALUE));
SendDlgItemMessage(hWnd, IDC_EDIT_VARIABLE_VALUE, EM_SETSEL, value.size(), value.size());
}
return false;

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2006-2009, Tomasz Sowa
* Copyright (c) 2006-2011, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,8 +51,15 @@
/*!
the application starts here
*/
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR par, int)
{
if( strcmp(par, "createconfig") == 0 )
{
GetPrgRes()->SetConfigName();
GetPrgRes()->SaveToFile();
return 0;
}
try
{
GetPrgRes()->SetInstance(hInstance);