/* *****                                                            *****
** *****           Program created by Ken Farinsky, 1986.           *****
** *****                                                            *****
**
** All material contained herein may be used in any way desired.
**                    >>>>> i.e.  PUBLIC DOMAIN. <<<<<
** Not limited to any single bulletin board - can be freely transferred.
**
** Original distribution through:
**     Slipped Disk, Inc.
**     Madison Heights,  MI  48071
**     (313) 583-9803
**
** Distributed in the hopes of increasing the level of understanding of the
** Amiga personal computer.  Even the best computer can only succeed with
** the proper software support.
*/
#include <exec/types.h>
#include <intuition/intuition.h>
#include <functions.h>
#include "view.h"

extern struct Library	   *IntuitionBase ;
extern struct Library	   *GfxBase ;
extern struct Library	   *DosBase ;


/*----------------------------------------------------------------------
** update_prop() - updates a prop gadget to reflect the number of lines
** in the file (tot_recs), the number of lines that can fit into the window
** (win_size), and the current offset of the top line in the window
** in the file (cur_offset).
*/
void update_prop( win, prop_gad, tot_recs, win_size, cur_offset)
struct Window	*win ;
struct Gadget	*prop_gad ;
SHORT			 tot_recs ;
SHORT			 win_size ;
SHORT			 cur_offset ;
{
if ( tot_recs > win_size)
	ModifyProp( prop_gad, win, NULL, AUTOKNOB | FREEVERT,
			0L, (long)((0xffffL * (long)cur_offset)/(long)(tot_recs-win_size)),
			0xffffL, (long)((0xffffL * (long)win_size) / (long)tot_recs)) ;
else
	ModifyProp(prop_gad,win,NULL,AUTOKNOB | FREEVERT,0L,0L,0xffffL,0xffffL) ;
}
