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 15 class 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 { return fProperty; } 35 36 private: 37 void _ToggleValue(); 38 39 BoolProperty* fProperty; 40 41 BRect fCheckBoxRect; 42 bool fEnabled; 43 }; 44 45 #endif // BOOL_VALUE_VIEW_H 46 47 48