<HEAD><TITLE>class Scale</TITLE> </HEAD>
<BODY>
<H2>Scale</H2>
<PRE>
	class Scale : public BView ;
</PRE>
A Scale is a simple ruler drawn within its own View.<BR>
A Scale has two types of ticks (long ticks and short ticks).<BR>
A Scale can be either horizontal or vertical (but not both:-), this orientation
is determined by the aspect ratio of the View.

<PRE>
Here is a badly-drawn example (sorry I didn't have a .GIF }-: )
 __
|
|_
|
|__
|
|_
|
|__
    |__,__|__,__|__,__|__,__|__,__|
</PRE>

<HR>
<H3>Constructor</H3>
<PRE>
	Scale (
		BRect frame,
		const char *name,
		float tick_gap,
		unsigned tick_count,
		uint32 resizeMode,
		uint32 flags
	) ;
</PRE>
The <I>frame</I>, <I>name</I>, <I>resizeMode</I> and <I>flags</I> get
passed straight on to the BView constructor.<BR>
<I>tick_gap</I> is the distance (in co-ordinate units?) between short ticks.<BR>
<I>tick_count</I> is the distance in short ticks between long ticks.
So, if you want a Scale with inches and 1/8ths of inches you would set tick_gap
to be 9 (assuming 72dpi, 9 pixels is 1/8th inch) and the tick_count to be 8
(8 short ticks per long tick).
If you only want one type of tick, then set tick_count to 1. <BR>
The length of the long tick is the same as the width (or height) of the View
(depending on orientation). The length of the short tick is half the long tick.

<HR>
<H3>Member Functions</H3>
<PRE>
	void SetColor (rgb_color);
</PRE>
Sets the color of the Scale. 
<PRE>
	virtual void Draw(BRect);
</PRE>
Draws the Scale
<HR>
<H3>Example</H3>
<PRE>
{
	rgb_color red = {255,0,0,0};
	BRect srect (2,16,2+7,16+132);
	Scale *s = new Scale (srect, "VScale", 5, 2, B_FOLLOW_ALL, B_WILL_DRAW);

	AddChild(s);
	s->SetViewColor(192,192,192);
	s->SetColor(red);
}
</PRE>
Copyright <A MAILTO:bebox@dircon.co.uk>John Cooke</A> 1997.<BR>
You may use/abuse/hack/modify/disembowel this code in whatever way you desire.
</BODY>
