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 "PropertyEditorView.h" 13 14 class BoolProperty; 15 16 class BoolValueView : public PropertyEditorView { 17 public: 18 BoolValueView(BoolProperty* property); 19 virtual ~BoolValueView(); 20 21 // BView interface 22 virtual void Draw(BRect updateRect); 23 virtual void FrameResized(float width, float height); 24 25 virtual void MakeFocus(bool focused); 26 27 virtual void MouseDown(BPoint where); 28 virtual void KeyDown(const char* bytes, int32 numBytes); 29 30 // PropertyEditorView interface 31 virtual void SetEnabled(bool enabled); 32 33 virtual bool AdoptProperty(Property* property); 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