Form library FormWindEnd() FormRestore()
Programming guideline of WinDom

FormSave()

NAME

FormSave - Save a formular state.

PROTOTYPAGE

void FormSave( WINDOW *win, int mode);

PARAMETERS

win:
window descriptor,

mode:
OC_FORM or OC_TOOLBAR.

DESCRIPTION

This function saves the state of the objects in a window formular or a toolbar.

EXAMPLE

/* save a formular */

         {
             OBJECT *tree;
             WINDOW *win;
     		static char title[] = "Formular title";
             void (*DoForm)( WINDOW *);  /* see below */
     
     		/* Create a formular */
             rsrc_gaddr( 0, MYDIAL, &tree);
             win = FormCreate( tree, MOVER|NAME|SMALLER|CLOSER,
                                     DoForm, title, NULL, TRUE, FALSE);
     		/* Save the formular */
             FormSave( win, OC_FORM);
         }
/* restore the formular (when a CANCEL button is selected) */

         void GereForm( WINDOW *win)
         {
              if( evnt.buff[4] == MYDIAL_ANNUL)
              {
                   Restore( win, OC_FORM);  /* On restore l'état */
                   snd_msg( win, WM_CLOSED);
              }
         }
REMARKS

Memory used by FormSave() is free up when the window is destroyed by the standard form event function in a case of window formular or by WindDelete() and WindSet( , WF_TOOLBAR, NULL) in a case of a toolbar.

SEE ALSO

FormRestore().