diff --git a/CHANGELOG b/CHANGELOG index e15c4a7..a7c11df 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Version 0.9.3 prerelease (2011.01.30): +Version 0.9.3 prerelease (2011.02.08): * added: German translation made by Moritz Beleites * added: on display tab: an option how many digits should be grouped diff --git a/makerelease.sh b/makerelease.sh index b116111..7151769 100644 --- a/makerelease.sh +++ b/makerelease.sh @@ -132,9 +132,9 @@ fi if [ $d = "y" -o $d = "Y" ] then - cp ../setup/ttcalc-setup.exe ./$n-setup.exe -else cp ../setup/ttcalc-setup.exe ./$n-setup.$datestr.exe +else + cp ../setup/ttcalc-setup.exe ./$n-setup.exe fi @@ -176,7 +176,8 @@ fi mkdir $n cp ../src/ttcalcp.exe $n -cp ../src/ttcalc.ini $n +$n/ttcalcp.exe createconfig +mv ttcalc.ini $n mv ttcalc.chm $n cp ../COPYRIGHT $n cp ../README $n @@ -234,7 +235,6 @@ cp ../help/* $n/ttcalc/help cp ../res/* $n/ttcalc/res cp ../setup/* $n/ttcalc/setup cp ../src/* $n/ttcalc/src -rm $n/ttcalc/src/*.ini cp ../COPYRIGHT $n/ttcalc cp ../README $n/ttcalc cp ../CHANGELOG $n/ttcalc @@ -251,6 +251,13 @@ md5sum * > note.txt.md5 echo "MD5 SUMS" > note.txt echo "--------" >> note.txt cat note.txt.md5 >> note.txt + +echo "" >> note.txt +echo "" >> note.txt +echo "CHANGELOG" >> note.txt +echo "---------" >> note.txt +cat ../CHANGELOG >> note.txt + rm note.txt.md5 unix2dos -o note.txt diff --git a/src/functions.cpp b/src/functions.cpp index a108011..4d4c9ec 100644 --- a/src/functions.cpp +++ b/src/functions.cpp @@ -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; diff --git a/src/languages.cpp b/src/languages.cpp index 1a146b6..6024efb 100644 --- a/src/languages.cpp +++ b/src/languages.cpp @@ -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ü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, diff --git a/src/programresources.cpp b/src/programresources.cpp index 2776ddf..0fd3170 100644 --- a/src/programresources.cpp +++ b/src/programresources.cpp @@ -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; diff --git a/src/programresources.h b/src/programresources.h index d2b7d43..0ba7ae0 100644 --- a/src/programresources.h +++ b/src/programresources.h @@ -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 diff --git a/src/tabs.cpp b/src/tabs.cpp index d553622..278439b 100644 --- a/src/tabs.cpp +++ b/src/tabs.cpp @@ -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( 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( 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( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_1) ); ListView_InsertColumn(list, 0, &column); - column.cx = 40; + column.cx = header2_cx; column.pszText = const_cast( 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( GetPrgRes()->GetLanguages()->GuiMessage(Languages::list_functions_header_3) ); ListView_InsertColumn(list, 2, &column); diff --git a/src/variables.cpp b/src/variables.cpp index 194780a..51b0216 100644 --- a/src/variables.cpp +++ b/src/variables.cpp @@ -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; diff --git a/src/winmain.cpp b/src/winmain.cpp index 7a295dc..3af0ac7 100644 --- a/src/winmain.cpp +++ b/src/winmain.cpp @@ -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); diff --git a/src/ttcalc_update.ini b/update/ttcalc_update.ini similarity index 100% rename from src/ttcalc_update.ini rename to update/ttcalc_update.ini