From: Ton v. O. <tvo...@us...> - 2007-08-10 18:54:37
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17:/tmp/cvs-serv6682 Modified Files: grprefs.c grtaps.c Log Message: New function fp_print_g_double which behaves similar to %g format. Use it for numbers on the graph screen and on the graph preferences form instead of fp_print_double. Index: grtaps.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** grtaps.c 29 Jul 2007 01:31:18 -0000 1.31 --- grtaps.c 10 Aug 2007 18:54:06 -0000 1.32 *************** *** 54,58 **** static double oldrealx = NaN; static double oldrealy = NaN; ! static const TdispPrefs grNumPrefs = { 5, true, disp_normal, disp_decimal, false, false}; /*********************************************************************** --- 54,58 ---- static double oldrealx = NaN; static double oldrealy = NaN; ! //static const TdispPrefs grNumPrefs = { 5, true, disp_normal, disp_decimal, false, false}; /*********************************************************************** *************** *** 388,392 **** { char text[MAX_FP_NUMBER+10]; ! TdispPrefs oldprefs; Char *numtxt; Coord txtwidth; --- 388,392 ---- { char text[MAX_FP_NUMBER+10]; ! // TdispPrefs oldprefs; Char *numtxt; Coord txtwidth; *************** *** 396,405 **** #endif ! oldprefs = fp_set_prefs(grNumPrefs); StrCopy(text,name); numtxt = text + StrLen(text); if (finite(value)) { ! fp_print_double(numtxt, value); txtwidth = FntCharsWidth(text, StrLen(text)); if (align == align_center) { --- 396,405 ---- #endif ! // oldprefs = fp_set_prefs(grNumPrefs); StrCopy(text,name); numtxt = text + StrLen(text); if (finite(value)) { ! fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); if (align == align_center) { *************** *** 416,420 **** } ! fp_set_prefs(oldprefs); } --- 416,420 ---- } ! // fp_set_prefs(oldprefs); } Index: grprefs.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grprefs.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** grprefs.c 28 Dec 2006 03:16:17 -0000 1.27 --- grprefs.c 10 Aug 2007 18:54:06 -0000 1.28 *************** *** 325,332 **** char *text; ! text = display_real(newval); ! FldDelete(pole,0,FldGetTextLength(pole)); ! FldInsert(pole,text,StrLen(text)); MemPtrFree(text); } --- 325,333 ---- char *text; ! text = MemPtrNew(15); ! fp_print_g_double(text, newval, 5); ! FldDelete(pole, 0, FldGetTextLength(pole)); ! FldInsert(pole, text, StrLen(text)); MemPtrFree(text); } |