added: the del key deletes a variable or function now

(if the focus is on the list)
added: showing the error ErrorCode::err_unknown_operator


git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@22 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2007-03-09 19:04:14 +00:00
parent 51c8432170
commit fcd7cdbabf
4 changed files with 26 additions and 7 deletions

View File

@ -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);

View File

@ -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");

View File

@ -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;

View File

@ -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);