pt_menuitem showmenus(char startmenu) { pt_menuitem rv; char oldpage,tpos; // Setup screen for menusystem oldpage = getdisppage(); setdisppage(ms->menupage); cls(); clearwindow(ms->minrow, ms->mincol, ms->maxrow, ms->maxcol, ms->menupage, ms->fillchar, ms->fillattr); tpos = (ms->numcols - strlen(ms->title) - 1) >> 1; // center it on line gotoxy(ms->minrow,ms->mincol,ms->menupage); cprint(ms->tfillchar,ms->titleattr,ms->numcols,ms->menupage); gotoxy(ms->minrow,ms->mincol+tpos,ms->menupage); csprint(ms->title,ms->titleattr); cursoroff(); // Doesn't seem to work? // Go, main menu cannot be a radio menu rv = runmenusystem(ms->minrow+MENUROW, ms->mincol+MENUCOL, ms->menus[(unsigned int)startmenu], 0, NORMALMENU); // Hide the garbage we left on the screen cursoron(); if (oldpage == ms->menupage) cls(); else setdisppage(oldpage); // Return user choice return rv; }
void runhelp(const char *filename) { char dp; char fullname[HELPDIRLEN+16]; dp = getdisppage(); if (dp != HELPPAGE) setdisppage(HELPPAGE); cursoroff(); if (helpbasedir[0] != 0) { strcpy(fullname,helpbasedir); strcat(fullname,"/"); strcat(fullname,filename); showhelp(fullname); } else showhelp (filename); // Assume filename is absolute if (dp != HELPPAGE) setdisppage(dp); }