|
From: Mapi B. <ma...@us...> - 2009-10-25 17:52:35
|
Update of /cvsroot/easycalc/PPCport/core In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29263 Modified Files: core_main.cpp Main.cpp Main.h varmgr.cpp varmgr.h Log Message: Functional, not much bugs should be left, still limited in function (no list, no matrix, no graph ..) Index: Main.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/Main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.cpp 17 Oct 2009 13:46:30 -0000 1.2 --- Main.cpp 25 Oct 2009 17:52:15 -0000 1.3 *************** *** 98,102 **** {_T("ans")}, {_T(""),false,true}, // ?? ! {_T("^"),true}, // power {_T("log"),false,true}, {_T("ln"),false,true}, --- 98,102 ---- {_T("ans")}, {_T(""),false,true}, // ?? ! {_T("^"),true,true}, // power {_T("log"),false,true}, {_T("ln"),false,true}, *************** *** 116,119 **** --- 116,120 ---- {_T("angle"),false,true}, {_T("i")}, // Complex_i + {_T("e")}, // e constant {_T(":")}, // column {_T(")")}, *************** *** 129,135 **** {_T("atanh"),false,true}, {_T("log"),false,true}, ! {_T("10^")}, {_T("log2"),false,true}, ! {_T("2^")}, {_T("fact"),false,true}, {_T("ncr"),false,true}, --- 130,136 ---- {_T("atanh"),false,true}, {_T("log"),false,true}, ! {_T("10^"),false,true}, {_T("log2"),false,true}, ! {_T("2^"),false,true}, {_T("fact"),false,true}, {_T("ncr"),false,true}, *************** *** 137,140 **** --- 138,142 ---- {_T("round"),false,true,false,true}, {_T("trunc"),false,true,false,true}, + {_T("ceil"),false,true,false,true}, {_T("floor"),false,true,false,true}, {_T("gamma"),false,true,false,true}, *************** *** 219,225 **** {_T("erf"),false,true,false,true}, {_T("erfc"),false,true,false,true}, {0,NULL,false} }; ! // Currently 149 entries, not counting the last one (NULL). // Don't forget to update BUTTON_COUNT in Main.h if this evolves ! --- 221,228 ---- {_T("erf"),false,true,false,true}, {_T("erfc"),false,true,false,true}, + {_T("Inf")}, // Infinity constant {0,NULL,false} }; ! // Currently 152 entries, not counting the last one (NULL). // Don't forget to update BUTTON_COUNT in Main.h if this evolves ! Index: core_main.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/core_main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** core_main.cpp 17 Oct 2009 13:46:30 -0000 1.2 --- core_main.cpp 25 Oct 2009 17:52:14 -0000 1.3 *************** *** 249,257 **** *repeat = 0; ! if (key == KEY_SHIFT) { ! set_shift(!mode_shift); ! return (mode_running || (keybuf_head != keybuf_tail)); ! } ! /* if (mode_interruptible != NULL) { */ /* We're in the middle of an interruptible function --- 249,253 ---- *repeat = 0; ! #define keydown(a,b) (repeating_key = b) /* if (mode_interruptible != NULL) { */ /* We're in the middle of an interruptible function *************** *** 363,367 **** shell_annunciators(ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH, true); */ /* Feed the dequeued key to the usual suspects */ - #define keydown(a,b) (repeating_key = b) /* keydown(oldshift, oldkey); core_keyup(); --- 359,362 ---- *************** *** 387,399 **** */ if (key != KEY_NONE) { - int shift = mode_shift; - set_shift(false); if (mode_getkey && mode_running) shell_annunciators(ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH, true); ! keydown(shift, key); if (repeating != 0) { *repeat = repeating; repeating = 0; } return (mode_running && !mode_getkey); } --- 382,396 ---- */ if (key != KEY_NONE) { if (mode_getkey && mode_running) shell_annunciators(ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH, ANNVAL_UNCH, true); ! keydown(mode_shift, key); if (repeating != 0) { *repeat = repeating; repeating = 0; } + if (key == KEY_SHIFT) { + set_shift(!mode_shift); + return (mode_running || (keybuf_head != keybuf_tail)); + } return (mode_running && !mode_getkey); } *************** *** 534,537 **** --- 531,539 ---- redisplay(); */ + if (mode_shift && (repeating_key != KEY_SHIFT) + && (repeating_key != KEY_BCKSPC)) { // Release shift when another key is pressed, + // except if back erase + set_shift(false); + } switch (repeating_key) { case KEY_EXE: Index: varmgr.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/varmgr.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** varmgr.cpp 17 Oct 2009 13:46:30 -0000 1.2 --- varmgr.cpp 25 Oct 2009 17:52:15 -0000 1.3 *************** *** 205,222 **** * PARAMETERS: None * ! * RETURN: Nothing * ***********************************************************************/ ! static void varmgr_save_variable(TCHAR *varname, void *hWnd_p, bool fromList) IFACE; ! static void varmgr_save_variable(TCHAR *varname, void *hWnd_p, bool fromList) { Trpn item; CError err; ! if (!varname || !StrLen(varname)) { FrmAlert(altBadVariableName, hWnd_p); ! return; } - if (!varfunc_name_ok(varname,variable)) - return; // If not coming from a drop down list, verify if variable // already exists, and if yes, ask for confirmation. --- 205,220 ---- * PARAMETERS: None * ! * RETURN: false if could not save * ***********************************************************************/ ! static bool varmgr_save_variable(TCHAR *varname, void *hWnd_p, bool fromList) IFACE; ! static bool varmgr_save_variable(TCHAR *varname, void *hWnd_p, bool fromList) { Trpn item; CError err; ! if (!varname || !StrLen(varname) || !varfunc_name_ok(varname,variable)) { FrmAlert(altBadVariableName, hWnd_p); ! return (false); } // If not coming from a drop down list, verify if variable // already exists, and if yes, ask for confirmation. *************** *** 224,236 **** && db_record_exists(varname) && FrmCustomAlert(altConfirmOverwrite, varname, NULL, NULL, hWnd_p)) ! return; item = db_read_variable(_T("ans"),&err); if (err) { FrmAlert(altAnsProblem, hWnd_p); ! return; } db_write_variable(varname,item); rpn_delete(item); } --- 222,236 ---- && db_record_exists(varname) && FrmCustomAlert(altConfirmOverwrite, varname, NULL, NULL, hWnd_p)) ! return (false); item = db_read_variable(_T("ans"),&err); if (err) { FrmAlert(altAnsProblem, hWnd_p); ! return (false); } db_write_variable(varname,item); rpn_delete(item); + + return (true); } *************** *** 270,278 **** * ***********************************************************************/ ! void varmgr_listVar_action(TCHAR *text, void *hWnd_calc, bool saveasvar, bool fromList) { db_delete_list(varlist); if (saveasvar) { ! varmgr_save_variable(text, hWnd_calc, fromList); } } --- 270,279 ---- * ***********************************************************************/ ! bool varmgr_listVar_action(TCHAR *text, void *hWnd_calc, bool saveasvar, bool fromList) { db_delete_list(varlist); if (saveasvar) { ! return (varmgr_save_variable(text, hWnd_calc, fromList)); } + return (true); } Index: varmgr.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/varmgr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** varmgr.h 17 Oct 2009 13:46:30 -0000 1.2 --- varmgr.h 25 Oct 2009 17:52:15 -0000 1.3 *************** *** 36,40 **** TCHAR *varmgr_action(int selection); void varmgr_listVar(Skin *skin, void *hWnd); ! void varmgr_listVar_action(TCHAR *text, void *hWnd_calc, bool saveasvar, bool fromList); void varmgr_popup_builtin(Skin *skin, void *hWnd); TCHAR *varmgr_builtinAction(int selection); --- 36,40 ---- TCHAR *varmgr_action(int selection); void varmgr_listVar(Skin *skin, void *hWnd); ! bool varmgr_listVar_action(TCHAR *text, void *hWnd_calc, bool saveasvar, bool fromList); void varmgr_popup_builtin(Skin *skin, void *hWnd); TCHAR *varmgr_builtinAction(int selection); Index: Main.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/Main.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.h 17 Oct 2009 13:46:30 -0000 1.2 --- Main.h 25 Oct 2009 17:52:15 -0000 1.3 *************** *** 39,43 **** // Number of defined buttons in Main.cpp ! #define BUTTON_COUNT 149 #ifndef _MAIN_C_ --- 39,43 ---- // Number of defined buttons in Main.cpp ! #define BUTTON_COUNT 152 #ifndef _MAIN_C_ |