/* mn_show.c *********** Copyright 1988-1993 by Vermont Creative Software *********** mn_show() Redisplays menu forms Call #include int mn_show(action_code, start_mfmp) int action_code; Code indicating how many menus are hidden MFORMPTR start_mfmp; Pointer to first (lowest-level) menu that was hidden action_code: Specify the same value that was passed to mn_hide() when the menus were hidden. Possible values are: MN_CUR Redisplay the current menu only MN_SUB Redisplay all menus up to, but not including, the top-level menu MN_ALL Redisplay all menus in this branch of the menu tree start_mfmp: Specify the SAME form pointer that was passed to mn_hide() when the menus were hidden. This should be the lowest-level menu that was hidden. Returns 1 The menu form(s) were successfully redisplayed. Description mn_show() redisplays menus that were previously hidden by a call to mn_hide(). If the action code is MN_SUB and only one menu is on the screen, this menu is not redisplayed since mn_hide() would not have hidden it. Related Functions mn_hide() Cautions The action_code and start_mfmp passed to mn_show() must be the same as those passed to mn_hide(). If they are not, the results may be bizzare. */ #include #ifdef OLD_STYLE int FASTCALL mn_show(action_code, start_mfmp) int action_code; MFORMPTR start_mfmp; #else int FASTCALL mn_show(int action_code, MFORMPTR start_mfmp) #endif { MFORMPTR mfmp; WINDOWPTR wnp; int retval = 1; #ifndef NO_DEBUG_CODE static UCHAR fn[] = "mn_show"; #endif INIT_MODULE(fn); mfmp = start_mfmp; /*----------------------------------------------------------------------------*/ /* If all menus except the top-level menu are to be redisplayed but this IS */ /* the top-level menu, do nothing. */ /*----------------------------------------------------------------------------*/ if ((action_code == MN_SUB) && (!mfmp->parent_fmp)) goto END; /*----------------------------------------------------------------------------*/ /* Redisplay each menu until we get to the top of the redisplay tree. */ /*----------------------------------------------------------------------------*/ do { wnp = mfmp->msg_wnp; if (wnp && wn_isup(wnp)) /* If menu msg window up, show it */ { wnp->flags &= ~WNHIDDEN; _wn_redraw(WNCHILDREN, wnp, wnp->rbf, wnp->cbf, wnp->ref, wnp->cef); _shad_updn(UP, wnp); } wnp = mfmp->wnp; wnp->flags &= ~WNHIDDEN; _wn_redraw(WNCHILDREN, wnp, wnp->rbf, wnp->cbf, wnp->ref, wnp->cef); _shad_updn(UP, wnp); mfmp = mfmp->parent_fmp; } while (mfmp && (action_code == MN_ALL || (action_code == MN_SUB && mfmp->parent_fmp))); END: EXIT_NOERRH(fn); return(retval); }