14ac1c030SIngo Weinhold/*
24ac1c030SIngo Weinhold * Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
34ac1c030SIngo Weinhold * All rights reserved. Distributed under the terms of the MIT License.
44ac1c030SIngo Weinhold */
54ac1c030SIngo Weinhold
64ac1c030SIngo Weinhold#include "TestView.h"
74ac1c030SIngo Weinhold
84ac1c030SIngo Weinhold
94ac1c030SIngo WeinholdTestView::TestView(BSize minSize, BSize maxSize, BSize preferredSize)
104ac1c030SIngo Weinhold	: BView("test view", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
114ac1c030SIngo Weinhold	  fMinSize(minSize),
124ac1c030SIngo Weinhold	  fMaxSize(maxSize),
134ac1c030SIngo Weinhold	  fPreferredSize(preferredSize)
144ac1c030SIngo Weinhold{
154ac1c030SIngo Weinhold	SetViewColor((rgb_color){150, 220, 150, 255});
164ac1c030SIngo Weinhold	SetHighColor((rgb_color){0, 80, 0, 255});
174ac1c030SIngo Weinhold}
184ac1c030SIngo Weinhold
194ac1c030SIngo Weinhold
204ac1c030SIngo WeinholdBSize
214ac1c030SIngo WeinholdTestView::MinSize()
224ac1c030SIngo Weinhold{
234ac1c030SIngo Weinhold	return fMinSize;
244ac1c030SIngo Weinhold}
254ac1c030SIngo Weinhold
264ac1c030SIngo Weinhold
274ac1c030SIngo WeinholdBSize
284ac1c030SIngo WeinholdTestView::MaxSize()
294ac1c030SIngo Weinhold{
304ac1c030SIngo Weinhold	return fMaxSize;
314ac1c030SIngo Weinhold}
324ac1c030SIngo Weinhold
334ac1c030SIngo Weinhold
344ac1c030SIngo WeinholdBSize
354ac1c030SIngo WeinholdTestView::PreferredSize()
364ac1c030SIngo Weinhold{
374ac1c030SIngo Weinhold	return fPreferredSize;
384ac1c030SIngo Weinhold}
394ac1c030SIngo Weinhold
404ac1c030SIngo Weinhold
414ac1c030SIngo Weinholdvoid
424ac1c030SIngo WeinholdTestView::Draw(BRect updateRect)
434ac1c030SIngo Weinhold{
444ac1c030SIngo Weinhold	BRect bounds(Bounds());
454ac1c030SIngo Weinhold	StrokeRect(bounds);
464ac1c030SIngo Weinhold	StrokeLine(bounds.LeftTop(), bounds.RightBottom());
474ac1c030SIngo Weinhold	StrokeLine(bounds.LeftBottom(), bounds.RightTop());
484ac1c030SIngo Weinhold}
49