1/*
2 * Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5
6#include "TestView.h"
7
8
9TestView::TestView(BSize minSize, BSize maxSize, BSize preferredSize)
10	: BView("test view", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
11	  fMinSize(minSize),
12	  fMaxSize(maxSize),
13	  fPreferredSize(preferredSize)
14{
15	SetViewColor((rgb_color){150, 220, 150, 255});
16	SetHighColor((rgb_color){0, 80, 0, 255});
17}
18
19
20BSize
21TestView::MinSize()
22{
23	return fMinSize;
24}
25
26
27BSize
28TestView::MaxSize()
29{
30	return fMaxSize;
31}
32
33
34BSize
35TestView::PreferredSize()
36{
37	return fPreferredSize;
38}
39
40
41void
42TestView::Draw(BRect updateRect)
43{
44	BRect bounds(Bounds());
45	StrokeRect(bounds);
46	StrokeLine(bounds.LeftTop(), bounds.RightBottom());
47	StrokeLine(bounds.LeftBottom(), bounds.RightTop());
48}
49