Sindbad~EG File Manager
// 2.8.24 modified type of get_hint
#include <stdio.h> /* FILE */
#include "globals.h"
#include "graphstr.h"
#include "mpdoc.h"
#include "cflags.h" /* automode(), menumode(), GetActiveDoc */
#include "checkarg.h" /* condition, needed by execute.h*/
#include "execute.h" /* cogitate */
#include "fremark.h" /* final_remark */
#include "autosum.h" /* set_hintflag */
#ifndef PRODUCTION
#include "autotest.h" /* autotest */
#endif
#include "tdefn.h" /* topic numbers */
#include "probtype.h"
#include "automode.h" /* get_activeline */
#include "preferences.h" /* get_buttonsize etc. incl get_webgrades */
#include "debug.h" /* PRODUCTION */
#include "natlang.h" /* ButtonText */
#include "bigrect.h" /* BIGRECT */
#include "showstepfocus.h" /* InitializeShowStep */
#include "activedoc.h" /* GetActiveDoc */
#include "autosimp.h" /* GetShowStepOperation */
#include "display1.h" /* needed by lterm.h */
#include "lterm.h" /* lterm */
#include "dowith.h" /* destroy_ltermlist */
#include "speedbar2.h" /* get_hint */
/*____________________________________________________________*/
void get_hint(PDOCDATA pDocData,char *text, int bytesavail)
// generate a hint and store it in text, which has room for bytesavail characters*/
{ int flag,nsteps;
operation op;
actualop code;
const char *hint;
set_hintflag(1);
/* invalidate rectangle(s) of presently selected term(s).
Otherwise an old value of
ShowStepOperation can be retrieved by GetShowStepOperation below.
We only want values that are set during 'cogitate'.
*/
destroy_ltermlist(pDocData->papyrus->selected);
pDocData->papyrus->selected = NULL;
InitializeShowStep();
nsteps = cogitate(pDocData,1,&op,&flag);
code = GetShowStepOperation();
if(code)
code_to_op(code,&op);
set_hintflag(0);
if(!nsteps)
hint = english(1219);
/* Mathpert has no suggestion. Maybe you're done. */
else
hint = hints(op.men, op.choice-1);
strncpy(text, hint,bytesavail);
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists