diff --git a/src/functions.cpp b/src/functions.cpp index 3c40ca4..e7c01ac 100644 --- a/src/functions.cpp +++ b/src/functions.cpp @@ -275,7 +275,7 @@ return true; } -BOOL WmTabCommand_DeleteFunction(HWND, UINT message, WPARAM wParam, LPARAM lParam) +BOOL WmTabCommand_DeleteFunction(HWND, UINT, WPARAM, LPARAM) { HWND hWnd = GetPrgRes()->GetTabWindow(TabWindowFunctions::tab_functions); HWND list = GetDlgItem(hWnd, IDC_FUNCTIONS_LIST); diff --git a/src/languages.cpp b/src/languages.cpp index 45e73b1..6a50be8 100644 --- a/src/languages.cpp +++ b/src/languages.cpp @@ -95,6 +95,7 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_interrupt,"?"); InsertErrorPair(ttmath::err_overflow,"Overflow"); InsertErrorPair(ttmath::err_unknown_function,"An unknown function"); + InsertErrorPair(ttmath::err_unknown_operator,"An unknown operator"); InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"An unexpected semicolon operator"); InsertErrorPair(ttmath::err_improper_amount_of_arguments,"Improper amount of arguments"); InsertErrorPair(ttmath::err_improper_argument,"Improper argument"); @@ -124,6 +125,7 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_interrupt,"?"); InsertErrorPair(ttmath::err_overflow,"Przekroczony zakres"); InsertErrorPair(ttmath::err_unknown_function,"Nieznana funkcja"); + InsertErrorPair(ttmath::err_unknown_operator,"Nieznany operator"); InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"Nieoczekiwany operator 'średnik'"); InsertErrorPair(ttmath::err_improper_amount_of_arguments,"Niewłaściwa liczba argumentów"); InsertErrorPair(ttmath::err_improper_argument,"Niewłaściwy argument"); @@ -199,13 +201,13 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(dialog_box_add_variable_incorrect_value,"An incorrect value of the variable"); InsertGuiPair(dialog_box_add_variable_variable_exists,"This variable already exists"); InsertGuiPair(dialog_box_edit_variable_unknown_variable,"There isn't this variable in my table. There's probably an internal error!"); - InsertGuiPair(dialog_box_delete_variable_confirm,"Are you sure that you want to delete those variables?"); + InsertGuiPair(dialog_box_delete_variable_confirm,"Are you sure that you want to delete these variables?"); InsertGuiPair(dialog_box_variable_not_all_deleted,"There are some variables which I was not able to delete. Probably an internal error!"); InsertGuiPair(dialog_box_add_function_caption,"Add a new function"); InsertGuiPair(dialog_box_edit_function_caption,"Edit a function"); InsertGuiPair(dialog_box_add_function_function_exists,"This function already exists"); InsertGuiPair(dialog_box_edit_function_unknown_function,"There isn't this function in my table. There's probably an internal error!"); - InsertGuiPair(dialog_box_delete_function_confirm,"Are you sure that you want to delete those functions?"); + InsertGuiPair(dialog_box_delete_function_confirm,"Are you sure that you want to delete these functions?"); InsertGuiPair(dialog_box_function_not_all_deleted,"There are some functions which I was not able to delete. Probably an internal error!"); InsertGuiPair(dialog_box_add_function_incorrect_name,"An incorrect name of the function"); diff --git a/src/tabs.cpp b/src/tabs.cpp index 955bfbe..b310a47 100644 --- a/src/tabs.cpp +++ b/src/tabs.cpp @@ -336,7 +336,6 @@ return true; } - void SetLanguageTabStandard(HWND hWnd) { SetDlgItemText( hWnd,IDC_BUTTON_CLEAR, GetPrgRes()->GetLanguages()->GuiMessage(Languages::button_clear) ); @@ -966,6 +965,7 @@ return true; } + BOOL WmNotify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { NMHDR * pnmh = (LPNMHDR) lParam; @@ -979,12 +979,20 @@ HWND fun_list = GetDlgItem(hWnd,IDC_FUNCTIONS_LIST); SetDisablingEditDeleteVariableButtons( hWnd ); return true; } - + else if( pnmh->code == UINT(NM_DBLCLK) ) { Variables::WmTabCommand_EditVariable(hWnd, WM_COMMAND, IDC_BUTTON_EDIT_VARIABLE, 0); return true; } + else + if( pnmh->code == LVN_KEYDOWN ) + { + NMLVKEYDOWN * pnkd = (NMLVKEYDOWN*) lParam; + + if( pnkd->wVKey == VK_DELETE ) + Variables::WmTabCommand_DeleteVariable(0,0,0,0); + } } if( pnmh->hwndFrom == fun_list ) @@ -994,12 +1002,21 @@ HWND fun_list = GetDlgItem(hWnd,IDC_FUNCTIONS_LIST); SetDisablingEditDeleteFunctionButtons( hWnd ); return true; } - + else if( pnmh->code == UINT(NM_DBLCLK) ) { Functions::WmTabCommand_EditFunction(hWnd, WM_COMMAND, IDC_BUTTON_EDIT_FUNCTION, 0); return true; } + else + if( pnmh->code == LVN_KEYDOWN ) + { + NMLVKEYDOWN * pnkd = (NMLVKEYDOWN*) lParam; + + if( pnkd->wVKey == VK_DELETE ) + Functions::WmTabCommand_DeleteFunction(0,0,0,0); + } + } return false; diff --git a/src/variables.cpp b/src/variables.cpp index ef471c4..da5979d 100644 --- a/src/variables.cpp +++ b/src/variables.cpp @@ -271,7 +271,7 @@ return true; } -BOOL WmTabCommand_DeleteVariable(HWND, UINT message, WPARAM wParam, LPARAM lParam) +BOOL WmTabCommand_DeleteVariable(HWND, UINT, WPARAM, LPARAM) { HWND hWnd = GetPrgRes()->GetTabWindow(TabWindowFunctions::tab_variables); HWND list = GetDlgItem(hWnd, IDC_VARIABLES_LIST);