/*
**	GadTools layout toolkit
**
**	Copyright © 1993-1996 by Olaf `Olsen' Barthel
**		Freely distributable.
**
**	:ts=4
*/

#ifndef _GTLAYOUT_GLOBAL_H
#include "gtlayout_global.h"
#endif

VOID
LTP_DrawPicker(struct RastPort *RPort,BOOL UpDirection,LONG Left,LONG Top,LONG Width,LONG Height)
{
	LONG i,Len,ArrowHeight,ArrowWidth,LineHeight,Start,Pos;

	LineHeight	= (Height + 15) / 16;
	ArrowHeight	= Height - (Height + 7) / 8;
	ArrowWidth	= Width;

	for(i = 0 ; i < ArrowHeight ; i++)
	{
		Len = ((ArrowWidth * (i + 1)) / ArrowHeight) & ~1;

		if(Len < ArrowWidth)
			Len++;

		Start = Left + (ArrowWidth - Len) / 2;

		if(UpDirection)
			Pos = Top + i;
		else
			Pos = Top + ArrowHeight - 1 - i;

		LTP_DrawLine(RPort,Start,Pos,Start + Len - 1,Pos);
	}

	for(i = 0 ; i < LineHeight ; i++)
		LTP_DrawLine(RPort,Left,Top + Height - 1 - i,Left + Width - 1,Top + Height - 1 - i);
}
