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#ifndef WIDGET_LAYOUT_TEST_STRING_VIEW_H
6#define WIDGET_LAYOUT_TEST_STRING_VIEW_H
7
8
9#include <String.h>
10
11#include "View.h"
12
13
14class StringView : public View {
15public:
16								StringView(const char* string);
17
18			void				SetString(const char* string);
19			void				SetAlignment(alignment align);
20			void				SetTextColor(rgb_color color);
21
22	virtual	BSize				MinSize();
23
24			void				SetExplicitMinSize(BSize size);
25
26	virtual	void				AddedToContainer();
27
28	virtual	void				Draw(BView* container, BRect updateRect);
29
30private:
31			void				_UpdateStringMetrics();
32
33private:
34			BString				fString;
35			alignment			fAlignment;
36			rgb_color			fTextColor;
37			float				fStringAscent;
38			float				fStringDescent;
39			float				fStringWidth;
40			BSize				fExplicitMinSize;
41};
42
43
44#endif	// WIDGET_LAYOUT_TEST_STRING_VIEW_H
45