added: a conversion tab (gui only)
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@51 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
c232565953
commit
758d881510
|
@ -55,8 +55,8 @@
|
||||||
*/
|
*/
|
||||||
#define TTCALC_MAJOR_VER 0
|
#define TTCALC_MAJOR_VER 0
|
||||||
#define TTCALC_MINOR_VER 8
|
#define TTCALC_MINOR_VER 8
|
||||||
#define TTCALC_REVISION_VER 2
|
#define TTCALC_REVISION_VER 3
|
||||||
#define TTCALC_PRERELEASE_VER 0
|
#define TTCALC_PRERELEASE_VER 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -227,6 +227,7 @@ void Languages::InitGuiMessagesTab()
|
||||||
InsertGuiPair(tab_functions,"Functions");
|
InsertGuiPair(tab_functions,"Functions");
|
||||||
InsertGuiPair(tab_precision,"Precision");
|
InsertGuiPair(tab_precision,"Precision");
|
||||||
InsertGuiPair(tab_display,"Display");
|
InsertGuiPair(tab_display,"Display");
|
||||||
|
InsertGuiPair(tab_convert,"Convert");
|
||||||
|
|
||||||
InsertGuiPair(radio_precision_1,"Small - 96 bits for the mantissa, 32 bits for the exponent");
|
InsertGuiPair(radio_precision_1,"Small - 96 bits for the mantissa, 32 bits for the exponent");
|
||||||
InsertGuiPair(radio_precision_2,"Medium - 192 bits for the mantissa, 64 bits for the exponent");
|
InsertGuiPair(radio_precision_2,"Medium - 192 bits for the mantissa, 64 bits for the exponent");
|
||||||
|
@ -249,6 +250,10 @@ void Languages::InitGuiMessagesTab()
|
||||||
InsertGuiPair(display_always_scientific,"Always");
|
InsertGuiPair(display_always_scientific,"Always");
|
||||||
InsertGuiPair(display_not_always_scientific,"When the exponent is greater than:");
|
InsertGuiPair(display_not_always_scientific,"When the exponent is greater than:");
|
||||||
InsertGuiPair(display_group_scientific, "Print the result as the scientific value");
|
InsertGuiPair(display_group_scientific, "Print the result as the scientific value");
|
||||||
|
InsertGuiPair(convert_type, "Conversion type");
|
||||||
|
InsertGuiPair(convert_input, "Input");
|
||||||
|
InsertGuiPair(convert_output, "Output");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "auto output");
|
||||||
|
|
||||||
InsertGuiPair(menu_view, "&View");
|
InsertGuiPair(menu_view, "&View");
|
||||||
InsertGuiPair(menu_edit, "&Edit");
|
InsertGuiPair(menu_edit, "&Edit");
|
||||||
|
@ -343,6 +348,7 @@ void Languages::InitGuiMessagesTab()
|
||||||
InsertGuiPair(tab_functions,"Funkcje");
|
InsertGuiPair(tab_functions,"Funkcje");
|
||||||
InsertGuiPair(tab_precision,"Precyzja");
|
InsertGuiPair(tab_precision,"Precyzja");
|
||||||
InsertGuiPair(tab_display,"Wyœwietlanie");
|
InsertGuiPair(tab_display,"Wyœwietlanie");
|
||||||
|
InsertGuiPair(tab_convert,"Konwersja");
|
||||||
|
|
||||||
InsertGuiPair(radio_precision_1,"Ma³a - 96 bitowa mantysa, 32 bitowy wyk³adnik");
|
InsertGuiPair(radio_precision_1,"Ma³a - 96 bitowa mantysa, 32 bitowy wyk³adnik");
|
||||||
InsertGuiPair(radio_precision_2,"Œrednia - 192 bitowa mantysa, 64 bitowy wyk³adnik");
|
InsertGuiPair(radio_precision_2,"Œrednia - 192 bitowa mantysa, 64 bitowy wyk³adnik");
|
||||||
|
@ -366,6 +372,10 @@ void Languages::InitGuiMessagesTab()
|
||||||
InsertGuiPair(display_always_scientific,"Zawsze");
|
InsertGuiPair(display_always_scientific,"Zawsze");
|
||||||
InsertGuiPair(display_not_always_scientific,"Jeœli eksponent jest wiêkszy ni¿:");
|
InsertGuiPair(display_not_always_scientific,"Jeœli eksponent jest wiêkszy ni¿:");
|
||||||
InsertGuiPair(display_group_scientific, "Wyœwietl wynik w postaci naukowej");
|
InsertGuiPair(display_group_scientific, "Wyœwietl wynik w postaci naukowej");
|
||||||
|
InsertGuiPair(convert_type, "Rodzaj konwersji");
|
||||||
|
InsertGuiPair(convert_input, "Wejœcie");
|
||||||
|
InsertGuiPair(convert_output, "Wyjœcie");
|
||||||
|
InsertGuiPair(convert_dynamic_output, "Automatycznie");
|
||||||
|
|
||||||
InsertGuiPair(menu_view, "&Widok");
|
InsertGuiPair(menu_view, "&Widok");
|
||||||
InsertGuiPair(menu_edit, "&Edycja");
|
InsertGuiPair(menu_edit, "&Edycja");
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
tab_functions,
|
tab_functions,
|
||||||
tab_precision,
|
tab_precision,
|
||||||
tab_display,
|
tab_display,
|
||||||
|
tab_convert,
|
||||||
radio_precision_1,
|
radio_precision_1,
|
||||||
radio_precision_2,
|
radio_precision_2,
|
||||||
radio_precision_3,
|
radio_precision_3,
|
||||||
|
@ -100,6 +101,10 @@ public:
|
||||||
display_rounding,
|
display_rounding,
|
||||||
display_always_scientific,
|
display_always_scientific,
|
||||||
display_not_always_scientific,
|
display_not_always_scientific,
|
||||||
|
convert_type,
|
||||||
|
convert_input,
|
||||||
|
convert_output,
|
||||||
|
convert_dynamic_output,
|
||||||
menu_view,
|
menu_view,
|
||||||
menu_edit,
|
menu_edit,
|
||||||
menu_help,
|
menu_help,
|
||||||
|
|
|
@ -498,12 +498,13 @@ TCITEM tab_item;
|
||||||
#ifndef TTCALC_PORTABLE
|
#ifndef TTCALC_PORTABLE
|
||||||
tab_precision = 3;
|
tab_precision = 3;
|
||||||
tab_display = 4;
|
tab_display = 4;
|
||||||
|
tab_convert = 5;
|
||||||
#else
|
#else
|
||||||
tab_precision = -1; // this one will not be used
|
tab_precision = -1; // this one will not be used
|
||||||
tab_display = 3;
|
tab_display = 3;
|
||||||
|
tab_convert = 4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// this insertion must be in the ascending order
|
// this insertion must be in the ascending order
|
||||||
// (the second parameter of 'TabCtrl_InsertItem')
|
// (the second parameter of 'TabCtrl_InsertItem')
|
||||||
TabCtrl_InsertItem(hTab, tab_standard, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_standard, &tab_item);
|
||||||
|
@ -515,6 +516,7 @@ TCITEM tab_item;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TabCtrl_InsertItem(hTab, tab_display, &tab_item);
|
TabCtrl_InsertItem(hTab, tab_display, &tab_item);
|
||||||
|
TabCtrl_InsertItem(hTab, tab_convert, &tab_item);
|
||||||
|
|
||||||
WmInitDialogCreateTab(hTab, tab_standard, IDD_DIALOG_STANDARD, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_standard, IDD_DIALOG_STANDARD, TabWindowProc);
|
||||||
WmInitDialogCreateTab(hTab, tab_variables, IDD_DIALOG_VARIABLES, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_variables, IDD_DIALOG_VARIABLES, TabWindowProc);
|
||||||
|
@ -525,6 +527,7 @@ TCITEM tab_item;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WmInitDialogCreateTab(hTab, tab_display, IDD_DIALOG_DISPLAY, TabWindowProc);
|
WmInitDialogCreateTab(hTab, tab_display, IDD_DIALOG_DISPLAY, TabWindowProc);
|
||||||
|
WmInitDialogCreateTab(hTab, tab_convert, IDD_DIALOG_CONVERT, TabWindowProc);
|
||||||
|
|
||||||
SetSizeOfDialogs();
|
SetSizeOfDialogs();
|
||||||
|
|
||||||
|
@ -536,6 +539,7 @@ TCITEM tab_item;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SendMessage(GetPrgRes()->GetTabWindow(tab_display), WM_INIT_TAB_DISPLAY, 0,0);
|
SendMessage(GetPrgRes()->GetTabWindow(tab_display), WM_INIT_TAB_DISPLAY, 0,0);
|
||||||
|
SendMessage(GetPrgRes()->GetTabWindow(tab_convert), WM_INIT_TAB_CONVERT, 0,0);
|
||||||
|
|
||||||
TabWindowFunctions::SetLanguage(hTab);
|
TabWindowFunctions::SetLanguage(hTab);
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ private:
|
||||||
|
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
HWND main_window;
|
HWND main_window;
|
||||||
HWND tab_window[5];
|
HWND tab_window[6];
|
||||||
|
|
||||||
int precision;
|
int precision;
|
||||||
bool always_on_top;
|
bool always_on_top;
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
#define IDD_DIALOG_FUNCTIONS 112
|
#define IDD_DIALOG_FUNCTIONS 112
|
||||||
#define IDD_DIALOG_PRECISION 113
|
#define IDD_DIALOG_PRECISION 113
|
||||||
#define IDD_DIALOG_DISPLAY 114
|
#define IDD_DIALOG_DISPLAY 114
|
||||||
|
#define IDD_DIALOG_CONVERT 115
|
||||||
|
|
||||||
#define IDR_MENU 200
|
#define IDR_MENU 200
|
||||||
#define IDC_TAB 1010
|
#define IDC_TAB 1010
|
||||||
|
@ -162,6 +163,19 @@
|
||||||
#define IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC 1166
|
#define IDC_EDIT_DISPLAY_WHEN_SCIENTIFIC 1166
|
||||||
#define IDC_LABEL_GROUP_SCIENTIFIC 1168
|
#define IDC_LABEL_GROUP_SCIENTIFIC 1168
|
||||||
|
|
||||||
|
// convert tab
|
||||||
|
#define IDC_LIST_UNIT_TYPE 1200
|
||||||
|
#define IDC_LIST_UNIT_INPUT1 1201
|
||||||
|
#define IDC_LIST_UNIT_INPUT2 1202
|
||||||
|
#define IDC_LIST_UNIT_OUTPUT1 1203
|
||||||
|
#define IDC_LIST_UNIT_OUTPUT2 1204
|
||||||
|
#define IDC_STATIC_UNIT_INPUT 1205
|
||||||
|
#define IDC_STATIC_UNIT_OUTPUT 1206
|
||||||
|
#define IDC_COMBO_DYNAMIC_OUTPUT 1207
|
||||||
|
#define IDC_EDIT_OUTPUT_INFO 1208
|
||||||
|
#define IDC_STATIC_UNIT_CONVERSION 1209
|
||||||
|
|
||||||
|
|
||||||
// menu
|
// menu
|
||||||
#define IDM_VIEW_INDEX 0
|
#define IDM_VIEW_INDEX 0
|
||||||
#define IDM_EDIT_INDEX 1
|
#define IDM_EDIT_INDEX 1
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
LANGUAGE LANG_POLISH, 1
|
LANGUAGE LANG_POLISH, 1
|
||||||
104 ICON "..\\res\\icon01.ico"
|
104 ICON "..\\res\\icon01.ico"
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
LANGUAGE LANG_NEUTRAL, 0
|
LANGUAGE LANG_NEUTRAL, 0
|
||||||
200 MENU
|
200 MENU
|
||||||
|
@ -190,6 +191,31 @@ BEGIN
|
||||||
GROUPBOX "Print scientific value",1168,11,51,240,31
|
GROUPBOX "Print scientific value",1168,11,51,240,31
|
||||||
END
|
END
|
||||||
|
|
||||||
|
115 DIALOG DISCARDABLE 0, 0, 260, 90
|
||||||
|
STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_CAPTION | WS_GROUP |
|
||||||
|
WS_TABSTOP
|
||||||
|
CAPTION "tab6"
|
||||||
|
FONT 8, "Ms Shell Dlg"
|
||||||
|
BEGIN
|
||||||
|
LTEXT "Conversion type",IDC_STATIC_UNIT_CONVERSION,3,2,63,8
|
||||||
|
LTEXT "Input",IDC_STATIC_UNIT_INPUT,80,2,73,8
|
||||||
|
LTEXT "Output",IDC_STATIC_UNIT_OUTPUT,167,2,80,8
|
||||||
|
CONTROL "List1",IDC_LIST_UNIT_TYPE,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,3,12,67,56
|
||||||
|
CONTROL "List2",IDC_LIST_UNIT_INPUT1,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,80,12,26,56
|
||||||
|
CONTROL "List3",IDC_LIST_UNIT_INPUT2,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,109,12,49,56
|
||||||
|
CONTROL "List4",IDC_LIST_UNIT_OUTPUT1,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,167,12,26,56
|
||||||
|
CONTROL "List5",IDC_LIST_UNIT_OUTPUT2,"SysListView32",LVS_REPORT |
|
||||||
|
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,196,12,60,56
|
||||||
|
EDITTEXT IDC_EDIT_OUTPUT_INFO,3,72,156,14,ES_AUTOHSCROLL |
|
||||||
|
ES_READONLY
|
||||||
|
CONTROL "dynamically output",IDC_COMBO_DYNAMIC_OUTPUT,"Button",
|
||||||
|
BS_AUTOCHECKBOX | WS_TABSTOP,167,74,88,10
|
||||||
|
END
|
||||||
|
|
||||||
#ifndef TTCALC_PORTABLE
|
#ifndef TTCALC_PORTABLE
|
||||||
200 DIALOG DISCARDABLE 0, 0, 349, 202
|
200 DIALOG DISCARDABLE 0, 0, 349, 202
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||||
|
|
32
src/tabs.cpp
32
src/tabs.cpp
|
@ -45,6 +45,7 @@ int tab_variables;
|
||||||
int tab_functions;
|
int tab_functions;
|
||||||
int tab_precision;
|
int tab_precision;
|
||||||
int tab_display;
|
int tab_display;
|
||||||
|
int tab_convert;
|
||||||
|
|
||||||
ttmath::ErrorCode last_code = ttmath::err_ok;
|
ttmath::ErrorCode last_code = ttmath::err_ok;
|
||||||
|
|
||||||
|
@ -445,6 +446,18 @@ int i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetLanguageTabConvert(HWND hWnd)
|
||||||
|
{
|
||||||
|
Languages * plang = GetPrgRes()->GetLanguages();
|
||||||
|
|
||||||
|
SetDlgItemText(hWnd, IDC_STATIC_UNIT_CONVERSION, plang->GuiMessage(Languages::convert_type) );
|
||||||
|
SetDlgItemText(hWnd, IDC_STATIC_UNIT_INPUT, plang->GuiMessage(Languages::convert_input) );
|
||||||
|
SetDlgItemText(hWnd, IDC_STATIC_UNIT_OUTPUT, plang->GuiMessage(Languages::convert_output) );
|
||||||
|
SetDlgItemText(hWnd, IDC_COMBO_DYNAMIC_OUTPUT, plang->GuiMessage(Languages::convert_dynamic_output) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SetLanguage(HWND hTab)
|
void SetLanguage(HWND hTab)
|
||||||
{
|
{
|
||||||
TCITEM tab;
|
TCITEM tab;
|
||||||
|
@ -470,6 +483,9 @@ TCITEM tab;
|
||||||
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_display) );
|
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_display) );
|
||||||
TabCtrl_SetItem(hTab,tab_display, &tab);
|
TabCtrl_SetItem(hTab,tab_display, &tab);
|
||||||
|
|
||||||
|
tab.pszText = const_cast<char*>( GetPrgRes()->GetLanguages()->GuiMessage(Languages::tab_convert) );
|
||||||
|
TabCtrl_SetItem(hTab,tab_convert, &tab);
|
||||||
|
|
||||||
SetLanguageTabStandard( GetPrgRes()->GetTabWindow(tab_standard) );
|
SetLanguageTabStandard( GetPrgRes()->GetTabWindow(tab_standard) );
|
||||||
SetLanguageTabVariables( GetPrgRes()->GetTabWindow(tab_variables) );
|
SetLanguageTabVariables( GetPrgRes()->GetTabWindow(tab_variables) );
|
||||||
SetLanguageTabFunctions( GetPrgRes()->GetTabWindow(tab_functions) );
|
SetLanguageTabFunctions( GetPrgRes()->GetTabWindow(tab_functions) );
|
||||||
|
@ -478,7 +494,8 @@ TCITEM tab;
|
||||||
SetLanguageTabPrecision( GetPrgRes()->GetTabWindow(tab_precision) );
|
SetLanguageTabPrecision( GetPrgRes()->GetTabWindow(tab_precision) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetLanguageTabDisplay( GetPrgRes()->GetTabWindow(tab_display) );
|
SetLanguageTabDisplay( GetPrgRes()->GetTabWindow(tab_display) );
|
||||||
|
SetLanguageTabConvert( GetPrgRes()->GetTabWindow(tab_convert) );
|
||||||
|
|
||||||
InvalidateRect(hTab, 0, false);
|
InvalidateRect(hTab, 0, false);
|
||||||
}
|
}
|
||||||
|
@ -997,6 +1014,17 @@ char buffer[20];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WmInitTabConvert(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL WmNotify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
BOOL WmNotify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -1070,6 +1098,8 @@ void CreateTabMessagesTable(Messages & messages)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
messages.Associate(WM_INIT_TAB_DISPLAY, WmInitTabDisplay);
|
messages.Associate(WM_INIT_TAB_DISPLAY, WmInitTabDisplay);
|
||||||
|
messages.Associate(WM_INIT_TAB_CONVERT, WmInitTabConvert);
|
||||||
|
|
||||||
messages.Associate(WM_NOTIFY, WmNotify);
|
messages.Associate(WM_NOTIFY, WmNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#define WM_INIT_TAB_PRECISION WM_APP+2
|
#define WM_INIT_TAB_PRECISION WM_APP+2
|
||||||
#define WM_INIT_TAB_DISPLAY WM_APP+3
|
#define WM_INIT_TAB_DISPLAY WM_APP+3
|
||||||
#define WM_SET_LAST_ERROR WM_APP+4
|
#define WM_SET_LAST_ERROR WM_APP+4
|
||||||
|
#define WM_INIT_TAB_CONVERT WM_APP+5
|
||||||
|
|
||||||
namespace TabWindowFunctions
|
namespace TabWindowFunctions
|
||||||
{
|
{
|
||||||
|
@ -62,6 +63,7 @@ extern int tab_variables;
|
||||||
extern int tab_functions;
|
extern int tab_functions;
|
||||||
extern int tab_precision;
|
extern int tab_precision;
|
||||||
extern int tab_display;
|
extern int tab_display;
|
||||||
|
extern int tab_convert;
|
||||||
extern ttmath::ErrorCode last_code;
|
extern ttmath::ErrorCode last_code;
|
||||||
|
|
||||||
void PrintErrorCode();
|
void PrintErrorCode();
|
||||||
|
|
Loading…
Reference in New Issue