From: Jorge G. <cl...@us...> - 2007-12-19 13:20:26
|
Update of /cvsroot/easycalc/easycalc In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv29004 Modified Files: graph.c grcalc.c grtaps.c grtaps.h Log Message: bold font for tracking.\nsome bugfixes in graph mode\nwhen tracking a function, if C is pressed, the function is automatically selected for the calcs Index: graph.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/graph.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** graph.c 18 Dec 2007 09:06:37 -0000 1.62 --- graph.c 19 Dec 2007 13:20:14 -0000 1.63 *************** *** 1046,1050 **** break; case btnGraphCalc: ! grcalc_control(); break; case btnGraphZoomOut: --- 1046,1051 ---- break; case btnGraphCalc: ! /*if(graphState.funcnum>=MAX_GRFUNCS) //avoid tracking while drawing */ ! grcalc_control(); break; case btnGraphZoomOut: *************** *** 1058,1061 **** --- 1059,1066 ---- break; case btnGraphTrack: + /*if(graphState.funcnum<MAX_GRFUNCS){ //avoid tracking while drawing + grtaps_track_pause(); + break; + }*/ if (CtlGetValue(GetObjectPtr(btnGraphTrack))) { if (!grtaps_track_but()) *************** *** 1065,1071 **** } else { /* User unchecked the button */ ! FrmUpdateForm(frmGraph, frmUpdateVars); } - graph_draw_resume(); break; case btnGraphTrackGoto: --- 1070,1076 ---- } else { /* User unchecked the button */ ! grtaps_track_manual(grtaps_track_last_value(),track_redraw); ! grtaps_track_pause(); } break; case btnGraphTrackGoto: *************** *** 1087,1091 **** graph_draw_start(); if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grtaps_track_manual(0.0, track_redraw); handled = true; } --- 1092,1098 ---- graph_draw_start(); if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grtaps_track_pause(); ! /* Cancel the numeric input, if there was any*/ ! grcalc_init(); handled = true; } Index: grtaps.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** grtaps.c 30 Sep 2007 00:35:42 -0000 1.33 --- grtaps.c 19 Dec 2007 13:20:15 -0000 1.34 *************** *** 31,34 **** --- 31,35 ---- #else #define HanderaCoord( x ) ( x ) + #define HanderaAdjustFont( font ) ( font ) #endif *************** *** 46,49 **** --- 47,52 ---- #include "funcs.h" + #define BOLDRES 1 + static Int16 trackSelected = 0; static double lastParam = 0.0; *************** *** 399,403 **** StrCopy(text,name); numtxt = text + StrLen(text); ! if (finite(value)) { fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); --- 402,406 ---- StrCopy(text,name); numtxt = text + StrLen(text); ! //if (finite(value)) { fp_print_g_double(numtxt, value, 4); txtwidth = FntCharsWidth(text, StrLen(text)); *************** *** 415,419 **** WinPaintChars(text, StrLen(text), x, y); WinSetDrawMode(oldmode); ! } } --- 418,422 ---- WinPaintChars(text, StrLen(text), x, y); WinSetDrawMode(oldmode); ! //} } *************** *** 531,534 **** --- 534,544 ---- } else { + FontID oldfont; + #ifdef SONY_SDK + if (gHrMode == hrSony) + oldfont = HRFntSetFont(gHrLibRefNum, hrStdFont+BOLDRES); + else + #endif + oldfont = FntSetFont(HanderaAdjustFont(stdFont+BOLDRES)); gadget_bounds(FrmGetActiveForm(), graphGadget, &natbounds, &stdbounds); *************** *** 572,575 **** --- 582,591 ---- oldangle = math_rad_to_user(lastParam); } + #ifdef SONY_SDK + if(gHrMode == hrSony) + HRFntSetFont(gHrLibRefNum, oldfont); + else + #endif + FntSetFont(oldfont); } } *************** *** 833,836 **** --- 849,859 ---- /* Is tracking checked? */ else if (CtlGetValue(GetObjectPtr(btnGraphTrack))) { + FontID oldfont; + #ifdef SONY_SDK + if (gHrMode == hrSony) + oldfont = HRFntSetFont(gHrLibRefNum, hrStdFont+BOLDRES); + else + #endif + oldfont = FntSetFont(HanderaAdjustFont(stdFont+BOLDRES)); if (graphPrefs.functype == graph_func) grtaps_track_func(x, y, &natbounds, &stdbounds); *************** *** 839,842 **** --- 862,871 ---- else if (graphPrefs.functype == graph_param) grtaps_track_param(x, y, &natbounds, &stdbounds); + #ifdef SONY_SDK + if(gHrMode == hrSony) + HRFntSetFont(gHrLibRefNum, oldfont); + else + #endif + FntSetFont(oldfont); } else /* Move the graph */ *************** *** 864,868 **** FormPtr frm = FrmGetActiveForm(); ! grtaps_track_manual(0, track_add); FrmShowObject(frm, FrmGetObjectIndex(frm, btnGraphTrackGoto)); } --- 893,897 ---- FormPtr frm = FrmGetActiveForm(); ! grtaps_track_manual(0, track_redraw); FrmShowObject(frm, FrmGetObjectIndex(frm, btnGraphTrackGoto)); } *************** *** 947,948 **** --- 976,992 ---- return lastParam; } + + /*********************************************************************** + * + * FUNCTION: grtaps_trackSelected + * + * PARAMETERS: Nothing + * + * RETURN: The index of the function selected for tracking + * + ***********************************************************************/ + Int16 + grtaps_trackSelected(void) + { + return trackSelected; + } Index: grcalc.c =================================================================== RCS file: /cvsroot/easycalc/easycalc/grcalc.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** grcalc.c 25 Aug 2007 17:58:14 -0000 1.20 --- grcalc.c 19 Dec 2007 13:20:15 -0000 1.21 *************** *** 160,166 **** grFuncType = ccs[i]; ! grSelFunction = grcalc_select_funcname(); ! if (grSelFunction == -1) ! return false; switch (grFuncType) { --- 160,171 ---- grFuncType = ccs[i]; ! if (CtlGetValue(GetObjectPtr(btnGraphTrack))) ! grSelFunction=grtaps_trackSelected(); ! else{ ! grSelFunction = grcalc_select_funcname(); ! if (grSelFunction == -1) ! return false; ! grtaps_track_track(grSelFunction); ! } switch (grFuncType) { *************** *** 188,192 **** break; } - grtaps_track_track(grSelFunction); return true; } --- 193,196 ---- *************** *** 366,370 **** else { grState = cl_none; ! grtaps_track_pause(); } break; --- 370,374 ---- else { grState = cl_none; ! //grtaps_track_pause(); } break; *************** *** 373,377 **** grcalc_calculate(); grState = cl_none; ! grtaps_track_pause(); break; case cl_value: --- 377,381 ---- grcalc_calculate(); grState = cl_none; ! //grtaps_track_pause(); break; case cl_value: *************** *** 379,383 **** grcalc_calculate(); grState = cl_none; ! grtaps_track_pause(); break; } --- 383,387 ---- grcalc_calculate(); grState = cl_none; ! //grtaps_track_pause(); break; } Index: grtaps.h =================================================================== RCS file: /cvsroot/easycalc/easycalc/grtaps.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** grtaps.h 30 Sep 2007 00:35:42 -0000 1.9 --- grtaps.h 19 Dec 2007 13:20:15 -0000 1.10 *************** *** 50,53 **** --- 50,54 ---- void grtaps_track_track(Int16 track) GRAPH; double grtaps_track_last_value(void) GRAPH; + Int16 grtaps_trackSelected(void) GRAPH; #endif |