home *** CD-ROM | disk | FTP | other *** search
- /*
- To allow a database program that is using the standard DataBoss skeleton
- to access a nested menu simply cust the "_Menu" case from the "do_ctl()"
- function in MBRUN.C, and paste it into the "do_ctl()" function in the
- skeleton.
- */
-
- void do_ctl(mnufrec *m, itmptr itm)
- {
- string ts;
- uchar yes[2],tpic[2];
-
- if ((m->curmnu != NULL) && (itm != NULL)) {
- switch (itm->seltyp) {
- case _Proc : do_proc((int) ival(itm->selact),m); break;
- case _Quit :
- dbgetstr(ts,_Ch,LSC_QuitDataBase,chstr(yes,_YES),chstr(tpic,Pic_U),"",chkyesno,nohelp);
- quit = (bool)((ts[0] == _YES) && (exitcode != QitKey));
- break;
-
- /** Add the following case **/
- case _Menu :
- if ((ival(itm->selact) > 0) && (m->mat[(int) ival(itm->selact)-1] != NULL)) {
- if (m->mat[(int) ival(itm->selact)-1]->winp != NULL)
- jumptomnu(m,(byte) ival(itm->selact));
- else {
- m->mat[(int) ival(itm->selact)-1]->pmnu = m->curmnu->mno;
- m->curmnu = m->mat[(int) ival(itm->selact)-1];
- dspmnu(m,m->curmnu);
- m->curitm = m->curmnu->litm;
- m->level = 0;
- }
- }
- break;
- /** End Additions **/
-
- }
- }
- }
-