mf_browse()

Allows the user to view and scroll a memory file in a window

Call
#include <vv_wnkt.h>
int mf_browse(wnp)

WINDOWPTR wnp

Pointer to window with an associated memory file

Returns  
AC_QUIT The user pressed the quit key (i.e., the action code was set by an event function to AC_QUIT).
AC_EXIT The user pressed the exit key (i.e., the action code was set by an event function to AC_EXIT).
0 An event function returned 0 or an error occurred. In case of an error, the global error code VV_ERR is set to:
  MEMLACK There is insufficient memory to display the window
  NO_BROWSE The processing function was not enabled. Include vv_wnkt.h and recompile your application.
Description

mf_browse() displays a memory file in a window and passes control to the user for viewing. Before calling mf_browse(), the memory file must be initialized by a call to mf_def(). The memory file must be associated with the window by calling sw_mf(), or by defining the window with wn_mfdef().

First, if the window has not already been set on the screen, mf_browse() calls wn_up() to set the window.

mf_disp() is then called to display the appropriate portion of the memory file in the window. Thus, if the memory file is set to operate on one keyworded section, only that keyworded section is displayed. Top-of-file and bottom-of-file messages are displayed if enabled for the memory file. (Use smf_opt() to control the display of these messages.)

The global event queue is searched for an event. If no event was found, the keyboard buffer is checked for one or more identical keycodes.

The system event table SYSETP is searched first. If there is an event function assigned to the event code in the system event table, this function is called. Otherwise, the view event table (VIEWETP) is searched. If the event code has an associated event function in the view event table, it is called. The default function in the view event table is called if no match is found in either event table. (There should always be a default function in the view event table.)

When an event function sets the window origin within the memory file, the window is redrawn to display the appropriate part of the memory file.

mf_browse() returns when an event function sets the action code to AC_EXIT or AC_QUIT.

If mf_browse() set the window on the screen, it also removes the window from the screen.

Related Functions

mf_disp()

Cautions

mf_browse() is a macro and does no error checking. Macros are not listed by the VCS error reporting system.

Prior to using mf_browse(), a memory file structure must be established and assigned to the window.


Home Contents Previous Next