1/*
2 * Copyright 2006, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Stephan Aßmus <superstippi@gmx.de>
7 */
8
9#ifndef BOOL_VALUE_VIEW_H
10#define BOOL_VALUE_VIEW_H
11
12#include "Property.h"
13#include "PropertyEditorView.h"
14
15class BoolValueView : public PropertyEditorView {
16 public:
17								BoolValueView(BoolProperty* property);
18	virtual						~BoolValueView();
19
20	// BView interface
21	virtual	void				Draw(BRect updateRect);
22	virtual	void				FrameResized(float width, float height);
23
24	virtual	void				MakeFocus(bool focused);
25
26	virtual	void				MouseDown(BPoint where);
27	virtual	void				KeyDown(const char* bytes, int32 numBytes);
28
29	// PropertyEditorView interface
30	virtual	void				SetEnabled(bool enabled);
31
32	virtual	bool				AdoptProperty(Property* property);
33	virtual	Property*			GetProperty() const;
34
35 private:
36			void				_ToggleValue();
37
38			BoolProperty*		fProperty;
39
40			BRect				fCheckBoxRect;
41			bool				fEnabled;
42};
43
44#endif // BOOL_VALUE_VIEW_H
45
46
47